Skip to content

Commit 545e0fb

Browse files
committed
HPX runtime workaround for tests
1 parent d296825 commit 545e0fb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/plssvm/backends/HPX/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set(PLSSVM_HPX_SOURCES
4040
# set target properties
4141
set_local_and_parent(PLSSVM_HPX_BACKEND_LIBRARY_NAME plssvm-HPX)
4242
add_library(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} SHARED ${PLSSVM_HPX_SOURCES})
43-
target_link_libraries(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PUBLIC HPX::hpx)
43+
target_link_libraries(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PUBLIC HPX::hpx HPX::wrap_main)
4444

4545
# additional compilation flags
4646
target_compile_options(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,GNU,Clang>:-Wconversion>)

tests/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515

1616
#include <cstdlib> // std::atexit
1717

18+
#if defined(PLSSVM_HAS_HPX_BACKEND)
19+
// Workaround as Scope Guard not working properly with Google Test
20+
// Run the entire main function in HPX rutime
21+
#include <hpx/hpx_main.hpp>
22+
#endif
23+
1824
// silence GTest warnings/test errors
1925

2026
// generic CSVM tests

0 commit comments

Comments
 (0)