@@ -84,7 +84,7 @@ endif()
84
84
#=======================================================================
85
85
86
86
add_executable (cpp20_intro examples/cpp20_intro.cpp )
87
- target_link_libraries (cpp20_intro common )
87
+ target_link_libraries (cpp20_intro PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
88
88
target_compile_features (cpp20_intro PUBLIC cxx_std_20 )
89
89
add_test (cpp20_intro cpp20_intro )
90
90
if (MSVC )
@@ -93,14 +93,15 @@ if (MSVC)
93
93
endif ()
94
94
95
95
add_executable (cpp20_streams examples/cpp20_streams.cpp )
96
- target_link_libraries (cpp20_streams common )
96
+ target_link_libraries (cpp20_streams PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
97
97
target_compile_features (cpp20_streams PUBLIC cxx_std_20 )
98
98
if (MSVC )
99
99
target_compile_options (cpp20_streams PRIVATE /bigobj )
100
100
target_compile_definitions (cpp20_streams PRIVATE _WIN32_WINNT=0x0601 )
101
101
endif ()
102
102
103
103
add_executable (cpp17_intro examples/cpp17_intro.cpp )
104
+ target_link_libraries (cpp17_intro PRIVATE OpenSSL::Crypto OpenSSL::SSL )
104
105
target_compile_features (cpp17_intro PUBLIC cxx_std_17 )
105
106
add_test (cpp17_intro cpp17_intro )
106
107
if (MSVC )
@@ -111,18 +112,19 @@ endif()
111
112
if (NOT MSVC )
112
113
add_executable (cpp17_intro_sync examples/cpp17_intro_sync.cpp )
113
114
target_compile_features (cpp17_intro_sync PUBLIC cxx_std_17 )
115
+ target_link_libraries (cpp17_intro_sync PRIVATE OpenSSL::Crypto OpenSSL::SSL )
114
116
add_test (cpp17_intro_sync cpp17_intro_sync )
115
117
endif ()
116
118
117
119
if (NOT MSVC )
118
120
add_executable (cpp20_chat_room examples/cpp20_chat_room.cpp )
119
121
target_compile_features (cpp20_chat_room PUBLIC cxx_std_20 )
120
- target_link_libraries (cpp20_chat_room common )
122
+ target_link_libraries (cpp20_chat_room PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
121
123
endif ()
122
124
123
125
add_executable (cpp20_containers examples/cpp20_containers.cpp )
124
126
target_compile_features (cpp20_containers PUBLIC cxx_std_20 )
125
- target_link_libraries (cpp20_containers common )
127
+ target_link_libraries (cpp20_containers PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
126
128
add_test (cpp20_containers cpp20_containers )
127
129
if (MSVC )
128
130
target_compile_options (cpp20_containers PRIVATE /bigobj )
@@ -132,12 +134,12 @@ endif()
132
134
if (NOT MSVC )
133
135
add_executable (cpp20_echo_server examples/cpp20_echo_server.cpp )
134
136
target_compile_features (cpp20_echo_server PUBLIC cxx_std_20 )
135
- target_link_libraries (cpp20_echo_server common )
137
+ target_link_libraries (cpp20_echo_server PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
136
138
endif ()
137
139
138
140
add_executable (cpp20_resolve_with_sentinel examples/cpp20_resolve_with_sentinel.cpp )
139
141
target_compile_features (cpp20_resolve_with_sentinel PUBLIC cxx_std_20 )
140
- target_link_libraries (cpp20_resolve_with_sentinel common )
142
+ target_link_libraries (cpp20_resolve_with_sentinel PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
141
143
#add_test(cpp20_resolve_with_sentinel cpp20_resolve_with_sentinel)
142
144
if (MSVC )
143
145
target_compile_options (cpp20_resolve_with_sentinel PRIVATE /bigobj )
@@ -146,7 +148,7 @@ endif()
146
148
147
149
add_executable (cpp20_json examples/cpp20_json.cpp )
148
150
target_compile_features (cpp20_json PUBLIC cxx_std_20 )
149
- target_link_libraries (cpp20_json common )
151
+ target_link_libraries (cpp20_json PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
150
152
add_test (cpp20_json cpp20_json )
151
153
if (MSVC )
152
154
target_compile_options (cpp20_json PRIVATE /bigobj )
@@ -157,7 +159,7 @@ if (Protobuf_FOUND)
157
159
protobuf_generate_cpp (PROTO_SRCS PROTO_HDRS examples/person.proto )
158
160
add_executable (cpp20_protobuf examples/cpp20_protobuf.cpp ${PROTO_SRCS} ${PROTO_HDRS} )
159
161
target_compile_features (cpp20_protobuf PUBLIC cxx_std_20 )
160
- target_link_libraries (cpp20_protobuf common ${Protobuf_LIBRARIES} )
162
+ target_link_libraries (cpp20_protobuf PRIVATE OpenSSL::Crypto OpenSSL::SSL common ${Protobuf_LIBRARIES} )
161
163
target_include_directories (cpp20_protobuf PUBLIC ${Protobuf_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} )
162
164
add_test (cpp20_protobuf cpp20_protobuf )
163
165
if (MSVC )
@@ -168,7 +170,7 @@ endif()
168
170
169
171
add_executable (cpp20_subscriber examples/cpp20_subscriber.cpp )
170
172
target_compile_features (cpp20_subscriber PUBLIC cxx_std_20 )
171
- target_link_libraries (cpp20_subscriber common )
173
+ target_link_libraries (cpp20_subscriber PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
172
174
if (MSVC )
173
175
target_compile_options (cpp20_subscriber PRIVATE /bigobj )
174
176
target_compile_definitions (cpp20_subscriber PRIVATE _WIN32_WINNT=0x0601 )
@@ -177,8 +179,7 @@ endif()
177
179
add_executable (cpp20_intro_tls examples/cpp20_intro_tls.cpp )
178
180
target_compile_features (cpp20_intro_tls PUBLIC cxx_std_20 )
179
181
add_test (cpp20_intro_tls cpp20_intro_tls )
180
- target_link_libraries (cpp20_intro_tls OpenSSL::Crypto OpenSSL::SSL )
181
- target_link_libraries (cpp20_intro_tls common )
182
+ target_link_libraries (cpp20_intro_tls PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
182
183
if (MSVC )
183
184
target_compile_options (cpp20_intro_tls PRIVATE /bigobj )
184
185
target_compile_definitions (cpp20_intro_tls PRIVATE _WIN32_WINNT=0x0601 )
@@ -187,7 +188,7 @@ endif()
187
188
add_executable (cpp20_low_level_async tests/cpp20_low_level_async.cpp )
188
189
target_compile_features (cpp20_low_level_async PUBLIC cxx_std_20 )
189
190
add_test (cpp20_low_level_async cpp20_low_level_async )
190
- target_link_libraries (cpp20_low_level_async common )
191
+ target_link_libraries (cpp20_low_level_async PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
191
192
if (MSVC )
192
193
target_compile_options (cpp20_low_level_async PRIVATE /bigobj )
193
194
target_compile_definitions (cpp20_low_level_async PRIVATE _WIN32_WINNT=0x0601 )
@@ -217,7 +218,7 @@ endif()
217
218
218
219
add_executable (test_conn_exec tests/conn_exec.cpp )
219
220
target_compile_features (test_conn_exec PUBLIC cxx_std_20 )
220
- target_link_libraries (test_conn_exec test_common )
221
+ target_link_libraries (test_conn_exec PRIVATE OpenSSL::Crypto OpenSSL::SSL test_common )
221
222
add_test (test_conn_exec test_conn_exec )
222
223
if (MSVC )
223
224
target_compile_options (test_conn_exec PRIVATE /bigobj )
@@ -226,7 +227,7 @@ endif()
226
227
227
228
add_executable (test_conn_exec_retry tests/conn_exec_retry.cpp )
228
229
target_compile_features (test_conn_exec_retry PUBLIC cxx_std_20 )
229
- target_link_libraries (test_conn_exec_retry test_common )
230
+ target_link_libraries (test_conn_exec_retry PRIVATE OpenSSL::Crypto OpenSSL::SSL test_common )
230
231
add_test (test_conn_exec_retry test_conn_exec_retry )
231
232
if (MSVC )
232
233
target_compile_options (test_conn_exec_retry PRIVATE /bigobj )
@@ -235,7 +236,7 @@ endif()
235
236
236
237
add_executable (test_conn_push tests/conn_push.cpp )
237
238
target_compile_features (test_conn_push PUBLIC cxx_std_20 )
238
- target_link_libraries (test_conn_push test_common )
239
+ target_link_libraries (test_conn_push PRIVATE OpenSSL::Crypto OpenSSL::SSL test_common )
239
240
add_test (test_conn_push test_conn_push )
240
241
if (MSVC )
241
242
target_compile_options (test_conn_push PRIVATE /bigobj )
@@ -244,6 +245,7 @@ endif()
244
245
245
246
add_executable (test_conn_quit tests/conn_quit.cpp )
246
247
target_compile_features (test_conn_quit PUBLIC cxx_std_17 )
248
+ target_link_libraries (test_conn_quit PRIVATE OpenSSL::Crypto OpenSSL::SSL test_common )
247
249
add_test (test_conn_quit test_conn_quit )
248
250
if (MSVC )
249
251
target_compile_options (test_conn_quit PRIVATE /bigobj )
@@ -252,7 +254,7 @@ endif()
252
254
253
255
add_executable (test_conn_reconnect tests/conn_reconnect.cpp )
254
256
target_compile_features (test_conn_reconnect PUBLIC cxx_std_20 )
255
- target_link_libraries (test_conn_reconnect common test_common )
257
+ target_link_libraries (test_conn_reconnect PRIVATE OpenSSL::Crypto OpenSSL::SSL common test_common )
256
258
add_test (test_conn_reconnect test_conn_reconnect )
257
259
if (MSVC )
258
260
target_compile_options (test_conn_reconnect PRIVATE /bigobj )
@@ -262,7 +264,7 @@ endif()
262
264
add_executable (test_conn_tls tests/conn_tls.cpp )
263
265
add_test (test_conn_tls test_conn_tls )
264
266
target_compile_features (test_conn_tls PUBLIC cxx_std_17 )
265
- target_link_libraries (test_conn_tls OpenSSL::Crypto OpenSSL::SSL )
267
+ target_link_libraries (test_conn_tls PRIVATE OpenSSL::Crypto OpenSSL::SSL )
266
268
if (MSVC )
267
269
target_compile_options (test_conn_tls PRIVATE /bigobj )
268
270
target_compile_definitions (test_conn_tls PRIVATE _WIN32_WINNT=0x0601 )
@@ -279,14 +281,15 @@ endif()
279
281
add_executable (test_conn_run_cancel tests/conn_run_cancel.cpp )
280
282
target_compile_features (test_conn_run_cancel PUBLIC cxx_std_20 )
281
283
add_test (test_conn_run_cancel test_conn_run_cancel )
284
+ target_link_libraries (test_conn_run_cancel PRIVATE OpenSSL::Crypto OpenSSL::SSL )
282
285
if (MSVC )
283
286
target_compile_options (test_conn_run_cancel PRIVATE /bigobj )
284
287
target_compile_definitions (test_conn_run_cancel PRIVATE _WIN32_WINNT=0x0601 )
285
288
endif ()
286
289
287
290
add_executable (test_conn_exec_cancel tests/conn_exec_cancel.cpp )
288
291
target_compile_features (test_conn_exec_cancel PUBLIC cxx_std_20 )
289
- target_link_libraries (test_conn_exec_cancel common test_common )
292
+ target_link_libraries (test_conn_exec_cancel PRIVATE OpenSSL::Crypto OpenSSL::SSL common test_common )
290
293
add_test (test_conn_exec_cancel test_conn_exec_cancel )
291
294
if (MSVC )
292
295
target_compile_options (test_conn_exec_cancel PRIVATE /bigobj )
@@ -295,7 +298,7 @@ endif()
295
298
296
299
add_executable (test_conn_exec_cancel2 tests/conn_exec_cancel2.cpp )
297
300
target_compile_features (test_conn_exec_cancel2 PUBLIC cxx_std_20 )
298
- target_link_libraries (test_conn_exec_cancel2 common test_common )
301
+ target_link_libraries (test_conn_exec_cancel2 PRIVATE OpenSSL::Crypto OpenSSL::SSL common test_common )
299
302
add_test (test_conn_exec_cancel2 test_conn_exec_cancel2 )
300
303
if (MSVC )
301
304
target_compile_options (test_conn_exec_cancel2 PRIVATE /bigobj )
@@ -304,7 +307,7 @@ endif()
304
307
305
308
add_executable (test_conn_exec_error tests/conn_exec_error.cpp )
306
309
target_compile_features (test_conn_exec_error PUBLIC cxx_std_17 )
307
- target_link_libraries (test_conn_exec_error common test_common )
310
+ target_link_libraries (test_conn_exec_error PRIVATE OpenSSL::Crypto OpenSSL::SSL common test_common )
308
311
add_test (test_conn_exec_error test_conn_exec_error )
309
312
if (MSVC )
310
313
target_compile_options (test_conn_exec_error PRIVATE /bigobj )
@@ -313,7 +316,7 @@ endif()
313
316
314
317
add_executable (test_conn_echo_stress tests/conn_echo_stress.cpp )
315
318
target_compile_features (test_conn_echo_stress PUBLIC cxx_std_20 )
316
- target_link_libraries (test_conn_echo_stress common test_common )
319
+ target_link_libraries (test_conn_echo_stress PRIVATE OpenSSL::Crypto OpenSSL::SSL common test_common )
317
320
add_test (test_conn_echo_stress test_conn_echo_stress )
318
321
if (MSVC )
319
322
target_compile_options (test_conn_echo_stress PRIVATE /bigobj )
@@ -330,7 +333,7 @@ endif()
330
333
331
334
add_executable (test_issue_50 tests/issue_50.cpp )
332
335
target_compile_features (test_issue_50 PUBLIC cxx_std_20 )
333
- target_link_libraries (test_issue_50 common )
336
+ target_link_libraries (test_issue_50 PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
334
337
add_test (test_issue_50 test_issue_50 )
335
338
if (MSVC )
336
339
target_compile_options (test_issue_50 PRIVATE /bigobj )
@@ -339,7 +342,7 @@ endif()
339
342
340
343
add_executable (test_conn_check_health tests/conn_check_health.cpp )
341
344
target_compile_features (test_conn_check_health PUBLIC cxx_std_17 )
342
- target_link_libraries (test_conn_check_health common )
345
+ target_link_libraries (test_conn_check_health PRIVATE OpenSSL::Crypto OpenSSL::SSL common )
343
346
add_test (test_conn_check_health test_conn_check_health )
344
347
if (MSVC )
345
348
target_compile_options (test_conn_check_health PRIVATE /bigobj )
@@ -348,7 +351,7 @@ endif()
348
351
349
352
add_executable (test_run tests/run.cpp )
350
353
target_compile_features (test_run PUBLIC cxx_std_17 )
351
- target_link_libraries (test_run test_common )
354
+ target_link_libraries (test_run PRIVATE OpenSSL::Crypto OpenSSL::SSL test_common )
352
355
add_test (test_run test_run )
353
356
if (MSVC )
354
357
target_compile_options (test_run PRIVATE /bigobj )
0 commit comments