1
1
cmake_minimum_required (VERSION 3.5 )
2
2
3
- # Set extension name here
3
+ # Set extension details
4
4
set (TARGET_NAME httpserver )
5
-
6
- # DuckDB's extension distribution supports vcpkg. As such, dependencies can be added in ./vcpkg.json and then
7
- # used in cmake with find_package. Feel free to remove or replace with other dependencies.
8
- # Note that it should also be removed from vcpkg.json to prevent needlessly installing it..
9
- find_package (OpenSSL REQUIRED )
10
-
11
5
set (EXTENSION_NAME ${TARGET_NAME} _extension )
12
6
set (LOADABLE_EXTENSION_NAME ${TARGET_NAME} _loadable_extension )
13
7
@@ -20,21 +14,21 @@ if(MINGW)
20
14
set (OPENSSL_USE_STATIC_LIBS TRUE )
21
15
endif ()
22
16
17
+ # Find OpenSSL before building extensions
18
+ find_package (OpenSSL REQUIRED )
19
+
23
20
build_static_extension (${TARGET_NAME} ${EXTENSION_SOURCES} )
24
21
build_loadable_extension (${TARGET_NAME} " " ${EXTENSION_SOURCES} )
25
22
26
- # Link OpenSSL in both the static library as the loadable extension
27
23
include_directories (${OPENSSL_INCLUDE_DIR} )
28
- target_link_libraries (${EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto )
29
- target_link_libraries (${LOADABLE_EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto )
30
- target_link_libraries (${LOADABLE_EXTENSION_NAME} duckdb_mbedtls
31
- ${OPENSSL_LIBRARIES} )
24
+ target_link_libraries (${LOADABLE_EXTENSION_NAME} duckdb_mbedtls ${OPENSSL_LIBRARIES} )
32
25
target_link_libraries (${EXTENSION_NAME} duckdb_mbedtls ${OPENSSL_LIBRARIES} )
33
26
34
27
if (MINGW )
28
+ set (WIN_LIBS crypt32 ws2_32 wsock32 )
35
29
find_package (ZLIB )
36
- target_link_libraries (${LOADABLE_EXTENSION_NAME} ZLIB::ZLIB -lcrypt32 )
37
- target_link_libraries (${EXTENSION_NAME} ZLIB::ZLIB -lcrypt32 )
30
+ target_link_libraries (${LOADABLE_EXTENSION_NAME} ZLIB::ZLIB ${WIN_LIBS} )
31
+ target_link_libraries (${EXTENSION_NAME} ZLIB::ZLIB ${WIN_LIBS} )
38
32
endif ()
39
33
40
34
install (
0 commit comments