guix/gnu/packages/patches/glslang-install-static-libs.patch
Marius Bakke 403d06e7e7
gnu: glslang: Install all libraries.
* gnu/packages/patches/glslang-install-static-libs.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/vulkan.scm (glslang)[source](patches): New field.
2022-12-12 10:58:49 +01:00

61 lines
2.7 KiB
Diff

Install OGLCompiler et.al. even when building shared libraries. Also fix
CMake file locations.
Patch taken from Gentoo:
https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-util/glslang/files/glslang-1.3.231-Install-static-libs.patch
diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt
--- a/OGLCompilersDLL/CMakeLists.txt
+++ b/OGLCompilersDLL/CMakeLists.txt
@@ -41,7 +41,7 @@ if(WIN32)
source_group("Source" FILES ${SOURCES})
endif(WIN32)
-if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
+if(ENABLE_GLSLANG_INSTALL)
install(TARGETS OGLCompiler EXPORT glslang-targets)
# Backward compatibility
@@ -49,7 +49,7 @@ if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
message(WARNING \"Using `OGLCompilerTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::OGLCompiler)
- include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/glslang-targets.cmake\")
+ include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(OGLCompiler ALIAS glslang::OGLCompiler)
diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt
--- a/glslang/CMakeLists.txt
+++ b/glslang/CMakeLists.txt
@@ -203,7 +203,7 @@ endif()
################################################################################
if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslang EXPORT glslang-targets)
- if(NOT BUILD_SHARED_LIBS)
+ if(BUILD_SHARED_LIBS)
install(TARGETS MachineIndependent EXPORT glslang-targets)
install(TARGETS GenericCodeGen EXPORT glslang-targets)
diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt
--- a/glslang/OSDependent/Unix/CMakeLists.txt
+++ b/glslang/OSDependent/Unix/CMakeLists.txt
@@ -52,7 +52,7 @@ else()
target_link_libraries(OSDependent Threads::Threads)
endif()
-if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
+if(ENABLE_GLSLANG_INSTALL)
install(TARGETS OSDependent EXPORT glslang-targets)
# Backward compatibility
@@ -60,7 +60,7 @@ if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
message(WARNING \"Using `OSDependentTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::OSDependent)
- include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/glslang-targets.cmake\")
+ include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(OSDependent ALIAS glslang::OSDependent)