vcpkg/ports/glslang/0001-Fix-glslangValidator-installation.patch
friendlyanon efd5cdaf1e
[glslang] Fix tools feature installation (#39677)
Co-authored-by: friendlyanon <friendlyanon@users.noreply.github.com>
2024-07-05 13:45:48 -04:00

58 lines
2.4 KiB
Diff

From 3992259996aee72a65b99a0731584b2d69fcf32e Mon Sep 17 00:00:00 2001
From: friendlyanon <friendlyanon@users.noreply.github.com>
Date: Tue, 2 Jul 2024 19:55:24 +0200
Subject: [PATCH] Fix `glslangValidator` installation
This caused the glslang[tools] vcpkg feature to not install properly,
because the glslangValidator executable didn't exist for tool
installation.
---
StandAlone/CMakeLists.txt | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt
index e0fdb487..9ecdcd23 100644
--- a/StandAlone/CMakeLists.txt
+++ b/StandAlone/CMakeLists.txt
@@ -90,21 +90,28 @@ endif()
# Create a symbolic link to glslang named glslangValidator for backwards compatibility
set(legacy_glslang_name "glslangValidator${CMAKE_EXECUTABLE_SUFFIX}")
set(link_method create_symlink)
-if (WIN32 OR MINGW)
-set(link_method copy_if_different)
+if(WIN32 OR MINGW)
+ set(link_method copy_if_different)
endif()
-add_custom_command(TARGET glslang-standalone
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E ${link_method} $<TARGET_FILE_NAME:glslang-standalone> ${legacy_glslang_name}
- WORKING_DIRECTORY $<TARGET_FILE_DIR:glslang-standalone>)
+
+add_custom_command(
+ TARGET glslang-standalone POST_BUILD
+ COMMAND "${CMAKE_COMMAND}" -E "${link_method}" "\$<TARGET_FILE_NAME:glslang-standalone>" "${legacy_glslang_name}"
+ WORKING_DIRECTORY "\$<TARGET_FILE_DIR:glslang-standalone>"
+ VERBATIM
+)
if(GLSLANG_ENABLE_INSTALL)
install(TARGETS glslang-standalone EXPORT glslang-targets)
# Create the same symlink at install time
- install(CODE "execute_process( \
- COMMAND ${CMAKE_COMMAND} -E ${link_method} $<TARGET_FILE_NAME:glslang-standalone> ${legacy_glslang_name} \
- WORKING_DIRECTORY \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})")
+ install(CODE "\
+ message(STATUS \"Installing (${link_method}): \$<TARGET_FILE_NAME:glslang-standalone> -> \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}\")
+ execute_process(
+ COMMAND \"\${CMAKE_COMMAND}\" -E ${link_method} [=[\$<TARGET_FILE_NAME:glslang-standalone>]=] [=[${legacy_glslang_name}]=]
+ WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}\"
+ )
+ ")
if(ENABLE_SPVREMAPPER)
install(TARGETS spirv-remap EXPORT glslang-targets)
--
2.29.1.windows.1