summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCharles Giessen <[email protected]>2024-07-16 00:53:45 -0500
committerCharles Giessen <[email protected]>2024-07-16 01:13:21 -0500
commitb379292b2ab6df5771ba9870d53cf8b2c9295daf (patch)
tree60d1dc3edd2561cd7453ab6a4b8f23e69467f1f1
parentfc6c06ac529e4b4b6e34c17cc650a8f62dee2eb0 (diff)
downloadVulkan-Headers-b379292b2ab6df5771ba9870d53cf8b2c9295daf.tar.gz
Vulkan-Headers-b379292b2ab6df5771ba9870d53cf8b2c9295daf.zip
cmake: Disable modules if clang-scan-deps is missingvulkan-sdk-1.3.290.0v1.3.290vulkan-sdk-1.3.290
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.txt5
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()