diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bb8586..5b1ea13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ else() endif() # options +set(OPENDAQ_ENABLE_UNITY_LIBS ON CACHE BOOL "Unity builds for libraries") opendaq_setup_common_build_options() opendaq_setup_project_specific_build_options(${REPO_OPTION_PREFIX}) option(${REPO_OPTION_PREFIX}_ENABLE_EXAMPLE_APP "Enable ${REPO_NAME} example applications" ${PROJECT_IS_TOP_LEVEL}) diff --git a/changelog/changelog b/changelog/changelog index 09c94c8..5e7ef71 100644 --- a/changelog/changelog +++ b/changelog/changelog @@ -10,3 +10,4 @@ - [#3](https://github.com/openDAQ/LTStreamingModulesLegacy/pull/3) Import commit history from openDAQ SDK. - [#4](https://github.com/openDAQ/LTStreamingModulesLegacy/pull/4) Project initial version. +- [#17](https://github.com/openDAQ/LTStreamingModulesLegacy/pull/17) Precompiled headers and unity builds through opendaq-cmake-utils v1.1.0. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 02fc70b..1207a2a 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -8,7 +8,7 @@ include(FetchContent) FetchContent_Declare( opendaq-cmake-utils GIT_REPOSITORY https://github.com/openDAQ/opendaq-cmake-utils.git - GIT_TAG v1.0.1 + GIT_TAG v1.1.0 GIT_PROGRESS ON ) FetchContent_MakeAvailable(opendaq-cmake-utils) diff --git a/modules/websocket_streaming_client_module/src/CMakeLists.txt b/modules/websocket_streaming_client_module/src/CMakeLists.txt index dbf3df3..fe2f03f 100644 --- a/modules/websocket_streaming_client_module/src/CMakeLists.txt +++ b/modules/websocket_streaming_client_module/src/CMakeLists.txt @@ -29,6 +29,8 @@ add_library(${LIB_NAME} SHARED ${SRC_Include} ) add_library(${OPENDAQ_SDK_TARGET_NAMESPACE}::${LIB_NAME} ALIAS ${LIB_NAME}) +opendaq_target_pch(${LIB_NAME} ) + if (MSVC) target_compile_options(${LIB_NAME} PRIVATE /bigobj) endif() diff --git a/modules/websocket_streaming_client_module/tests/CMakeLists.txt b/modules/websocket_streaming_client_module/tests/CMakeLists.txt index 108b503..94ce6f4 100644 --- a/modules/websocket_streaming_client_module/tests/CMakeLists.txt +++ b/modules/websocket_streaming_client_module/tests/CMakeLists.txt @@ -12,6 +12,8 @@ target_link_libraries(${TEST_APP} PRIVATE ${OPENDAQ_SDK_TARGET_NAMESPACE}::opend ${OPENDAQ_SDK_TARGET_NAMESPACE}::${MODULE_NAME} ) +opendaq_target_pch(${TEST_APP} ) + add_test(NAME ${TEST_APP} COMMAND $ WORKING_DIRECTORY $ diff --git a/modules/websocket_streaming_server_module/src/CMakeLists.txt b/modules/websocket_streaming_server_module/src/CMakeLists.txt index 021ef46..5f9508b 100644 --- a/modules/websocket_streaming_server_module/src/CMakeLists.txt +++ b/modules/websocket_streaming_server_module/src/CMakeLists.txt @@ -34,6 +34,8 @@ add_library(${LIB_NAME} SHARED ${SRC_Include} add_library(${OPENDAQ_SDK_TARGET_NAMESPACE}::${LIB_NAME} ALIAS ${LIB_NAME}) +opendaq_target_pch(${LIB_NAME} ) + if (MSVC) target_compile_options(${LIB_NAME} PRIVATE /bigobj) endif() diff --git a/modules/websocket_streaming_server_module/tests/CMakeLists.txt b/modules/websocket_streaming_server_module/tests/CMakeLists.txt index 21de9c6..8f670fc 100644 --- a/modules/websocket_streaming_server_module/tests/CMakeLists.txt +++ b/modules/websocket_streaming_server_module/tests/CMakeLists.txt @@ -12,6 +12,8 @@ target_link_libraries(${TEST_APP} PRIVATE ${OPENDAQ_SDK_TARGET_NAMESPACE}::opend ${OPENDAQ_SDK_TARGET_NAMESPACE}::${MODULE_NAME} ) +opendaq_target_pch(${TEST_APP} ) + add_test(NAME ${TEST_APP} COMMAND $ WORKING_DIRECTORY $ diff --git a/opendaq_ref b/opendaq_ref index d0a6910..de045e5 100644 --- a/opendaq_ref +++ b/opendaq_ref @@ -1 +1 @@ -4757349a1db30721bead0cb695ec3a147913aef4 +47593806ee16fbd5ea6b19f1f32309b583bb9a52 diff --git a/shared/libraries/websocket_streaming/src/CMakeLists.txt b/shared/libraries/websocket_streaming/src/CMakeLists.txt index 4da86a8..a06deea 100644 --- a/shared/libraries/websocket_streaming/src/CMakeLists.txt +++ b/shared/libraries/websocket_streaming/src/CMakeLists.txt @@ -46,6 +46,9 @@ add_library(${LIB_NAME} STATIC ${SRC_Cpp} add_library(${OPENDAQ_SDK_TARGET_NAMESPACE}::${BASE_NAME} ALIAS ${LIB_NAME}) +opendaq_target_pch(${LIB_NAME} ) +opendaq_target_unity_libs(${LIB_NAME} BATCH_SIZE 4) + if(BUILD_64Bit OR BUILD_ARM) set_target_properties(${LIB_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) else() diff --git a/shared/libraries/websocket_streaming/tests/CMakeLists.txt b/shared/libraries/websocket_streaming/tests/CMakeLists.txt index 254d147..3413bf5 100644 --- a/shared/libraries/websocket_streaming/tests/CMakeLists.txt +++ b/shared/libraries/websocket_streaming/tests/CMakeLists.txt @@ -25,6 +25,12 @@ target_link_libraries(${TEST_APP} PRIVATE set_target_properties(${TEST_APP} PROPERTIES DEBUG_POSTFIX _debug) target_include_directories(${TEST_APP} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include") +opendaq_target_pch(${TEST_APP} ) + +# test_app.cpp defines main(). +set_source_files_properties(test_app.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) +opendaq_target_unity_tests(${TEST_APP} BATCH_SIZE 4) + add_test(NAME ${TEST_APP} COMMAND $ WORKING_DIRECTORY $