diff --git a/CMakeLists.txt b/CMakeLists.txt index 50cd37ed..260662c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -set(CMAKE_POLICY_VERSION_MINIMUM 3.5) +set(CMAKE_POLICY_VERSION_MINIMUM 3.5) cmake_minimum_required(VERSION 3.25) set(REPO_NAME MqttModule) @@ -28,6 +28,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/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 90e75510..2b5c223b 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/mqtt_streaming_module/src/CMakeLists.txt b/modules/mqtt_streaming_module/src/CMakeLists.txt index 2dfb25af..e77f070f 100644 --- a/modules/mqtt_streaming_module/src/CMakeLists.txt +++ b/modules/mqtt_streaming_module/src/CMakeLists.txt @@ -92,6 +92,9 @@ add_library(${LIB_NAME} SHARED ${SRC_Include} ) add_library(${SDK_TARGET_NAMESPACE}::${LIB_NAME} ALIAS ${LIB_NAME}) +opendaq_target_pch(${LIB_NAME} ) +opendaq_target_unity_libs(${LIB_NAME} BATCH_SIZE 4) + if(${REPO_OPTION_PREFIX}_ENABLE_TESTS) target_compile_definitions(${LIB_NAME} PRIVATE ${REPO_OPTION_PREFIX}_ENABLE_TESTS diff --git a/modules/mqtt_streaming_module/tests/CMakeLists.txt b/modules/mqtt_streaming_module/tests/CMakeLists.txt index a2026f9a..0fe28ca4 100644 --- a/modules/mqtt_streaming_module/tests/CMakeLists.txt +++ b/modules/mqtt_streaming_module/tests/CMakeLists.txt @@ -25,6 +25,12 @@ if (MSVC) target_compile_options(${TEST_APP} PRIVATE /bigobj) endif() +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_custom_command( TARGET ${TEST_APP} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory diff --git a/opendaq_ref b/opendaq_ref index 14fdd990..9f742334 100644 --- a/opendaq_ref +++ b/opendaq_ref @@ -1 +1 @@ -eb11da4eee3b966778a6a9b82397352f2ff843d1 \ No newline at end of file +47593806ee16fbd5ea6b19f1f32309b583bb9a52 \ No newline at end of file diff --git a/shared/mqtt_streaming_protocol/src/CMakeLists.txt b/shared/mqtt_streaming_protocol/src/CMakeLists.txt index 918730df..c2bf453e 100644 --- a/shared/mqtt_streaming_protocol/src/CMakeLists.txt +++ b/shared/mqtt_streaming_protocol/src/CMakeLists.txt @@ -28,6 +28,9 @@ add_library(${LIB_NAME} STATIC ${SRC_Cpp} add_library(${SDK_TARGET_NAMESPACE}::${LIB_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/mqtt_streaming_protocol/tests/CMakeLists.txt b/shared/mqtt_streaming_protocol/tests/CMakeLists.txt index fb056f09..59c7a681 100644 --- a/shared/mqtt_streaming_protocol/tests/CMakeLists.txt +++ b/shared/mqtt_streaming_protocol/tests/CMakeLists.txt @@ -31,6 +31,8 @@ target_link_libraries(${TEST_APP} PRIVATE daq::opendaq_test_utils ${TEST_LIB} ) +opendaq_target_pch(${TEST_APP} ) + add_test(NAME ${TEST_APP} COMMAND $ WORKING_DIRECTORY $