mirror of
https://github.com/g-truc/glm.git
synced 2025-04-05 21:45:02 +00:00
Improved Intel Compiler detection
This commit is contained in:
parent
db5a610882
commit
1cebfa7bda
3 changed files with 44 additions and 6 deletions
|
@ -11,8 +11,14 @@ if(NOT GLM_TEST_ENABLE)
|
|||
message(FATAL_ERROR "GLM is a header only library, no need to build it. Set the option GLM_TEST_ENABLE with ON to build and run the test bench")
|
||||
endif()
|
||||
|
||||
option(GLM_USE_INTEL "Use Intel Compiler" OFF)
|
||||
|
||||
option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF)
|
||||
if(GLM_TEST_ENABLE_CXX_11)
|
||||
if(GLM_USE_INTEL)
|
||||
add_definitions(/Qstd=c++0x)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-std=c++0x)
|
||||
endif()
|
||||
|
@ -22,14 +28,25 @@ elseif(NOT GLM_TEST_ENABLE_CXX_11)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
option(GLM_TEST_ENABLE_MS_EXTENSIONS "Enable MS extensions" OFF)
|
||||
if(GLM_TEST_ENABLE_MS_EXTENSIONS)
|
||||
option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF)
|
||||
if(GLM_TEST_ENABLE_LANG_EXTENSIONS)
|
||||
if(GLM_USE_INTEL)
|
||||
add_definitions(/Qintel-extensions)
|
||||
add_definitions(-intel-extensions)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
#Doesn't seem to work...
|
||||
#add_definitions(-fms-extensions)
|
||||
#add_definitions(-D_MSC_EXTENSIONS)
|
||||
endif()
|
||||
elseif(NOT GLM_TEST_ENABLE_MS_EXTENSIONS)
|
||||
|
||||
elseif(NOT GLM_TEST_ENABLE_LANG_EXTENSIONS)
|
||||
if(GLM_USE_INTEL)
|
||||
add_definitions(/Qintel-extensions-)
|
||||
add_definitions(-no-intel-extensions)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-std=c++98)
|
||||
add_definitions(-pedantic)
|
||||
|
@ -46,6 +63,8 @@ option(GLM_TEST_ENABLE_SIMD "Enable SIMD optimizations" OFF)
|
|||
if(GLM_TEST_ENABLE_SIMD)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-msse2)
|
||||
elseif(GLM_USE_INTEL)
|
||||
add_definitions(/QxAVX)
|
||||
elseif(MSVC10)
|
||||
add_definitions(/arch:AVX)
|
||||
elseif(MSVC)
|
||||
|
|
|
@ -471,6 +471,20 @@
|
|||
# define GLM_LANG GLM_LANG_CXX98
|
||||
# endif
|
||||
# endif
|
||||
# elif(GLM_COMPILER & GLM_COMPILER_INTEL)
|
||||
# if(defined(_MSC_EXTENSIONS))
|
||||
# if(GLM_COMPILER >= GLM_COMPILER_INTEL13_0)
|
||||
# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG)
|
||||
# else
|
||||
# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG)
|
||||
# endif
|
||||
# else
|
||||
# if(GLM_COMPILER >= GLM_COMPILER_INTEL13_0)
|
||||
# define GLM_LANG (GLM_LANG_CXX0X)
|
||||
# else
|
||||
# define GLM_LANG (GLM_LANG_CXX98)
|
||||
# endif
|
||||
# endif
|
||||
# elif((GLM_COMPILER & GLM_COMPILER_CLANG) == GLM_COMPILER_CLANG)
|
||||
# define GLM_LANG GLM_LANG_CXX98
|
||||
# else
|
||||
|
@ -481,9 +495,9 @@
|
|||
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_LANG_DISPLAYED))
|
||||
# define GLM_MESSAGE_LANG_DISPLAYED
|
||||
# if(GLM_LANG & GLM_LANG_CXXGNU_FLAG)
|
||||
# pragma message("GLM: C++ with GNU language extensions")
|
||||
# pragma message("GLM: C++ with language extensions")
|
||||
# elif(GLM_LANG & GLM_LANG_CXXMS_FLAG)
|
||||
# pragma message("GLM: C++ with VC language extensions")
|
||||
# pragma message("GLM: C++ with language extensions")
|
||||
# elif(GLM_LANG & GLM_LANG_CXX11_FLAG)
|
||||
# pragma message("GLM: C++11")
|
||||
# elif(GLM_LANG & GLM_LANG_CXX0X_FLAG)
|
||||
|
@ -611,7 +625,7 @@
|
|||
(GLM_LANG & GLM_LANG_CXX98_FLAG)
|
||||
|
||||
#define GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() \
|
||||
(GLM_LANG & GLM_LANG_CXXMS_FLAG)
|
||||
((GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC))
|
||||
|
||||
#define GLM_SUPPORT_SWIZZLE_OPERATOR() \
|
||||
(defined(GLM_SWIZZLE) && GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
|
||||
|
|
|
@ -36,6 +36,11 @@ GLM is a header only library, there is nothing to build, just include it.
|
|||
More informations in GLM manual:
|
||||
http://glm.g-truc.net/glm.pdf
|
||||
|
||||
================================================================================
|
||||
GLM 0.9.5.X: 2013-XX-XX
|
||||
--------------------------------------------------------------------------------
|
||||
- Improved Intel Compiler detection
|
||||
|
||||
================================================================================
|
||||
GLM 0.9.4.2: 2013-01-XX
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Reference in a new issue