Fixed GLM test '/fp:fast' and '/Za' command-line options are incompatible

This commit is contained in:
Christophe Riccio 2016-07-16 23:54:11 +02:00
parent 630f0840f2
commit a1b4bdbf03
2 changed files with 18 additions and 16 deletions

View File

@ -31,6 +31,8 @@ if(NOT GLM_TEST_ENABLE)
message(STATUS "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") message(STATUS "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() endif()
option(GLM_TEST_ENABLE_FAST_MATH "Enable fast math optimizations" OFF)
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND UNIX)) if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND UNIX))
option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF) option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF)
option(GLM_TEST_ENABLE_CXX_0X "Enable C++ 0x" OFF) option(GLM_TEST_ENABLE_CXX_0X "Enable C++ 0x" OFF)
@ -68,7 +70,21 @@ endif()
option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF) option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF)
if(NOT GLM_TEST_ENABLE_LANG_EXTENSIONS) if(GLM_TEST_ENABLE_LANG_EXTENSIONS)
if(GLM_TEST_ENABLE_FAST_MATH)
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-ffast-math)
endif()
if(MSVC)
add_definitions(/fp:fast)
endif()
elseif(NOT GLM_TEST_ENABLE_FAST_MATH)
if(MSVC)
add_definitions(/fp:precise)
endif()
endif()
else()
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND WIN32)) if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND WIN32))
add_definitions(/Za) add_definitions(/Za)
elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")) elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"))
@ -122,21 +138,6 @@ elseif(GLM_TEST_ENABLE_SIMD_SSE2)
endif() endif()
endif() endif()
option(GLM_TEST_ENABLE_FAST_MATH "Enable fast math optimizations" OFF)
if(GLM_TEST_ENABLE_FAST_MATH)
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-ffast-math)
endif()
if(MSVC)
add_definitions(/fp:fast)
endif()
elseif(NOT GLM_TEST_ENABLE_FAST_MATH)
if(MSVC)
add_definitions(/fp:precise)
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
#add_definitions(-S) #add_definitions(-S)
#add_definitions(-s) #add_definitions(-s)

View File

@ -100,6 +100,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- Fixed sign with signed integer function on non-x86 architecture - Fixed sign with signed integer function on non-x86 architecture
- Fixed strict aliasing warnings #473 - Fixed strict aliasing warnings #473
- Fixed missing vec1 overload to length2 and distance2 functions #431 - Fixed missing vec1 overload to length2 and distance2 functions #431
- Fixed GLM test '/fp:fast' and '/Za' command-line options are incompatible
##### Deprecation: ##### Deprecation:
- Removed GLM_FORCE_SIZE_FUNC define - Removed GLM_FORCE_SIZE_FUNC define