Skip to content

Commit 572e342

Browse files
committed
Add test for objcpp compatibility
1 parent 10841a8 commit 572e342

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,24 @@ if ( ATOMIC_QUEUE_BUILD_TESTS )
3030
NAME atomic_queue_tests
3131
COMMAND atomic_queue_tests
3232
)
33+
34+
if (APPLE)
35+
add_executable(
36+
atomic_queue_tests_objcpp
37+
${CMAKE_CURRENT_SOURCE_DIR}/tests.mm
38+
)
39+
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/tests.mm PROPERTIES COMPILE_FLAGS "-x objective-c++")
40+
41+
target_link_libraries(
42+
atomic_queue_tests_objcpp
43+
atomic_queue
44+
Boost::unit_test_framework
45+
)
46+
47+
add_test(
48+
NAME atomic_queue_tests_objcpp
49+
COMMAND atomic_queue_tests_objcpp
50+
)
51+
endif()
52+
3353
endif()

src/tests.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// For objective-c++ compatibility tests
2+
#include "atomic_queue/atomic_queue.h"
3+
#include "tests.cc"

0 commit comments

Comments
 (0)