aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCharles Giessen <[email protected]>2024-10-22 11:48:46 -0500
committerCharles Giessen <[email protected]>2024-10-29 13:14:06 -0600
commitf2eb740f3f0340ad941e563484d5ba45a5ec6af0 (patch)
tree4e0a9949a1488b84dab86e64ea8aafd462a962dd
parentab1ea9059d75b42a5717c7ab55713bdf194ccf21 (diff)
downloadVulkan-Headers-f2eb740f3f0340ad941e563484d5ba45a5ec6af0.tar.gz
Vulkan-Headers-f2eb740f3f0340ad941e563484d5ba45a5ec6af0.zip
build: Disable Vulkan-Module by default
After numerous reports of builds being broken due to the addition of the Vulkan-Module support code in CMake, the option is being set to OFF by default. This prevents projects which do not use the module from not being able to build due to compiler, build system, and platform issues. Projects wishing to enable modules can set the cmake option VULKAN_HEADERS_ENABLE_MODULE=ON to re-enable the module support. Add a warning in case a user decides to enable the module but the platform doesn't support modules.
-rw-r--r--CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1d49c4..af6cbaf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,9 +52,13 @@ if ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND (MSVC_VERSION GREATER_EQUAL "1941
set(COMPILER_SUPPORTS_CXX_MODULES TRUE)
endif()
-option(VULKAN_HEADERS_ENABLE_MODULE "Enables building of the Vulkan C++ module. Default is true if supported by the CMake version and compilers" ${COMPILER_SUPPORTS_CXX_MODULES})
+option(VULKAN_HEADERS_ENABLE_MODULE "Enables building of the Vulkan C++ module" OFF)
-if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.28" AND VULKAN_HEADERS_ENABLE_MODULE)
+if (VULKAN_HEADERS_ENABLE_MODULE AND (NOT COMPILER_SUPPORTS_CXX_MODULES OR CMAKE_VERSION VERSION_LESS "3.28"))
+ message(WARNING "Vulkan C++ module support is requested but was disabled due to lacking support on this platform")
+endif()
+
+if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.28" AND VULKAN_HEADERS_ENABLE_MODULE AND COMPILER_SUPPORTS_CXX_MODULES)
add_library(Vulkan-Module)
add_library(Vulkan::VulkanHppModule ALIAS Vulkan-Module)
target_sources(Vulkan-Module