Skip to content

Commit

Permalink
Improve add_boost_test CMake function (#2552)
Browse files Browse the repository at this point in the history
- Start parsing argument from the 2nd one, ignore the 1st argument
`${ARGV0}` since it's reserved to the test name
- Remove the obsolete linking to `stdc++fs` (no longer necessary with
modern compilers/linkers)
  • Loading branch information
flomnes authored Jan 6, 2025
1 parent 9a9715e commit a71f438
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/tests/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function(add_boost_test)
set(options "")
set(oneValueArgs)
set(multiValueArgs SRC LIBS INCLUDE)
cmake_parse_arguments(PARSE_ARGV 0 arg
cmake_parse_arguments(PARSE_ARGV 1 arg
"${options}" "${oneValueArgs}" "${multiValueArgs}")
# Bypass cmake_parse_arguments for the 1st argument
set(TEST_NAME ${ARGV0})
Expand All @@ -29,10 +29,4 @@ function(add_boost_test)

# Give the IDE some directions to display tests in a "Unit-tests" folder
set_target_properties(${TEST_NAME} PROPERTIES FOLDER Unit-tests)

# Linux only. TODO remove ?
if(UNIX AND NOT APPLE)
target_link_libraries(${TEST_NAME} PRIVATE stdc++fs)
endif()

endfunction()

0 comments on commit a71f438

Please sign in to comment.