Skip to content

Commit f1edf4c

Browse files
committed
Move sources to src/ directory
1 parent 98848a6 commit f1edf4c

28 files changed

+31
-32
lines changed

CMakeLists.txt

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,26 @@
11
cmake_minimum_required(VERSION 2.8.12...3.29)
22

3-
set(HTTPFS_BASE_FOLDER "extension/httpfs")
3+
set(HTTPFS_BASE_FOLDER "src")
44

55
project(HTTPFsExtension)
66

77
add_extension_definitions()
88

9-
include_directories(extension/httpfs/include
10-
${DUCKDB_MODULE_BASE_DIR}/third_party/httplib)
11-
129
if (NOT EMSCRIPTEN)
13-
set(EXTRA_SOURCES extension/httpfs/crypto.cpp extension/httpfs/httpfs_httplib_client.cpp extension/httpfs/httpfs_curl_client.cpp)
1410
add_definitions(-DOVERRIDE_ENCRYPTION_UTILS=1)
1511
else()
16-
set(EXTRA_SOURCES extension/httpfs/httpfs_client_wasm.cpp)
1712
set (DUCKDB_EXTENSION_HTTPFS_LINKED_LIBS "../../third_party/mbedtls/libduckdb_mbedtls.a")
1813
endif()
1914

20-
build_static_extension(
21-
httpfs
22-
extension/httpfs/hffs.cpp
23-
extension/httpfs/s3fs.cpp
24-
extension/httpfs/httpfs.cpp
25-
extension/httpfs/http_state.cpp
26-
extension/httpfs/crypto.cpp
27-
extension/httpfs/hash_functions.cpp
28-
extension/httpfs/create_secret_functions.cpp
29-
extension/httpfs/httpfs_extension.cpp
30-
${EXTRA_SOURCES} )
15+
include_directories(src/include
16+
${DUCKDB_MODULE_BASE_DIR}/third_party/httplib)
17+
add_subdirectory(src)
18+
set(EXTENSION_SOURCES ${ALL_OBJECT_FILES})
19+
20+
build_static_extension(httpfs ${EXTENSION_SOURCES})
3121

3222
set(PARAMETERS "-warnings")
33-
build_loadable_extension(
34-
httpfs
35-
${PARAMETERS}
36-
extension/httpfs/hffs.cpp
37-
extension/httpfs/s3fs.cpp
38-
extension/httpfs/httpfs.cpp
39-
extension/httpfs/http_state.cpp
40-
extension/httpfs/crypto.cpp
41-
extension/httpfs/hash_functions.cpp
42-
extension/httpfs/create_secret_functions.cpp
43-
extension/httpfs/httpfs_extension.cpp
44-
${EXTRA_SOURCES} )
23+
build_loadable_extension(httpfs ${PARAMETERS} ${EXTENSION_SOURCES})
4524

4625
if(MINGW)
4726
set(OPENSSL_USE_STATIC_LIBS TRUE)

extension_config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ duckdb_extension_load(parquet)
66

77
duckdb_extension_load(httpfs
88
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
9-
INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/extension/httpfs/include
9+
INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/src/include
1010
)

src/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
set(HTTPFS_SOURCES
2+
hffs.cpp
3+
s3fs.cpp
4+
httpfs.cpp
5+
http_state.cpp
6+
crypto.cpp
7+
hash_functions.cpp
8+
create_secret_functions.cpp
9+
httpfs_extension.cpp
10+
)
11+
if (NOT EMSCRIPTEN)
12+
set(HTTPFS_SOURCES ${HTTPFS_SOURCES} crypto.cpp httpfs_httplib_client.cpp httpfs_curl_client.cpp)
13+
else()
14+
set(HTTPFS_SOURCES ${HTTPFS_SOURCES} httpfs_client_wasm.cpp)
15+
endif()
16+
17+
add_library(httpfs_library OBJECT ${HTTPFS_SOURCES})
18+
set(ALL_OBJECT_FILES
19+
${ALL_OBJECT_FILES} $<TARGET_OBJECTS:httpfs_library>
20+
PARENT_SCOPE)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)