2019-08-20 20:06:04 +03:00
|
|
|
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 /usr/local/include )
|
2018-04-13 01:57:01 +03:00
|
|
|
|
|
|
|
set(SRCS decorators/BaseDecorator.cpp
|
|
|
|
packager/BondSplicer.cpp
|
|
|
|
packager/Packager.cpp
|
|
|
|
callbacks/DebugSource.cpp
|
|
|
|
bond/BondSerializer.cpp
|
2019-08-15 19:25:46 +03:00
|
|
|
filter/EventFilterCollection.cpp
|
2018-04-13 01:57:01 +03:00
|
|
|
tpm/TransmitProfiles.cpp
|
|
|
|
tpm/TransmissionPolicyManager.cpp
|
|
|
|
tpm/DeviceStateHandler.cpp
|
|
|
|
system/EventProperty.cpp
|
|
|
|
system/TelemetrySystem.cpp
|
|
|
|
system/EventProperties.cpp
|
|
|
|
compression/HttpDeflateCompression.cpp
|
2019-09-18 10:53:25 +03:00
|
|
|
api/AllowedLevelsCollection.cpp
|
2018-04-13 01:57:01 +03:00
|
|
|
api/LogManager.cpp
|
|
|
|
api/ContextFieldsProvider.cpp
|
|
|
|
api/LogManagerImpl.cpp
|
|
|
|
api/LogSessionData.cpp
|
|
|
|
api/Logger.cpp
|
|
|
|
api/LogManagerProvider.cpp
|
|
|
|
api/CorrelationVector.cpp
|
|
|
|
api/LogConfiguration.cpp
|
|
|
|
api/AuthTokensController.cpp
|
2019-09-09 22:57:20 +03:00
|
|
|
api/ILogConfiguration.cpp
|
2018-04-13 01:57:01 +03:00
|
|
|
api/LogManagerFactory.cpp
|
2018-11-21 00:20:31 +03:00
|
|
|
api/capi.cpp
|
2019-08-28 02:56:26 +03:00
|
|
|
api/DataViewerCollection.cpp
|
2019-03-08 08:24:15 +03:00
|
|
|
utils/FileUtils.cpp
|
2018-04-13 01:57:01 +03:00
|
|
|
utils/Utils.cpp
|
|
|
|
utils/StringUtils.cpp
|
|
|
|
pal/InformationProviderImpl.cpp
|
2019-08-24 03:07:07 +03:00
|
|
|
http/HttpClient_CAPI.cpp
|
2018-04-13 01:57:01 +03:00
|
|
|
http/HttpClientManager.cpp
|
|
|
|
http/HttpRequestEncoder.cpp
|
|
|
|
http/HttpResponseDecoder.cpp
|
2019-02-24 04:05:40 +03:00
|
|
|
http/HttpClientFactory.cpp
|
2018-04-13 01:57:01 +03:00
|
|
|
stats/Statistics.cpp
|
|
|
|
stats/MetaStats.cpp
|
|
|
|
offline/StorageObserver.cpp
|
2018-09-05 23:37:29 +03:00
|
|
|
offline/MemoryStorage.cpp
|
2018-04-13 01:57:01 +03:00
|
|
|
offline/OfflineStorage_SQLite.cpp
|
|
|
|
offline/OfflineStorageHandler.cpp
|
|
|
|
backoff/IBackoff.cpp
|
2019-03-29 02:40:31 +03:00
|
|
|
pal/PAL.cpp
|
2019-09-09 22:57:20 +03:00
|
|
|
pal/TaskDispatcher_CAPI.cpp
|
|
|
|
pal/WorkerThread.cpp
|
2018-04-13 01:57:01 +03:00
|
|
|
)
|
2017-05-10 20:29:11 +03:00
|
|
|
|
2019-07-20 03:05:19 +03:00
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/exp/)
|
2019-03-30 00:00:17 +03:00
|
|
|
list(APPEND SRCS
|
|
|
|
modules/exp/afd/afdclient/AFDClientUtils.cpp
|
|
|
|
modules/exp/afd/afdclient/AFDClient.cpp
|
|
|
|
modules/exp/afd/afdclient/AFDConfigCache.cpp
|
|
|
|
modules/exp/ecs/ecsclient/ECSClient.cpp
|
|
|
|
modules/exp/ecs/ecsclient/ECSClientUtils.cpp
|
|
|
|
modules/exp/ecs/ecsclient/ECSConfigCache.cpp
|
|
|
|
modules/exp/JsonHelper.cpp
|
|
|
|
modules/exp/EXPCommonClient.cpp
|
2019-08-20 20:06:04 +03:00
|
|
|
modules/exp/FifoFileStorage.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(EXISTS "modules/dataviewer/")
|
|
|
|
list(APPEND SRCS
|
|
|
|
modules/dataviewer/DefaultDataViewer.cpp
|
2019-08-28 04:17:38 +03:00
|
|
|
modules/dataviewer/OnDisableNotificationCollection.cpp
|
2019-03-30 00:00:17 +03:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-02-09 21:47:22 +03:00
|
|
|
if(PAL_IMPLEMENTATION STREQUAL "CPP11")
|
2019-11-19 01:44:46 +03:00
|
|
|
if(APPLE)
|
|
|
|
list(APPEND SRCS
|
|
|
|
pal/posix/sysinfo_utils_apple.mm
|
|
|
|
)
|
|
|
|
if(BUILD_IOS)
|
|
|
|
list(APPEND SRCS
|
|
|
|
pal/posix/sysinfo_utils_ios.mm
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
2018-04-13 01:57:01 +03:00
|
|
|
list(APPEND SRCS
|
2018-11-07 09:39:27 +03:00
|
|
|
pal/posix/DeviceInformationImpl.cpp
|
|
|
|
pal/posix/SystemInformationImpl.cpp
|
|
|
|
pal/posix/sysinfo_sources.cpp
|
|
|
|
)
|
2019-09-11 19:27:06 +03:00
|
|
|
|
|
|
|
if(BUILD_IOS)
|
|
|
|
list(APPEND SRCS
|
|
|
|
http/HttpClient_iOS.mm
|
2019-09-26 00:31:01 +03:00
|
|
|
pal/posix/NetworkInformationImpl.mm
|
|
|
|
pal/posix/Reachability.m
|
2019-09-11 19:27:06 +03:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
list(APPEND SRCS
|
|
|
|
http/HttpClient_Curl.cpp
|
|
|
|
http/HttpClient_Curl.hpp
|
2019-09-26 00:31:01 +03:00
|
|
|
pal/posix/NetworkInformationImpl.cpp
|
2019-09-11 19:27:06 +03:00
|
|
|
)
|
|
|
|
endif()
|
2019-11-19 01:44:46 +03:00
|
|
|
if(BUILD_OBJC_WRAPPER)
|
|
|
|
message("Include Wrappers")
|
|
|
|
list(APPEND SRCS
|
|
|
|
../wrappers/obj-c/ODWLogger.mm
|
|
|
|
../wrappers/obj-c/ODWLogManager.mm
|
|
|
|
../wrappers/obj-c/ODWEventProperties.mm
|
|
|
|
../wrappers/obj-c/ODWLogConfiguration.mm
|
|
|
|
)
|
|
|
|
endif()
|
2018-11-07 09:39:27 +03:00
|
|
|
elseif(PAL_IMPLEMENTATION STREQUAL "WIN32")
|
|
|
|
# Win32 Desktop for now.
|
|
|
|
# TODO: define a separate PAL for Win10 cmake build
|
|
|
|
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../zlib ${CMAKE_CURRENT_SOURCE_DIR}/../sqlite)
|
|
|
|
add_definitions(-D_UNICODE -DUNICODE -DZLIB_WINAPI -DWIN32 -DARIASDK_PLATFORM_WINDOWS=1 -DARIASDK_SHARED_LIB=1 -D_ARIA_UTC_SDK -D_CRT_SECURE_NO_WARNINGS -DUSE_BOND -D_WINDOWS -D_USRDLL -DWINVER=_WIN32_WINNT_WIN7)
|
|
|
|
remove_definitions(-D_MBCS)
|
|
|
|
list(APPEND SRCS
|
|
|
|
http/HttpClient_WinInet.cpp
|
|
|
|
http/HttpClient_WinInet.hpp
|
2018-11-20 06:08:18 +03:00
|
|
|
pal/desktop/WindowsDesktopDeviceInformationImpl.cpp
|
|
|
|
pal/desktop/WindowsDesktopNetworkInformationImpl.cpp
|
|
|
|
pal/desktop/WindowsDesktopSystemInformationImpl.cpp
|
2019-06-27 07:23:34 +03:00
|
|
|
pal/desktop/WindowsEnvironmentInfo.hpp
|
2018-11-20 06:08:18 +03:00
|
|
|
pal/desktop/NetworkDetector.cpp
|
2019-03-29 02:40:31 +03:00
|
|
|
)
|
2019-09-18 10:53:25 +03:00
|
|
|
|
|
|
|
# UTC module
|
2019-07-20 03:05:19 +03:00
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/utc)
|
2019-04-01 23:34:51 +03:00
|
|
|
list(APPEND SRCS
|
|
|
|
modules/utc/desktop/UtcHelpers.cpp
|
|
|
|
modules/utc/UtcTelemetrySystem.cpp
|
|
|
|
)
|
|
|
|
endif()
|
2019-09-18 10:53:25 +03:00
|
|
|
|
2017-05-10 20:29:11 +03:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "No platform abstraction library configured. Set PAL_IMPLEMENTATION.")
|
|
|
|
endif()
|
|
|
|
|
2019-09-18 10:53:25 +03:00
|
|
|
# Filtering module
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/filter)
|
|
|
|
list(APPEND SRCS
|
|
|
|
modules/filter/CompliantByDefaultEventFilterModule.cpp
|
|
|
|
modules/filter/CompliantByDefaultFilterApi.cpp
|
|
|
|
modules/filter/LevelCheckingEventFilter.cpp
|
|
|
|
)
|
|
|
|
endif()
|
2017-05-10 20:29:11 +03:00
|
|
|
|
|
|
|
create_source_files_groups_per_folder(${SRCS})
|
|
|
|
|
2018-02-09 21:47:22 +03:00
|
|
|
# MinGW does not require pthread
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
if(THREADS_HAVE_PTHREAD_ARG)
|
2019-03-29 02:40:31 +03:00
|
|
|
target_compile_options(mat PUBLIC "-pthread")
|
2017-05-10 20:29:11 +03:00
|
|
|
endif()
|
|
|
|
endif()
|
2018-02-09 21:47:22 +03:00
|
|
|
|
|
|
|
if(BUILD_SHARED_LIBS STREQUAL "ON")
|
2019-02-01 12:08:09 +03:00
|
|
|
message("-- Building shared SDK library")
|
2019-03-29 02:40:31 +03:00
|
|
|
add_library(mat SHARED ${SRCS})
|
2018-02-09 21:47:22 +03:00
|
|
|
add_library(sqlite3 SHARED IMPORTED GLOBAL)
|
|
|
|
add_library(z SHARED IMPORTED GLOBAL)
|
2019-03-29 02:40:31 +03:00
|
|
|
#target_link_libraries(mat PUBLIC libsqlite3.so libz.so ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" "${Tcmalloc_LIBRARIES}")
|
|
|
|
target_link_libraries(mat PUBLIC libsqlite3.so libz.so ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}")
|
|
|
|
# target_link_libraries(mat PUBLIC libsqlite3 libcurl.a libz.a libssl.a libcrypto.a "${SQLITE_LIBRARY}" "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" )
|
|
|
|
install(TARGETS mat EXPORT mat LIBRARY DESTINATION ${INSTALL_LIB_DIR})
|
2018-02-09 21:47:22 +03:00
|
|
|
else()
|
2019-02-01 12:08:09 +03:00
|
|
|
message("-- Building static SDK library")
|
2019-03-29 02:40:31 +03:00
|
|
|
add_library(mat STATIC ${SRCS})
|
2019-02-01 12:08:09 +03:00
|
|
|
if(PAL_IMPLEMENTATION STREQUAL "WIN32")
|
2019-03-29 02:40:31 +03:00
|
|
|
target_link_libraries(mat ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" )
|
2019-02-01 12:08:09 +03:00
|
|
|
else()
|
|
|
|
add_library(sqlite3 STATIC IMPORTED GLOBAL)
|
|
|
|
add_library(z STATIC IMPORTED GLOBAL)
|
2019-03-29 02:40:31 +03:00
|
|
|
#target_link_libraries(mat PRIVATE libsqlite3.a PUBLIC libz.a ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" "${Tcmalloc_LIBRARIES}")
|
|
|
|
target_link_libraries(mat PRIVATE libsqlite3.a PUBLIC libz.a ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" )
|
2019-02-01 12:08:09 +03:00
|
|
|
endif()
|
2019-03-29 02:40:31 +03:00
|
|
|
install(TARGETS mat EXPORT mat ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
|
2018-02-09 21:47:22 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
message("-- Library will be installed to ${INSTALL_LIB_DIR}")
|
|
|
|
|
|
|
|
#if(PAL_IMPLEMENTATION STREQUAL "CPP11")
|
2019-03-29 02:40:31 +03:00
|
|
|
# #target_link_libraries(mat PUBLIC libcurl.a libz.a libssl.a libcrypto.a "${SQLITE_LIBRARY}" "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" )
|
|
|
|
# #target_link_libraries(mat PUBLIC libsqlite3.a libz.a ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" )
|
2018-02-09 21:47:22 +03:00
|
|
|
#endif()
|
|
|
|
|