FindQuadmath: add -fext-numeric-literals if the compiler supports it
this is required for GCC >= 4.8 to support the 'Q' suffix for floating point literals (which are used in the quadmath.h header) In order to prevent compilers which eat the flag but do not support it from complaining constantly, it is tested for with "-Werror" enabled...
This commit is contained in:
@@ -9,6 +9,12 @@
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(CMakePushCheckState)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
check_cxx_compiler_flag("-Werror -fext-numeric-literals" HAVE_EXTENDED_NUMERIC_LITERALS)
|
||||
if (HAVE_EXTENDED_NUMERIC_LITERALS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals")
|
||||
endif()
|
||||
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "quadmath")
|
||||
|
||||
Reference in New Issue
Block a user