问题描述
我使用 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 ++ 11模式在autoconf开发人员,而不是我。
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.
推荐答案
您要查找的内容已经是。如果没有C ++ 11支持,则会向 CXXFLAGS
添加必需的选项。
What you're looking for has already been made as AX_CXX_COMPILE_STDCXX_11
. It will add the required option to CXXFLAGS
and error out if no C++11 support is available.
这篇关于Autotools检查C ++ 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!