-
Notifications
You must be signed in to change notification settings - Fork 1
/
capnp_src_kjCMakeLists.patch
141 lines (135 loc) · 4.84 KB
/
capnp_src_kjCMakeLists.patch
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
--- capnproto-c++-0.10.4/src/kj/CMakeLists.txt 2023-01-02 22:30:51
+++ capnproto-c++-0.10.4.patch/src/kj/CMakeLists.txt 2023-04-19 09:05:24
@@ -86,7 +86,7 @@
target_compile_definitions(kj PUBLIC ${CAPNP_LITE_FLAG})
#make sure external consumers don't need to manually set the include dirs
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
-target_include_directories(kj INTERFACE
+target_include_directories(kj PUBLIC
$<BUILD_INTERFACE:${PARENT_DIR}>
$<INSTALL_INTERFACE:include>
)
@@ -172,7 +172,12 @@
if(NOT CAPNP_LITE)
add_library(kj-http ${kj-http_sources})
add_library(CapnProto::kj-http ALIAS kj-http)
- target_link_libraries(kj-http PUBLIC kj-async kj)
+ if(WITH_ZLIB)
+ target_compile_definitions(kj-http PRIVATE KJ_HAS_ZLIB)
+ target_link_libraries(kj-http PUBLIC kj-async kj ZLIB::ZLIB)
+ else()
+ target_link_libraries(kj-http PUBLIC kj-async kj)
+ endif()
# Ensure the library has a version set to match autotools build
set_target_properties(kj-http PROPERTIES VERSION ${VERSION})
install(TARGETS kj-http ${INSTALL_TARGETS_DEFAULT_ARGS})
@@ -180,50 +185,51 @@
endif()
# kj-tls ======================================================================
-set(kj-tls_sources
- compat/readiness-io.c++
- compat/tls.c++
-)
-set(kj-tls_headers
- compat/readiness-io.h
- compat/tls.h
-)
-if(NOT CAPNP_LITE)
- add_library(kj-tls ${kj-tls_sources})
- add_library(CapnProto::kj-tls ALIAS kj-tls)
- target_link_libraries(kj-tls PUBLIC kj-async)
- if(WITH_OPENSSL)
+if(WITH_OPENSSL)
+ set(kj-tls_sources
+ compat/readiness-io.c++
+ compat/tls.c++
+ )
+ set(kj-tls_headers
+ compat/readiness-io.h
+ compat/tls.h
+ )
+ if(NOT CAPNP_LITE)
+ add_library(kj-tls ${kj-tls_sources})
+ add_library(CapnProto::kj-tls ALIAS kj-tls)
+ target_link_libraries(kj-tls PUBLIC kj-async)
+
target_compile_definitions(kj-tls PRIVATE KJ_HAS_OPENSSL)
target_link_libraries(kj-tls PRIVATE OpenSSL::SSL OpenSSL::Crypto)
+
+ # Ensure the library has a version set to match autotools build
+ set_target_properties(kj-tls PROPERTIES VERSION ${VERSION})
+ install(TARGETS kj-tls ${INSTALL_TARGETS_DEFAULT_ARGS})
+ install(FILES ${kj-tls_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kj/compat")
endif()
- # Ensure the library has a version set to match autotools build
- set_target_properties(kj-tls PROPERTIES VERSION ${VERSION})
- install(TARGETS kj-tls ${INSTALL_TARGETS_DEFAULT_ARGS})
- install(FILES ${kj-tls_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kj/compat")
endif()
# kj-gzip ======================================================================
-set(kj-gzip_sources
- compat/gzip.c++
-)
-set(kj-gzip_headers
- compat/gzip.h
-)
-if(NOT CAPNP_LITE)
- add_library(kj-gzip ${kj-gzip_sources})
- add_library(CapnProto::kj-gzip ALIAS kj-gzip)
+if(WITH_ZLIB)
+ set(kj-gzip_sources
+ compat/gzip.c++
+ )
+ set(kj-gzip_headers
+ compat/gzip.h
+ )
+ if(NOT CAPNP_LITE)
+ add_library(kj-gzip ${kj-gzip_sources})
+ add_library(CapnProto::kj-gzip ALIAS kj-gzip)
- find_package(ZLIB)
- if(ZLIB_FOUND)
- add_definitions(-D KJ_HAS_ZLIB=1)
+ target_compile_definitions(kj-gzip PRIVATE KJ_HAS_ZLIB)
target_link_libraries(kj-gzip PUBLIC kj-async kj ZLIB::ZLIB)
- endif()
- # Ensure the library has a version set to match autotools build
- set_target_properties(kj-gzip PROPERTIES VERSION ${VERSION})
- install(TARGETS kj-gzip ${INSTALL_TARGETS_DEFAULT_ARGS})
- install(FILES ${kj-gzip_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kj/compat")
+ # Ensure the library has a version set to match autotools build
+ set_target_properties(kj-gzip PROPERTIES VERSION ${VERSION})
+ install(TARGETS kj-gzip ${INSTALL_TARGETS_DEFAULT_ARGS})
+ install(FILES ${kj-gzip_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kj/compat")
+ endif()
endif()
# Tests ========================================================================
@@ -238,6 +244,8 @@
table-test.c++
map-test.c++
exception-test.c++
+ # this test overrides symbolizer and has to be linked separately
+ # exception-override-symbolizer-test.c++
debug-test.c++
io-test.c++
mutex-test.c++
@@ -279,11 +287,19 @@
compat/gzip-test.c++
compat/tls-test.c++
)
- target_link_libraries(kj-heavy-tests kj-http kj-gzip kj-tls kj-async kj-test kj)
+ target_link_libraries(kj-heavy-tests kj-http kj-async kj-test kj)
if(WITH_OPENSSL)
+ target_link_libraries(kj-heavy-tests kj-tls)
set_property(
SOURCE compat/tls-test.c++
APPEND PROPERTY COMPILE_DEFINITIONS KJ_HAS_OPENSSL
+ )
+ endif()
+ if(WITH_ZLIB)
+ target_link_libraries(kj-heavy-tests kj-gzip)
+ set_property(
+ SOURCE compat/gzip-test.c++
+ APPEND PROPERTY COMPILE_DEFINITIONS KJ_HAS_ZLIB
)
endif()
add_dependencies(check kj-heavy-tests)