cpp_client_telemetry/lib/CMakeLists.txt

221 строка
7.1 KiB
CMake
Исходник Обычный вид История

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
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
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
api/ILogConfiguration.cpp
2018-04-13 01:57:01 +03:00
api/LogManagerFactory.cpp
api/capi.cpp
2019-08-28 02:56:26 +03:00
api/DataViewerCollection.cpp
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
http/HttpClientFactory.cpp
2018-04-13 01:57:01 +03:00
stats/Statistics.cpp
stats/MetaStats.cpp
offline/StorageObserver.cpp
offline/MemoryStorage.cpp
2018-04-13 01:57:01 +03:00
offline/OfflineStorage_SQLite.cpp
offline/OfflineStorageHandler.cpp
2020-08-05 18:16:55 +03:00
offline/LogSessionDataProvider.cpp
2018-04-13 01:57:01 +03:00
backoff/IBackoff.cpp
2019-03-29 02:40:31 +03:00
pal/PAL.cpp
pal/TaskDispatcher_CAPI.cpp
pal/WorkerThread.cpp
2018-04-13 01:57:01 +03:00
)
2020-08-18 18:15:39 +03:00
# Support for Azure Monitor / Application Insights
if(BUILD_AZMON)
2020-08-31 21:14:32 +03:00
include(modules/azmon/CMakeLists.txt OPTIONAL)
2020-08-18 18:15:39 +03:00
endif()
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
modules/exp/FifoFileStorage.cpp
)
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/dataviewer/)
list(APPEND SRCS
modules/dataviewer/DefaultDataViewer.cpp
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.cpp
2019-11-19 01:44:46 +03:00
)
if(BUILD_IOS)
list(APPEND SRCS
pal/posix/sysinfo_utils_ios.mm
)
else()
list(APPEND SRCS
pal/posix/sysinfo_utils_mac.mm
)
2019-11-19 01:44:46 +03:00
endif()
endif()
2018-04-13 01:57:01 +03:00
list(APPEND SRCS
pal/posix/DeviceInformationImpl.cpp
pal/posix/SystemInformationImpl.cpp
pal/posix/sysinfo_sources.cpp
)
if(APPLE)
if(BUILD_APPLE_HTTP OR BUILD_IOS)
list(APPEND SRCS
http/HttpClient_Apple.mm
)
else()
list(APPEND SRCS
http/HttpClient_Curl.cpp
http/HttpClient_Curl.hpp
)
endif()
if(BUILD_IOS)
list(APPEND SRCS
pal/posix/NetworkInformationImpl.mm
pal/posix/ODWReachability.m
)
else()
list(APPEND SRCS
pal/posix/NetworkInformationImpl.cpp
)
endif()
else()
list(APPEND SRCS
http/HttpClient_Curl.cpp
http/HttpClient_Curl.hpp
pal/posix/NetworkInformationImpl.cpp
)
endif()
2019-11-19 22:49:23 +03:00
if(APPLE AND BUILD_OBJC_WRAPPER)
2019-11-19 01:44:46 +03:00
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
../wrappers/obj-c/ODWSemanticContext.mm
2019-11-19 01:44:46 +03:00
)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/dataviewer/)
list(APPEND SRCS
../wrappers/obj-c/ODWDiagnosticDataViewer.mm
)
endif()
2019-11-19 01:44:46 +03:00
endif()
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 -DMATSDK_PLATFORM_WINDOWS=1 -DMATSDK_SHARED_LIB=1 -D_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
pal/desktop/WindowsDesktopDeviceInformationImpl.cpp
pal/desktop/WindowsDesktopNetworkInformationImpl.cpp
pal/desktop/WindowsDesktopSystemInformationImpl.cpp
pal/desktop/WindowsEnvironmentInfo.hpp
pal/desktop/NetworkDetector.cpp
utils/StringConversion.cpp
2019-03-29 02:40:31 +03:00
)
# UTC module
2019-07-20 03:05:19 +03:00
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/utc)
list(APPEND SRCS
modules/utc/desktop/UtcHelpers.cpp
modules/utc/UtcTelemetrySystem.cpp
)
endif()
else()
message(FATAL_ERROR "No platform abstraction library configured. Set PAL_IMPLEMENTATION.")
endif()
# 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()
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")
endif()
endif()
2018-02-09 21:47:22 +03:00
if(BUILD_SHARED_LIBS STREQUAL "ON")
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()
message("-- Building static SDK library")
2019-03-29 02:40:31 +03:00
add_library(mat STATIC ${SRCS})
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}" )
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}" )
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()