-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
90 lines (77 loc) · 2.86 KB
/
Copy pathCMakeLists.txt
File metadata and controls
90 lines (77 loc) · 2.86 KB
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
cmake_minimum_required(VERSION 3.5)
# Set extension name here
set(TARGET_NAME observefs)
set(CMAKE_CXX_STANDARD 14)
if(UNIX OR APPLE)
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wno-write-strings -Wno-c++17-extensions -Wno-c++20-extensions -Wunused-variable -Wunused-function -Wunused-but-set-variable"
)
endif()
# Override DuckDB encryption library, mimics httpfs extension behavior.
if(NOT EMSCRIPTEN)
add_definitions(-DOVERRIDE_ENCRYPTION_UTILS=1)
else()
set(DUCKDB_EXTENSION_HTTPFS_LINKED_LIBS
"../../third_party/mbedtls/libduckdb_mbedtls.a")
endif()
find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
set(EXTENSION_NAME ${TARGET_NAME}_extension)
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
project(${TARGET_NAME})
include_directories(src/include)
include_directories(duckdb-httpfs/src/include)
include_directories(duckdb/third_party/httplib)
set(EXTENSION_SOURCES
src/external_file_cache_query_function.cpp
src/external_file_cache_stats_recorder.cpp
src/fake_filesystem.cpp
src/filesystem_ref_registry.cpp
src/filesystem_status_query_function.cpp
src/histogram.cpp
src/io_operation.cpp
src/metrics_collector.cpp
src/numeric_utils.cpp
src/observability_filesystem.cpp
src/observefs_extension.cpp
src/observefs_instance_state.cpp
src/operation_latency_collector.cpp
src/operation_size_collector.cpp
src/quantile.cpp
src/quantilelite.cpp
src/quantile_estimator.cpp
src/string_utils.cpp
src/time_utils.cpp
duckdb-httpfs/src/create_secret_functions.cpp
duckdb-httpfs/src/crypto.cpp
duckdb-httpfs/src/hash_functions.cpp
duckdb-httpfs/src/hffs.cpp
duckdb-httpfs/src/http_state.cpp
duckdb-httpfs/src/httpfs.cpp
duckdb-httpfs/src/httpfs_connection_caching.cpp
duckdb-httpfs/src/httpfs_curl_client.cpp
duckdb-httpfs/src/httpfs_extension.cpp
duckdb-httpfs/src/httpfs_httplib_client.cpp
duckdb-httpfs/src/s3fs.cpp
duckdb-httpfs/src/s3_multi_part_upload.cpp)
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})
# Link OpenSSL in both the static library as the loadable extension
target_link_libraries(${EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto
CURL::libcurl)
target_link_libraries(${LOADABLE_EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto
CURL::libcurl)
# Link Windows Cryptography API library for certificate loading on Windows
if(MINGW OR WIN32)
target_link_libraries(${EXTENSION_NAME} crypt32)
target_link_libraries(${LOADABLE_EXTENSION_NAME} crypt32)
endif()
install(
TARGETS ${EXTENSION_NAME}
EXPORT "${DUCKDB_EXPORT_SET}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}")
# Unit tests, disabled on Windows due to linking issues.
if(NOT WIN32)
add_subdirectory(test/unittest)
endif()