mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-01-11 09:50:06 +00:00
Only set flags if the compiler support them
This commit is contained in:
parent
516a89f936
commit
2f2a75af4a
@ -12,7 +12,16 @@ set(TEST_NAMES
|
||||
test_parse_file
|
||||
)
|
||||
|
||||
add_definitions("-Wall -Wpedantic")
|
||||
CHECK_CXX_COMPILER_FLAG("-Wall" COMPILER_SUPPORTS_WALL)
|
||||
CHECK_CXX_COMPILER_FLAG("-Wpedantic" COMPILER_SUPPORTS_WPEDANTIC)
|
||||
|
||||
if(COMPILER_SUPPORTS_WALL)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
endif()
|
||||
|
||||
if(COMPILER_SUPPORTS_WPEDANTIC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic")
|
||||
endif()
|
||||
|
||||
set(test_library_dependencies)
|
||||
find_library(BOOST_UNITTEST_FRAMEWORK_LIBRARY boost_unit_test_framework)
|
||||
|
Loading…
Reference in New Issue
Block a user