Clang-CXX.cmake 1.0 KB

123456789101112131415161718192021222324252627282930
  1. include(Compiler/Clang)
  2. __compiler_clang(CXX)
  3. __compiler_clang_cxx_standards(CXX)
  4. if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
  5. if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
  6. AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
  7. AND CMAKE_DEPFILE_FLAGS_CXX)
  8. # dependencies are computed by the compiler itself
  9. set(CMAKE_CXX_DEPFILE_FORMAT gcc)
  10. set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
  11. endif()
  12. set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
  13. set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
  14. endif()
  15. cmake_policy(GET CMP0025 appleClangPolicy)
  16. if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
  17. return()
  18. endif()
  19. if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
  20. set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl")
  21. if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
  22. AND CMAKE_GENERATOR MATCHES "Makefiles"
  23. AND CMAKE_DEPFILE_FLAGS_CXX)
  24. set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
  25. endif()
  26. endif()