diff options
Diffstat (limited to 'SetFlags.cmake')
-rw-r--r-- | SetFlags.cmake | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/SetFlags.cmake b/SetFlags.cmake index b79551eef..57cab5a1c 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -63,7 +63,7 @@ macro(set_flags) set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG") set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG") elseif(APPLE) - + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) @@ -262,8 +262,11 @@ macro(set_exe_flags) add_flags_cxx("-Wno-documentation") endif() if ("${CLANG_VERSION}" VERSION_GREATER 3.5) - # Use this flag to ignore error for a reserved macro problem in sqlite 3 - add_flags_cxx("-Wno-reserved-id-macro") + check_cxx_compiler_flag(-Wno-reserved-id-macro HAS_NO_RESERVED_ID_MACRO) + if (HAS_NO_RESERVED_ID_MACRO) + # Use this flag to ignore error for a reserved macro problem in sqlite 3 + add_flags_cxx("-Wno-reserved-id-macro") + endif() endif() endif() endif() @@ -277,7 +280,7 @@ endmacro() # set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=missing-prototypes -Wno-error=deprecated") # set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=shadow -Wno-error=old-style-cast -Wno-error=switch-enum -Wno-error=switch") # set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=float-equal -Wno-error=global-constructors") - + # if ("${CLANG_VERSION}" VERSION_GREATER 3.0) # # flags that are not present in 3.0 # set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=covered-switch-default ") @@ -286,4 +289,3 @@ endmacro() # endif() # endforeach() # endif() - |