File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ project("libsdcparse")
77if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} )
88 #Only set compiler settings if we are not a sub-project
99 set (WARN_FLAGS "-Wall -Wextra -Wpedantic -Wcast-qual -Wcast-align -Wshadow -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wredundant-decls -Wswitch-default -Wundef -Wunused-variable -Wdisabled-optimization -Wnoexcept -Woverloaded-virtual -Wctor-dtor-privacy -Wnon-virtual-dtor" )
10- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 ${WARN_FLAGS} " )
10+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++14 ${WARN_FLAGS} " )
1111 #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined")
1212 set (FLEX_BISON_WARN_SUPPRESS_FLAGS "-Wno-switch-default -Wno-unused-parameter -Wno-missing-declarations" )
1313endif ()
@@ -53,4 +53,17 @@ set_target_properties(libsdcparse PROPERTIES PREFIX "") #Avoid extra 'lib' prefi
5353add_executable (sdcparse_test src/main.cpp)
5454target_link_libraries (sdcparse_test libsdcparse)
5555
56+ #Suppress IPO link warnings
57+ get_target_property (USES_IPO sdcparse_test INTERPROCEDURAL_OPTIMIZATION )
58+ if (USES_IPO)
59+ set (IPO_LINK_WARN_FLAGS_TO_CHECK "-Wno-null-dereference" )
60+ foreach (flag ${IPO_LINK_WARN_FLAGS_TO_CHECK} )
61+ CHECK_CXX_COMPILER_FLAG(${flag} CXX_COMPILER_SUPPORTS_${flag} )
62+ if (CXX_COMPILER_SUPPORTS_${flag} )
63+ #Flag supported, so enable it
64+ set_target_properties (sdcparse_test PROPERTIES LINK_FLAGS ${flag} )
65+ endif ()
66+ endforeach ()
67+ endif ()
68+
5669install (TARGETS libsdcparse sdcparse_test DESTINATION bin)
You can’t perform that action at this time.
0 commit comments