File: 0003-cmake-Add-SOVERSION-to-shared-libraries.patch

package info (click to toggle)
upb 0.0.0~git200730-2
  • links: PTS
  • area: main
  • in suites: sid
  • size: 1,696 kB
  • sloc: ansic: 16,828; cpp: 5,098; python: 360; pascal: 160; ruby: 21; sh: 19; makefile: 6
file content (72 lines) | stat: -rw-r--r-- 2,083 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Description: [PATCH 3/5] cmake: Add SOVERSION to shared libraries
 Linux distributions usually require libraries to have SOVERSION in order
 to have them packaged.
Author: Michal Rostecki <mrostecki@opensuse.org>
Last-Update: 2020-06-29

---

--- upb-0.orig/CMakeLists.txt
+++ upb-0/CMakeLists.txt
@@ -13,6 +13,7 @@ cmake_policy(SET CMP0048 NEW)
 
 project(upb)
 
+set(upb_SOVERSION 0)
 
 # Prevent CMake from setting -rdynamic on Linux (!!).
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
@@ -74,6 +75,8 @@ add_library(upb
   upb/encode.h
   upb/upb.h
   upb/upb.hpp)
+set_target_properties(upb PROPERTIES
+  SOVERSION ${upb_SOVERSION})
 target_link_libraries(upb
   port)
 add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE)
@@ -83,6 +86,8 @@ target_link_libraries(generated_code_sup
 add_library(descriptor_upb_proto
   generated_for_cmake/google/protobuf/descriptor.upb.c
   generated_for_cmake/google/protobuf/descriptor.upb.h)
+set_target_properties(descriptor_upb_proto PROPERTIES
+  SOVERSION ${upb_SOVERSION})
 add_library(upb_reflection
   upb/def.c
   upb/msg.h
@@ -90,6 +95,8 @@ add_library(upb_reflection
   upb/def.h
   upb/def.hpp
   upb/reflection.h)
+set_target_properties(upb_reflection PROPERTIES
+  SOVERSION ${upb_SOVERSION})
 target_link_libraries(upb_reflection
   descriptor_upb_proto
   port
@@ -120,6 +127,8 @@ add_library(upb_handlers
   upb/sink.c
   upb/handlers.h
   upb/sink.h)
+set_target_properties(upb_handlers PROPERTIES
+  SOVERSION ${upb_SOVERSION})
 target_link_libraries(upb_handlers
   port
   upb_reflection
@@ -136,6 +145,8 @@ add_library(upb_pb
   upb/pb/decoder.h
   upb/pb/encoder.h
   upb/pb/textprinter.h)
+set_target_properties(upb_pb PROPERTIES
+  SOVERSION ${upb_SOVERSION})
 target_link_libraries(upb_pb
   descriptor_upb_proto
   upb_handlers
@@ -148,6 +159,8 @@ add_library(upb_json
   upb/json/printer.c
   upb/json/parser.h
   upb/json/printer.h)
+set_target_properties(upb_json PROPERTIES
+  SOVERSION ${upb_SOVERSION})
 target_link_libraries(upb_json
   upb
   upb_pb)