Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/internal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,14 @@ if(FLB_METRICS)
set(UNIT_TESTS_FILES
${UNIT_TESTS_FILES}
metrics.c
cumulative_to_delta.c
)

if (NOT WIN32)
set(UNIT_TESTS_FILES
${UNIT_TESTS_FILES}
cumulative_to_delta.c
)
Comment on lines +123 to +127
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard the flb-it-cumulative_to_delta setup when skipping it

On Windows with FLB_METRICS=ON and the default FLB_PROCESSOR_CUMULATIVE_TO_DELTA=ON, this removes cumulative_to_delta.c from UNIT_TESTS_FILES, so prepare_unit_tests() never creates flb-it-cumulative_to_delta (tests/internal/CMakeLists.txt:222-263). The unconditional block at lines 265-274 still calls target_sources()/target_include_directories() for that target, and cmake --help-command target_sources requires the target to have been created by add_executable()/add_library(). In a minimal repro, CMake errors with Cannot specify sources for target ... which is not built by this project., so Windows internal-test configurations now fail at configure time instead of just skipping this test.

Useful? React with 👍 / 👎.

endif()
endif()

if(FLB_HTTP_SERVER)
Expand Down Expand Up @@ -256,7 +262,7 @@ endfunction(prepare_unit_tests)

prepare_unit_tests(flb-it- "${UNIT_TESTS_FILES}")

if(FLB_METRICS AND FLB_PROCESSOR_CUMULATIVE_TO_DELTA)
if(FLB_METRICS AND FLB_PROCESSOR_CUMULATIVE_TO_DELTA AND NOT WIN32)
set(CUMULATIVE_TO_DELTA_PLUGIN_DIR
${PROJECT_SOURCE_DIR}/plugins/processor_cumulative_to_delta)
set(CUMULATIVE_TO_DELTA_CORE_SOURCE
Expand Down
Loading