From 545e0fbca4eede822461bb81200d255b0b4dd2f2 Mon Sep 17 00:00:00 2001 From: constracktor Date: Tue, 19 Nov 2024 11:27:40 +0100 Subject: [PATCH] HPX runtime workaround for tests --- src/plssvm/backends/HPX/CMakeLists.txt | 2 +- tests/main.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plssvm/backends/HPX/CMakeLists.txt b/src/plssvm/backends/HPX/CMakeLists.txt index 8ebde5e46..066e364ea 100644 --- a/src/plssvm/backends/HPX/CMakeLists.txt +++ b/src/plssvm/backends/HPX/CMakeLists.txt @@ -40,7 +40,7 @@ set(PLSSVM_HPX_SOURCES # set target properties set_local_and_parent(PLSSVM_HPX_BACKEND_LIBRARY_NAME plssvm-HPX) add_library(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} SHARED ${PLSSVM_HPX_SOURCES}) -target_link_libraries(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PUBLIC HPX::hpx) +target_link_libraries(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PUBLIC HPX::hpx HPX::wrap_main) # additional compilation flags target_compile_options(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PRIVATE $<$:-Wconversion>) diff --git a/tests/main.cpp b/tests/main.cpp index 1fc7b9aab..76a00808c 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -15,6 +15,12 @@ #include // std::atexit +#if defined(PLSSVM_HAS_HPX_BACKEND) + // Workaround as Scope Guard not working properly with Google Test + // Run the entire main function in HPX rutime + #include +#endif + // silence GTest warnings/test errors // generic CSVM tests