Fixed C++11 activation on XCode for the CMake test suite ID

This commit is contained in:
Christophe Riccio 2013-09-10 19:58:02 +02:00
parent 5c84e480bf
commit 6d2170adb3
2 changed files with 15 additions and 7 deletions

View File

@ -23,13 +23,21 @@ if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}"
endif()
if(GLM_TEST_ENABLE_CXX_1Y)
add_definitions(-std=c++1y)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++1y")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
set(CMAKE_CXX_FLAGS "-std=c++1y")
elseif(GLM_TEST_ENABLE_CXX_11)
add_definitions(-std=c++11)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
set(CMAKE_CXX_FLAGS "-std=c++11")
elseif(GLM_TEST_ENABLE_CXX_0X)
add_definitions(-std=c++0x)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++0x")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
set(CMAKE_CXX_FLAGS "-std=c++0x")
elseif(GLM_TEST_ENABLE_CXX_98)
add_definitions(-std=c++98)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++98")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
set(CMAKE_CXX_FLAGS "-std=c++98")
endif()
endif()

View File

@ -104,9 +104,9 @@ int test_compiler()
}
else if(GLM_COMPILER & GLM_COMPILER_CLANG)
{
# ifdef __clang_major__
std::cout << "GLM_COMPILER_CLANG " << __clang_major__ << "." << __clang_minor__ << std::endl;
# endif
# ifdef __clang_major__
std::cout << "GLM_COMPILER_CLANG " << __clang_major__ << "." << __clang_minor__ << std::endl;
# endif
switch(GLM_COMPILER)
{
case GLM_COMPILER_CLANG26: