test for no-double-promotion instead of just checking compiler version
This commit is contained in:
parent
21acc56d57
commit
8c4059766e
@ -1,3 +1,5 @@
|
|||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
set(UNITTEST_SOURCES
|
set(UNITTEST_SOURCES
|
||||||
allocatorstest.cpp
|
allocatorstest.cpp
|
||||||
bigintegertest.cpp
|
bigintegertest.cpp
|
||||||
@ -41,8 +43,11 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|||||||
# If the user is running a newer version of Clang that includes the
|
# If the user is running a newer version of Clang that includes the
|
||||||
# -Wdouble-promotion, we will ignore that warning.
|
# -Wdouble-promotion, we will ignore that warning.
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.7)
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.7)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-Wno-double-promotion" HAS_NO_DOUBLE_PROMOTION)
|
||||||
|
if (HAS_NO_DOUBLE_PROMOTION)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-double-promotion")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-double-promotion")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
# Force to always compile with /W4
|
# Force to always compile with /W4
|
||||||
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user