Autotools 检查 C++11 [英] Autotools check for C++11
问题描述
我使用 AX_CXX_COMPILE_STDCXX_0X
(可以查看 autoconf-archive)来检查编译器的 C++11 功能.它正确地确定需要 -std=c++0x
,但没有将其添加到 CXXFLAGS
.我查看了宏源,它实际上进行了检查,但随后恢复了以前的标志.
I use AX_CXX_COMPILE_STDCXX_0X
(can look on autoconf-archive) to check for c++11 capabilities of the compiler. It correctly determines that -std=c++0x
required, but does not add it to CXXFLAGS
. I took a look at the macro source and it actually checks but then restores previous flags.
我应该怎么做才能将 CXXFLAGS
设置为能够编译 c++11 源代码?
What should I do to get CXXFLAGS
set to be able to compile c++11 source?
仅仅将 -std=c++0x
添加到 AM_CXXFLAGS
并不是一个好的解决方案,因为我想把编译器编译的负担放在 C+ 中autoconf 开发人员的 +11 模式,而不是我.
Just adding -std=c++0x
to AM_CXXFLAGS
is not nice solution, because I'd like to put the burden of making the compiler compile in C++11 mode on the autoconf developers, not me.
推荐答案
您要找的已经制作成 AX_CXX_COMPILE_STDCXX_11
,autoconf-archive.它将向环境添加所需的选项(以前通过 CXXFLAGS
,现在通过 CXX
)并在没有 C++11 支持时出错.
What you're looking for has already been made as AX_CXX_COMPILE_STDCXX_11
, part of autoconf-archive. It will add the required option to the environment (formerly through CXXFLAGS
, now through CXX
) and error out if no C++11 support is available.
这篇关于Autotools 检查 C++11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!