|
| 1 | +# Honor visibility properties for all target types |
| 2 | +cmake_policy(SET CMP0063 NEW) |
| 3 | + |
1 | 4 | include_directories( . ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include/public ${CMAKE_CURRENT_SOURCE_DIR}/include/public ${CMAKE_CURRENT_SOURCE_DIR}/include/mat ${CMAKE_CURRENT_SOURCE_DIR}/pal ${CMAKE_CURRENT_SOURCE_DIR}/utils ${CMAKE_CURRENT_SOURCE_DIR}/modules/exp ${CMAKE_CURRENT_SOURCE_DIR}/modules/dataviewer ${CMAKE_CURRENT_SOURCE_DIR}/modules/privacyguard ${CMAKE_CURRENT_SOURCE_DIR}/modules/liveeventinspector ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/Reachability ${CMAKE_CURRENT_SOURCE_DIR}/modules/cds /usr/local/include )
|
2 | 5 |
|
3 | 6 | set(SRCS decorators/BaseDecorator.cpp
|
@@ -217,7 +220,7 @@ endif()
|
217 | 220 |
|
218 | 221 | if(BUILD_SHARED_LIBS STREQUAL "ON")
|
219 | 222 | message("-- Building shared SDK library")
|
220 |
| - |
| 223 | + |
221 | 224 | # include(FindCURL)
|
222 | 225 | # find_package(CURL REQUIRED)
|
223 | 226 | # set(CMAKE_REQUIRED_LIBRARIES "${CURL_LIBRARIES}")
|
@@ -253,15 +256,17 @@ if(BUILD_SHARED_LIBS STREQUAL "ON")
|
253 | 256 | else()
|
254 | 257 | message("-- Building static SDK library")
|
255 | 258 | add_library(mat STATIC ${SRCS})
|
256 |
| - if(PAL_IMPLEMENTATION STREQUAL "WIN32") |
257 |
| - target_link_libraries(mat ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" ) |
258 |
| - else() |
259 |
| - add_library(sqlite3 STATIC IMPORTED GLOBAL) |
260 |
| - add_library(z STATIC IMPORTED GLOBAL) |
261 |
| - # |
262 |
| - # TODO: allow adding "${Tcmalloc_LIBRARIES}" to target_link_libraries for memory leak debugging |
263 |
| - # |
264 |
| - target_link_libraries(mat PRIVATE libsqlite3.a PUBLIC libz.a ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" ) |
| 259 | + if(LINK_STATIC_DEPENDS) |
| 260 | + if(PAL_IMPLEMENTATION STREQUAL "WIN32") |
| 261 | + target_link_libraries(mat ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" ) |
| 262 | + else() |
| 263 | + add_library(sqlite3 STATIC IMPORTED GLOBAL) |
| 264 | + add_library(z STATIC IMPORTED GLOBAL) |
| 265 | + # |
| 266 | + # TODO: allow adding "${Tcmalloc_LIBRARIES}" to target_link_libraries for memory leak debugging |
| 267 | + # |
| 268 | + target_link_libraries(mat PRIVATE libsqlite3.a PUBLIC libz.a ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" ) |
| 269 | + endif() |
265 | 270 | endif()
|
266 | 271 | install(TARGETS mat EXPORT mat ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
|
267 | 272 | endif()
|
|
0 commit comments