File tree 3 files changed +20
-4
lines changed
3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,6 @@ cmake_install.cmake
9
9
rules.ninja
10
10
11
11
# Build products
12
- src /librealm-object-store. *
12
+ src /librealm-object-store.dylib
13
+ src /librealm-object-store-static.a
13
14
tests /tests
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ include(RealmCore)
13
13
set (REALM_CORE_VERSION "0.100.1" CACHE STRING "" )
14
14
use_realm_core(${REALM_CORE_VERSION} )
15
15
16
- include_directories ( ${REALM_CORE_INCLUDE_DIR} src external/pegtl)
16
+ set (PEGTL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} / external/pegtl)
17
17
18
18
add_subdirectory (src)
19
19
add_subdirectory (tests)
Original file line number Diff line number Diff line change @@ -55,5 +55,20 @@ else()
55
55
impl/generic/external_commit_helper.hpp)
56
56
endif ()
57
57
58
- add_library (realm-object-store SHARED ${SOURCES} ${HEADERS} )
59
- target_link_libraries (realm-object-store realm ${CF_LIBRARY} )
58
+ set (INCLUDE_DIRS ${REALM_CORE_INCLUDE_DIR} ${PEGTL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
59
+
60
+ # An object library to group together the compilation of the source files.
61
+ add_library (realm-object-store-objects OBJECT ${SOURCES} ${HEADERS} )
62
+ add_dependencies (realm-object-store-objects realm)
63
+ set_target_properties (realm-object-store-objects PROPERTIES POSITION_INDEPENDENT_CODE 1)
64
+ target_include_directories (realm-object-store-objects PUBLIC ${INCLUDE_DIRS} )
65
+
66
+ # A static library, aggregating the prebuilt object files.
67
+ add_library (realm-object-store-static STATIC $<TARGET_OBJECTS:realm-object-store-objects>)
68
+ target_include_directories (realm-object-store-static PUBLIC ${INCLUDE_DIRS} )
69
+ target_link_libraries (realm-object-store-static PUBLIC realm ${CF_LIBRARY} )
70
+
71
+ # A dynamic library, linking together the prebuilt object files.
72
+ add_library (realm-object-store SHARED $<TARGET_OBJECTS:realm-object-store-objects>)
73
+ target_include_directories (realm-object-store PUBLIC ${INCLUDE_DIRS} )
74
+ target_link_libraries (realm-object-store PRIVATE realm ${CF_LIBRARY} )
You can’t perform that action at this time.
0 commit comments