summaryrefslogtreecommitdiff
path: root/glslang/0002-CMake-Use-VERSION-SOVERSION-for-all-shared-libs.patch
blob: b5e1ef03832ce287c9340177d8d371c808275324 (plain)
    1 From 5868365b3a8636a468c4d12b20a221f5b7602de9 Mon Sep 17 00:00:00 2001
    2 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= <rverschelde@gmail.com>
    3 Date: Mon, 12 Oct 2020 11:21:05 +0200
    4 Subject: [PATCH 2/2] CMake: Use VERSION/SOVERSION for all shared libs
    5 
    6 ---
    7  SPIRV/CMakeLists.txt      | 14 ++++++++++----
    8  StandAlone/CMakeLists.txt |  7 +++++--
    9  hlsl/CMakeLists.txt       |  7 +++++--
   10  3 files changed, 20 insertions(+), 8 deletions(-)
   11 
   12 diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt
   13 index d699dadd..55d77c45 100644
   14 --- a/SPIRV/CMakeLists.txt
   15 +++ b/SPIRV/CMakeLists.txt
   16 @@ -69,8 +69,11 @@ set(SPVREMAP_HEADERS
   17      doc.h)
   18  
   19  add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
   20 -set_property(TARGET SPIRV PROPERTY FOLDER glslang)
   21 -set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON)
   22 +set_target_properties(SPIRV PROPERTIES
   23 +    FOLDER glslang
   24 +    POSITION_INDEPENDENT_CODE ON
   25 +    VERSION   "${GLSLANG_VERSION}"
   26 +    SOVERSION "${GLSLANG_VERSION_MAJOR}")
   27  target_include_directories(SPIRV PUBLIC
   28      $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
   29      $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
   30 @@ -79,8 +82,11 @@ glslang_add_build_info_dependency(SPIRV)
   31  
   32  if (ENABLE_SPVREMAPPER)
   33      add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
   34 -    set_property(TARGET SPVRemapper PROPERTY FOLDER glslang)
   35 -    set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON)
   36 +    set_target_properties(SPVRemapper PROPERTIES
   37 +        FOLDER glslang
   38 +        POSITION_INDEPENDENT_CODE ON
   39 +        VERSION   "${GLSLANG_VERSION}"
   40 +        SOVERSION "${GLSLANG_VERSION_MAJOR}")
   41  endif()
   42  
   43  if(WIN32 AND BUILD_SHARED_LIBS)
   44 diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt
   45 index a2009165..6ff5e65b 100644
   46 --- a/StandAlone/CMakeLists.txt
   47 +++ b/StandAlone/CMakeLists.txt
   48 @@ -34,8 +34,11 @@
   49  add_library(glslang-default-resource-limits STATIC
   50              ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp
   51              ${CMAKE_CURRENT_SOURCE_DIR}/resource_limits_c.cpp)
   52 -set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
   53 -set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON)
   54 +set_target_properties(glslang-default-resource-limits PROPERTIES
   55 +    FOLDER glslang
   56 +    POSITION_INDEPENDENT_CODE ON
   57 +    VERSION   "${GLSLANG_VERSION}"
   58 +    SOVERSION "${GLSLANG_VERSION_MAJOR}")
   59  
   60  target_include_directories(glslang-default-resource-limits
   61                             PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
   62 diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt
   63 index 62faa195..a5472e7e 100644
   64 --- a/hlsl/CMakeLists.txt
   65 +++ b/hlsl/CMakeLists.txt
   66 @@ -38,8 +38,11 @@
   67  # projects that referenced this target.
   68  
   69  add_library(HLSL ${LIB_TYPE} "stub.cpp")
   70 -set_property(TARGET HLSL PROPERTY FOLDER hlsl)
   71 -set_property(TARGET HLSL PROPERTY POSITION_INDEPENDENT_CODE ON)
   72 +set_target_properties(HLSL PROPERTIES
   73 +    FOLDER hlsl
   74 +    POSITION_INDEPENDENT_CODE ON
   75 +    VERSION   "${GLSLANG_VERSION}"
   76 +    SOVERSION "${GLSLANG_VERSION_MAJOR}")
   77  
   78  if(WIN32 AND BUILD_SHARED_LIBS)
   79      set_target_properties(HLSL PROPERTIES PREFIX "")
   80 -- 
   81 2.28.0

Generated by cgit