From 014f793203615cd5c79b769110e922fdd3022395 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Mon, 10 Aug 2026 11:21:45 -0500 Subject: [PATCH] build: Check if Vulkan-Headers is an ALIAS target When projects make Vulkan-headers available using add_subdirectory, the Vulkan::Headers target is an ALIAS, not an IMPORTED target. This breaks the AppleClang workaround as CMake cannot modify the properties of ALIAS targets. Because we don't need the workaround when users add Vulkan-Headers using add_subdirectory, just check that it isn't an ALIAS target before calling set_target_properties. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c56ffbad..a85774072 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,10 @@ endif() # Workaround AppleClang using the wrong headers when there are headers in /usr/local/include if (CMAKE_C_COMPILER_ID STREQUAL AppleClang AND TARGET Vulkan::Headers AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.25) - set_target_properties(Vulkan::Headers PROPERTIES SYSTEM OFF) + get_target_property(vulkan_headers_aliased Vulkan::Headers ALIASED_TARGET) + if (NOT vulkan_headers_aliased) + set_target_properties(Vulkan::Headers PROPERTIES SYSTEM OFF) + endif() endif() include(GNUInstallDirs)