On 10/10/2013 08:07 PM, Stephen Kelly wrote:
> So, I think this is a two dimensional calculation. There is a standard axis 
> and a extension axis for the compiler flag, for GCC and clang at least.

Yes.

>  if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
>    set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
>    set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
>  endif()

Will this work for XL too?

> I wonder if we should always use the extension flag, unless otherwise 
> specified with set(CMAKE_STRICT_CXX_STANDARD ON)? 
> 
> Because gnu++98 is the GCC default, someone could be using 'gnu template 
> instantiation' in existing code, and then uses CMake to specify the need for 
> variadic_templates, so we add -std=c++11 and boom - no more gnu extensions.

As you point out the user would have to have modified the project anyway
so at that point they can specify explicitly the "default" extensions
they were using before.

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to