CompilerFlags.cmake 553 B

123456789101112131415
  1. # MSVC goes totally bananas if we pass it -Wall
  2. if(NOT MSVC)
  3. enable_if_supported(COMPILER_FLAGS "-Wall")
  4. endif()
  5. enable_if_supported(COMPILER_FLAGS "-fno-omit-frame-pointer")
  6. enable_if_supported(COMPILER_FLAGS "-mmacosx-version-min=10.9")
  7. enable_if_supported(COMPILER_FLAGS "/Oy-")
  8. enable_if_links(LINK_FLAGS "-flto")
  9. enable_if_links(LINK_FLAGS "-fuse-ld=gold")
  10. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}")
  11. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
  12. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINK_FLAGS}")