Skip to content

Commit

Permalink
tests: add atomic flag if needed (CLIUtils#1000)
Browse files Browse the repository at this point in the history
Fix CLIUtils#999.

This looks like about what we have to do. This test seems to be missing
from Meson, so don't have a workaround there yet.

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Feb 6, 2024
1 parent 30ead5d commit fd483ea
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,18 @@ if(CMAKE_CXX_STANDARD GREATER 16)
target_compile_definitions(FuzzFailTest_Single PUBLIC -DTEST_FILE_FOLDER="${TEST_FILE_FOLDER}")
target_sources(FuzzFailTest_Single PUBLIC ${PROJECT_SOURCE_DIR}/fuzz/fuzzApp.cpp)
endif()

# Some platforms need to link to atomic
file(WRITE "${CMAKE_BINARY_DIR}/test_atomic.cpp"
"#include <atomic>\n" "int main() { std::atomic<int64_t> i(0); i++; return 0; }\n")
try_compile(ATOMIC_BUILD_SUCCEEDED "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/test_atomic.cpp")
if(NOT ATOMIC_BUILD_SUCCEEDED)
target_link_libraries(FuzzFailTest PRIVATE atomic)
if(CLI11_SINGLE_FILE AND CLI11_SINGLE_FILE_TESTS)
target_link_libraries(FuzzFailTestSingle PRIVATE atomic)
endif()
endif()
file(REMOVE ${CMAKE_BINARY_DIR}/test_atomic.cpp)
endif()

# Add -Wno-deprecated-declarations to DeprecatedTest
Expand Down

0 comments on commit fd483ea

Please sign in to comment.