-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
58 lines (45 loc) · 1.62 KB
/
Copy pathCMakeLists.txt
File metadata and controls
58 lines (45 loc) · 1.62 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
file(GLOB HEADER_LIST CONFIGURE_DEPENDS
"${LaunchDarklyCPPServerDynamoDBSource_SOURCE_DIR}/include/launchdarkly/server_side/integrations/dynamodb/*.hpp"
)
if (LD_BUILD_SHARED_LIBS)
message(STATUS "LaunchDarkly: building server-sdk-dynamodb-source as shared library")
add_library(${LIBNAME} SHARED)
else ()
message(STATUS "LaunchDarkly: building server-sdk-dynamodb-source as static library")
add_library(${LIBNAME} STATIC)
endif ()
target_sources(${LIBNAME}
PRIVATE
${HEADER_LIST}
dynamodb_source.cpp
dynamodb_big_segment_store.cpp
aws_sdk_guard.cpp
client_factory.cpp
)
target_link_libraries(${LIBNAME}
PUBLIC launchdarkly::server
PRIVATE
aws-cpp-sdk-dynamodb
aws-cpp-sdk-core
)
add_library(launchdarkly::server_dynamodb_source ALIAS ${LIBNAME})
if (LD_BUILD_SHARED_LIBS AND MSVC)
install(FILES $<TARGET_PDB_FILE:${LIBNAME}> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
endif ()
# Using PUBLIC_HEADERS would flatten the include.
# This will preserve it, but dependencies must do the same.
install(DIRECTORY "${LaunchDarklyCPPServerDynamoDBSource_SOURCE_DIR}/include/launchdarkly"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
# Need the public headers to build.
target_include_directories(${LIBNAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
$<INSTALL_INTERFACE:include>
)
# Minimum C++ standard needed for consuming the public API is C++17.
target_compile_features(${LIBNAME} PUBLIC cxx_std_17)
install(
TARGETS ${LIBNAME} OPTIONAL
EXPORT ${LD_TARGETS_EXPORT_NAME}
)