forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
132 lines (111 loc) · 3.94 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
add_definitions(-DDUCKDB)
if(${DISABLE_THREADS})
add_definitions(-DDUCKDB_NO_THREADS)
endif()
add_extension_definitions()
if(NOT MSVC)
set(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -Wextra -Wno-unused-parameter -Wno-redundant-move"
)
if(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6)
set(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -Wimplicit-fallthrough")
endif()
else()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wimplicit-fallthrough")
endif()
endif()
set(EXIT_TIME_DESTRUCTORS_WARNING FALSE)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}"
STREQUAL "AppleClang")
set(EXIT_TIME_DESTRUCTORS_WARNING TRUE)
set(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -Wexit-time-destructors -Wimplicit-int-conversion -Wshorten-64-to-32 -Wnarrowing -Wsign-conversion -Wsign-compare -Wconversion"
)
endif()
set(DUCKDB_SYSTEM_LIBS ${CMAKE_DL_LIBS})
if(MSVC OR MINGW)
set(DUCKDB_SYSTEM_LIBS ${DUCKDB_SYSTEM_LIBS} ws2_32 rstrtmgr)
endif()
if(MSVC)
set(DUCKDB_SYSTEM_LIBS ${DUCKDB_SYSTEM_LIBS} bcrypt)
endif()
if(MSVC)
add_definitions(/bigobj)
endif()
if(AMALGAMATION_BUILD)
add_library(duckdb SHARED "${PROJECT_SOURCE_DIR}/src/amalgamation/duckdb.cpp")
target_link_libraries(duckdb ${DUCKDB_SYSTEM_LIBS})
link_threads(duckdb)
link_extension_libraries(duckdb)
add_library(duckdb_static STATIC
"${PROJECT_SOURCE_DIR}/src/amalgamation/duckdb.cpp")
target_link_libraries(duckdb_static ${DUCKDB_SYSTEM_LIBS})
link_threads(duckdb_static)
link_extension_libraries(duckdb_static)
install(FILES "${PROJECT_SOURCE_DIR}/src/amalgamation/duckdb.hpp"
"${PROJECT_SOURCE_DIR}/src/include/duckdb.h"
DESTINATION "${INSTALL_INCLUDE_DIR}")
install(FILES "${PROJECT_SOURCE_DIR}/src/include/duckdb/common/winapi.hpp"
DESTINATION "${INSTALL_INCLUDE_DIR}/duckdb/common")
else()
add_definitions(-DDUCKDB_MAIN_LIBRARY)
add_subdirectory(optimizer)
add_subdirectory(planner)
add_subdirectory(parser)
if(${BUILD_CORE_FUNCTIONS_EXTENSION})
add_subdirectory(core_functions)
endif()
add_subdirectory(function)
add_subdirectory(catalog)
add_subdirectory(common)
add_subdirectory(execution)
add_subdirectory(main)
add_subdirectory(parallel)
add_subdirectory(storage)
add_subdirectory(transaction)
add_subdirectory(verification)
set(DUCKDB_LINK_LIBS
${DUCKDB_SYSTEM_LIBS}
duckdb_fsst
duckdb_fmt
duckdb_pg_query
duckdb_re2
duckdb_miniz
duckdb_utf8proc
duckdb_hyperloglog
duckdb_fastpforlib
duckdb_skiplistlib
duckdb_mbedtls
duckdb_yyjson)
add_library(duckdb SHARED ${ALL_OBJECT_FILES})
target_link_libraries(duckdb ${DUCKDB_LINK_LIBS})
link_threads(duckdb)
link_extension_libraries(duckdb)
add_library(duckdb_static STATIC ${ALL_OBJECT_FILES})
target_link_libraries(duckdb_static ${DUCKDB_LINK_LIBS})
link_threads(duckdb_static)
link_extension_libraries(duckdb_static)
target_include_directories(
duckdb PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_include_directories(
duckdb_static PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
install(
DIRECTORY "${PROJECT_SOURCE_DIR}/src/include/duckdb"
DESTINATION "${INSTALL_INCLUDE_DIR}"
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.ipp")
install(FILES "${PROJECT_SOURCE_DIR}/src/include/duckdb.hpp"
"${PROJECT_SOURCE_DIR}/src/include/duckdb.h"
DESTINATION "${INSTALL_INCLUDE_DIR}")
endif()
install(
TARGETS duckdb duckdb_static
EXPORT "${DUCKDB_EXPORT_SET}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
RUNTIME DESTINATION "${INSTALL_BIN_DIR}")