Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion C/include/c4Compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@
#ifdef _MSC_VER
# ifdef LITECORE_EXPORTS
# define CBL_CORE_API __declspec(dllexport)
# else
# elif !defined(LITECORE_STATIC)
# define CBL_CORE_API __declspec(dllimport)
# else
# define CBL_CORE_API
# endif
# define CBL_CORE_API_IMPL CBL_CORE_API
#else
Expand Down
50 changes: 47 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ add_library(LiteCoreUnitTesting OBJECT EXCLUDE_FROM_ALL ${ALL_SRC_FILES})
set(LiteCoreObjectsDefines
LITECORE_IMPL
LITECORE_CPP_API=1
FLEECE_STATIC
HAS_UNCAUGHT_EXCEPTIONS # date.h use std::uncaught_exceptions instead of std::uncaught_exception
)
target_compile_definitions(
Expand Down Expand Up @@ -297,14 +298,19 @@ set(
)

if(BUILD_ENTERPRISE)
set(
list(APPEND
LITECORE_LIBRARIES_PRIVATE
${LITECORE_LIBRARIES_PRIVATE}
LiteCoreREST_Objects
LiteCoreWebSocket
LiteCoreListener_Objects
LiteCoreP2P
)

if (APPLE OR ANDROID)
list(APPEND
LITECORE_LIBRARIES_PRIVATE
LiteCoreP2P
)
endif()
endif()

if(LITECORE_BUILD_SHARED)
Expand Down Expand Up @@ -420,6 +426,11 @@ target_include_directories(
vendor/mbedtls/include
)

target_compile_definitions(
LiteCoreWebSocket PRIVATE
FLEECE_STATIC
)

target_link_libraries(
LiteCoreWebSocket PUBLIC
LiteCoreObjects
Expand All @@ -435,6 +446,39 @@ endif()

add_subdirectory(tool_support EXCLUDE_FROM_ALL)

if(LITECORE_BUILD_STATIC)
set(LC_MONOLITHIC_OBJECTS
$<TARGET_OBJECTS:LiteCoreObjects>
$<TARGET_OBJECTS:BLIPObjects>
$<TARGET_OBJECTS:FleeceObjects>
)

if(BUILD_ENTERPRISE)
list(APPEND LC_MONOLITHIC_OBJECTS
$<TARGET_OBJECTS:LiteCoreREST_Objects>
$<TARGET_OBJECTS:LiteCoreListener_Objects>
)

if(APPLE OR ANDROID)
list(APPEND LC_MONOLITHIC_OBJECTS
$<TARGET_OBJECTS:LiteCoreP2P>
)
endif()
endif()

add_library(LiteCoreFull STATIC ${LC_MONOLITHIC_OBJECTS})

# Link external (non object) libraries
target_link_libraries(
LiteCoreFull PRIVATE
LiteCoreWebSocket
SQLite3_UnicodeSN
mbedcrypto
mbedtls
mbedx509
CouchbaseSqlite3
)
endif()

### TESTS:

Expand Down
2 changes: 2 additions & 0 deletions LiteCore/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ setup_build()
target_compile_definitions(
CppTests PRIVATE
-DLITECORE_CPP_TESTS=1
-DFLEECE_STATIC
-DLITECORE_STATIC
-D_USE_MATH_DEFINES # Define math constants like PI
-DNOMINMAX # Get rid of min/max macros that interfere with std::min/std::max
-DCATCH_CONFIG_CPP11_STREAM_INSERTABLE_CHECK
Expand Down
6 changes: 6 additions & 0 deletions Networking/BLIP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ target_include_directories(
${LITECORE_LOCATION}/C/include
${LITECORE_LOCATION}/C/Cpp_include
)

target_compile_definitions(
BLIPObjects PRIVATE
-DFLEECE_STATIC
-DLITECORE_STATIC
)
1 change: 1 addition & 0 deletions REST/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ target_include_directories(

target_compile_definitions(
LiteCoreREST_Objects PRIVATE
FLEECE_STATIC
LITECORE_CPP_API=1
HAS_UNCAUGHT_EXCEPTIONS # date.h use std::uncaught_exceptions instead of std::uncaught_exception
)
Expand Down
2 changes: 1 addition & 1 deletion vendor/fleece