From e99a428decca8a309904cf9e375f422f778e7d3a Mon Sep 17 00:00:00 2001 From: jpekkila Date: Thu, 5 Dec 2019 15:30:48 +0200 Subject: [PATCH] OpenMP is now properly linked with the standalone without propagating it to nvcc (which would cause an error) --- src/standalone/CMakeLists.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/standalone/CMakeLists.txt b/src/standalone/CMakeLists.txt index 327ddcf..88d727b 100644 --- a/src/standalone/CMakeLists.txt +++ b/src/standalone/CMakeLists.txt @@ -20,13 +20,10 @@ if (BUILD_RT_VISUALIZATION) link_directories(${SDL2_LIBRARY_DIR}) endif () -## Compilation flags -add_compile_options(-pipe ${OpenMP_CXX_FLAGS}) -add_compile_options(-Wall -Wextra -Werror -Wdouble-promotion -Wfloat-conversion -Wshadow) - -## Compile and link +# Compile and link add_library(astaroth_standalone STATIC ${SOURCES}) -target_link_libraries(astaroth_standalone PRIVATE astaroth_core "${OpenMP_CXX_FLAGS}" ${SDL2_LIBRARY}) +target_link_libraries(astaroth_standalone PRIVATE OpenMP::OpenMP_CXX astaroth_core ${SDL2_LIBRARY}) +target_compile_options(astaroth_standalone PRIVATE -pipe -Wall -Wextra -Werror -Wdouble-promotion -Wfloat-conversion -Wshadow) add_executable(ac_run main.cc) target_link_libraries(ac_run PRIVATE astaroth_standalone)