mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Fix compiler flags check.
This commit is contained in:
@ -11,10 +11,13 @@ endif ()
|
|||||||
project(FORMAT)
|
project(FORMAT)
|
||||||
|
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
check_cxx_compiler_flag(-std=c++11 HAVE_STD_CPP11_FLAG)
|
foreach (flag -std=c++11 -std=c++0x)
|
||||||
if (NOT HAVE_STD_CPP11_FLAG)
|
check_cxx_compiler_flag(${flag} HAVE_STD_CPP11_FLAG)
|
||||||
check_cxx_compiler_flag(-std=c++0x HAVE_STD_CPP11_FLAG)
|
if (HAVE_STD_CPP11_FLAG)
|
||||||
endif ()
|
set(CPP11_FLAG ${flag})
|
||||||
|
break ()
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
@ -40,7 +43,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
"-Wall -Wextra -pedantic")
|
"-Wall -Wextra -pedantic")
|
||||||
endif ()
|
endif ()
|
||||||
if (HAVE_STD_CPP11_FLAG)
|
if (HAVE_STD_CPP11_FLAG)
|
||||||
set_target_properties(format PROPERTIES COMPILE_FLAGS "-std=c++11")
|
set_target_properties(format PROPERTIES COMPILE_FLAGS ${CPP11_FLAG})
|
||||||
# Test compilation with default flags.
|
# Test compilation with default flags.
|
||||||
add_library(testformat format.cc)
|
add_library(testformat format.cc)
|
||||||
endif ()
|
endif ()
|
||||||
|
Reference in New Issue
Block a user