Merge pull request #3028 from rhabacker/fix-shared-build-mode

cmake: Do not install static libraries in shared build mode
This commit is contained in:
Jeremy Hayes 2022-10-05 22:20:52 -06:00 committed by GitHub
commit 1846ead23b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 20 deletions

View File

@ -41,7 +41,7 @@ if(WIN32)
source_group("Source" FILES ${SOURCES}) source_group("Source" FILES ${SOURCES})
endif(WIN32) endif(WIN32)
if(ENABLE_GLSLANG_INSTALL) if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
install(TARGETS OGLCompiler EXPORT glslang-targets) install(TARGETS OGLCompiler EXPORT glslang-targets)
# Backward compatibility # Backward compatibility
@ -56,4 +56,4 @@ if(ENABLE_GLSLANG_INSTALL)
") ")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/OGLCompilerTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/OGLCompilerTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif(ENABLE_GLSLANG_INSTALL) endif()

View File

@ -201,6 +201,7 @@ endif()
################################################################################ ################################################################################
if(ENABLE_GLSLANG_INSTALL) if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslang EXPORT glslang-targets) install(TARGETS glslang EXPORT glslang-targets)
if(NOT BUILD_SHARED_LIBS)
install(TARGETS MachineIndependent EXPORT glslang-targets) install(TARGETS MachineIndependent EXPORT glslang-targets)
install(TARGETS GenericCodeGen EXPORT glslang-targets) install(TARGETS GenericCodeGen EXPORT glslang-targets)
@ -221,6 +222,7 @@ if(ENABLE_GLSLANG_INSTALL)
endif() endif()
") ")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslangTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslangTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif()
set(ALL_HEADERS set(ALL_HEADERS
${GLSLANG_HEADERS} ${GLSLANG_HEADERS}

View File

@ -52,7 +52,7 @@ else()
target_link_libraries(OSDependent Threads::Threads) target_link_libraries(OSDependent Threads::Threads)
endif() endif()
if(ENABLE_GLSLANG_INSTALL) if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
install(TARGETS OSDependent EXPORT glslang-targets) install(TARGETS OSDependent EXPORT glslang-targets)
# Backward compatibility # Backward compatibility