-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
49 lines (38 loc) · 1.29 KB
/
CMakeLists.txt
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
# cmake-lint: disable=C0103
cmake_minimum_required(VERSION 3.22)
cmake_policy(VERSION 3.22)
set(TARGET_NAME deltatable)
project(${TARGET_NAME} VERSION 0.0.1)
include_directories(src/include)
if(ANDROID)
set(Rust_CARGO_TARGET "aarch64-linux-android")
endif()
include(FetchContent)
fetchcontent_declare(
Corrosion
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
GIT_TAG v0.4
)
fetchcontent_makeavailable(Corrosion)
corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml)
set(EXTENSION_NAME ${TARGET_NAME}_extension)
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
include_directories(src/include)
set(EXTENSION_SOURCES src/deltatable_extension.cpp)
# build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})
set_target_properties(${LOADABLE_EXTENSION_NAME} PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(
${LOADABLE_EXTENSION_NAME}
"${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.a"
)
# target_link_libraries(
# ${EXTENSION_NAME}
# "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.a"
# )
install(
TARGETS ${LOADABLE_EXTENSION_NAME}
EXPORT "${DUCKDB_EXPORT_SET}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
)