diff options
| author | Viktor Szakats <commit@vsz.me> | 2023-12-14 03:36:09 +0000 |
|---|---|---|
| committer | Viktor Szakats <commit@vsz.me> | 2023-12-14 03:36:09 +0000 |
| commit | 848950877fb2d66d76cb1258fc28a2b1b453a42d (patch) | |
| tree | 3008889d0dbb1ce97d753a1c0929a2e4cd0ceccc /tls | |
| parent | 05902e63c9b80d25f4367fb0f8f441669510eb2e (diff) | |
| download | portable-848950877fb2d66d76cb1258fc28a2b1b453a42d.tar.gz portable-848950877fb2d66d76cb1258fc28a2b1b453a42d.tar.bz2 portable-848950877fb2d66d76cb1258fc28a2b1b453a42d.zip | |
cmake: stop exporting compat functions
Diffstat (limited to 'tls')
| -rw-r--r-- | tls/CMakeLists.txt | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt index c3c9424..33ae184 100644 --- a/tls/CMakeLists.txt +++ b/tls/CMakeLists.txt | |||
| @@ -14,28 +14,32 @@ set( | |||
| 14 | tls_verify.c | 14 | tls_verify.c |
| 15 | ) | 15 | ) |
| 16 | 16 | ||
| 17 | set(TLS_COMPAT_SRC "") | ||
| 18 | |||
| 17 | if(WIN32) | 19 | if(WIN32) |
| 18 | set( | 20 | set( |
| 19 | TLS_SRC | 21 | TLS_SRC |
| 20 | ${TLS_SRC} | 22 | ${TLS_SRC} |
| 21 | compat/ftruncate.c | ||
| 22 | compat/pread.c | ||
| 23 | compat/pwrite.c | ||
| 24 | ) | 23 | ) |
| 25 | 24 | ||
| 26 | set(LIBTLS_EXTRA_EXPORT ${LIBTLS_EXTRA_EXPORT} ftruncate) | 25 | set(TLS_COMPAT_SRC ${TLS_COMPAT_SRC} compat/ftruncate.c) |
| 26 | set(TLS_COMPAT_SRC ${TLS_COMPAT_SRC} compat/pread.c) | ||
| 27 | set(TLS_COMPAT_SRC ${TLS_COMPAT_SRC} compat/pwrite.c) | ||
| 27 | endif() | 28 | endif() |
| 28 | 29 | ||
| 29 | add_definitions(-DTLS_DEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") | 30 | add_definitions(-DTLS_DEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") |
| 30 | 31 | ||
| 31 | file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym DESTINATION | 32 | file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym DESTINATION |
| 32 | ${CMAKE_CURRENT_BINARY_DIR}) | 33 | ${CMAKE_CURRENT_BINARY_DIR}) |
| 33 | if(LIBTLS_EXTRA_EXPORT) | 34 | |
| 34 | list(SORT LIBTLS_EXTRA_EXPORT) | 35 | add_library(tls_compat_obj OBJECT ${TLS_COMPAT_SRC}) |
| 35 | foreach(SYM IN LISTS LIBTLS_EXTRA_EXPORT) | 36 | target_include_directories(tls_compat_obj |
| 36 | file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/tls.sym "${SYM}\n") | 37 | PRIVATE |
| 37 | endforeach() | 38 | . |
| 38 | endif() | 39 | ../include/compat |
| 40 | PUBLIC | ||
| 41 | ../include | ||
| 42 | ${CMAKE_BINARY_DIR}/include) | ||
| 39 | 43 | ||
| 40 | add_library(tls_obj OBJECT ${TLS_SRC}) | 44 | add_library(tls_obj OBJECT ${TLS_SRC}) |
| 41 | target_include_directories(tls_obj | 45 | target_include_directories(tls_obj |
| @@ -46,7 +50,11 @@ target_include_directories(tls_obj | |||
| 46 | ../include | 50 | ../include |
| 47 | ${CMAKE_BINARY_DIR}/include) | 51 | ${CMAKE_BINARY_DIR}/include) |
| 48 | 52 | ||
| 49 | add_library(tls $<TARGET_OBJECTS:tls_obj> empty.c) | 53 | if(BUILD_SHARED_LIBS) |
| 54 | add_library(tls $<TARGET_OBJECTS:tls_obj> $<TARGET_OBJECTS:tls_compat_obj> $<TARGET_OBJECTS:compat_obj> empty.c) | ||
| 55 | else() | ||
| 56 | add_library(tls $<TARGET_OBJECTS:tls_obj> $<TARGET_OBJECTS:tls_compat_obj> empty.c) | ||
| 57 | endif() | ||
| 50 | 58 | ||
| 51 | export_symbol(tls ${CMAKE_CURRENT_BINARY_DIR}/tls.sym) | 59 | export_symbol(tls ${CMAKE_CURRENT_BINARY_DIR}/tls.sym) |
| 52 | target_link_libraries(tls ${OPENSSL_LIBS}) | 60 | target_link_libraries(tls ${OPENSSL_LIBS}) |
