diff options
author | Charles Giessen <[email protected]> | 2024-07-16 00:53:45 -0500 |
---|---|---|
committer | Charles Giessen <[email protected]> | 2024-07-16 00:53:45 -0500 |
commit | ce3cd65f236cf6bd524daad7da25573629e91b8d (patch) | |
tree | 60d1dc3edd2561cd7453ab6a4b8f23e69467f1f1 | |
parent | fc6c06ac529e4b4b6e34c17cc650a8f62dee2eb0 (diff) | |
download | Vulkan-Headers-ce3cd65f236cf6bd524daad7da25573629e91b8d.tar.gz Vulkan-Headers-ce3cd65f236cf6bd524daad7da25573629e91b8d.zip |
cmake: Disable modules if clang-scan-deps is missingdisable_modules_if_clang_scan_deps_is_missing
clang ships the clang-scan-deps tool separately from the compiler, making it possible
that the clang compiler supports modules but cannot be used by CMake for VulkanHppModule.
The straightforward solution is to, when using clang, check that the scan deps tools was
located. This prevents people who are using clang but not the modules from being unable
to use Vulkan-Headers when the clang-scan-deps tools is missing.
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index eef8c2e..fbd223e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,10 @@ target_include_directories(Vulkan-Headers INTERFACE $<BUILD_INTERFACE:${CMAKE_CU if (MSVC AND (MSVC_VERSION GREATER_EQUAL "1941") OR # clang-cl doesn't currently support modules - (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16.0" AND (NOT CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC")) OR + (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16.0" + AND (NOT CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC") + AND (NOT CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS STREQUAL CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND)) OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "14.0")) set(COMPILER_SUPPORTS_CXX_MODULES TRUE) endif() |