summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorokhowang(王沛文) <okhowang@tencent.com>2020-05-28 17:14:46 +0800
committerAzat Khuzhin <azat@libevent.org>2020-07-22 22:53:23 +0300
commit028385f685585b4b247bdd4acae3cd12de2b4da4 (patch)
tree602344160aa7442e674e26f54838a7d50d8f35f8 /CMakeLists.txt
parent8218777d44ab30c8a5e2d5d637a62f924c83b65c (diff)
downloadlibevent-028385f685585b4b247bdd4acae3cd12de2b4da4.tar.gz
fix build system and add test and cleanup code
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
1 files changed, 21 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3072aa4..90052916 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -991,7 +991,9 @@ endif()
if (NOT EVENT__DISABLE_MBEDTLS)
add_event_library(event_mbedtls
- LIBRARIES event_core_shared ${MBEDTLS_LIBRARIES}
+ INNER_LIBRARIES event_core
+ OUTER_INCLUDES ${MBEDTLS_INCLUDE_DIR}
+ LIBRARIES ${MBEDTLS_LIBRARIES}
SOURCES ${SRC_MBEDTLS})
endif()
@@ -1038,8 +1040,8 @@ macro(add_sample_prog ssl name)
${LIB_APPS}
${LIB_PLATFORM})
- if (${ssl})
- target_link_libraries(${name} event_openssl)
+ if (TARGET ${ssl})
+ target_link_libraries(${name} ${ssl})
if(WIN32)
target_link_libraries(${name} crypt32)
endif()
@@ -1062,13 +1064,18 @@ if (NOT EVENT__DISABLE_SAMPLES)
endif()
if (NOT EVENT__DISABLE_OPENSSL)
- add_sample_prog(ON https-client
+ add_sample_prog(event_openssl https-client
sample/https-client.c
sample/openssl_hostname_validation.c
sample/hostcheck.c)
- add_sample_prog(ON le-proxy
+ add_sample_prog(event_openssl le-proxy
sample/le-proxy.c)
- add_sample_prog(ON becat sample/becat.c ${WIN32_GETOPT})
+ add_sample_prog(event_openssl becat sample/becat.c ${WIN32_GETOPT})
+ endif()
+
+ if (NOT EVENT__DISABLE_MBEDTLS)
+ add_sample_prog(event_mbedtls ssl-client-mbedtls
+ sample/ssl-client-mbedtls.c)
endif()
set(SAMPLES_WOPT
@@ -1180,7 +1187,11 @@ if (NOT EVENT__DISABLE_TESTS)
endif()
if (NOT EVENT__DISABLE_OPENSSL)
- list(APPEND SRC_REGRESS test/regress_ssl.c)
+ list(APPEND SRC_REGRESS test/regress_openssl.c)
+ endif()
+
+ if (NOT EVENT__DISABLE_MBEDTLS)
+ list(APPEND SRC_REGRESS test/regress_mbedtls.c)
endif()
add_executable(regress ${SRC_REGRESS})
@@ -1193,6 +1204,9 @@ if (NOT EVENT__DISABLE_TESTS)
if (NOT EVENT__DISABLE_OPENSSL)
target_link_libraries(regress event_openssl)
endif()
+ if (NOT EVENT__DISABLE_MBEDTLS)
+ target_link_libraries(regress event_mbedtls)
+ endif()
if (CMAKE_USE_PTHREADS_INIT)
target_link_libraries(regress event_pthreads)
endif()