Clang-CXX.cmake 824 B

123456789101112131415161718192021222324
  1. include(Compiler/Clang)
  2. __compiler_clang(CXX)
  3. if(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
  4. set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
  5. endif()
  6. cmake_policy(GET CMP0025 appleClangPolicy)
  7. if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
  8. return()
  9. endif()
  10. if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
  11. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
  12. set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
  13. endif()
  14. if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
  15. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
  16. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
  17. elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
  18. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
  19. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
  20. endif()