Autotools检查C ++ 11 [英] Autotools check for C++11

查看:244
本文介绍了Autotools检查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 ++ 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.

推荐答案

您要查找的内容已经是 AX_CXX_COMPILE_STDCXX_11 。如果没有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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆