diff --git a/sixtracklib/CMakeLists.txt b/sixtracklib/CMakeLists.txt index d65a152e..a10a9662 100644 --- a/sixtracklib/CMakeLists.txt +++ b/sixtracklib/CMakeLists.txt @@ -94,6 +94,10 @@ set_target_properties( sixtrack PROPERTIES LINKER_LANGUAGE C POSITION_INDEPENDENT_CODE ON C_STANDARD 99 DEBUG_POSTFIX d C_STANDARD_REQUIRED ON ) +if( TARGET sixtrack_cuda_device ) + set_target_properties( sixtrack PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON ) +endif() + target_compile_options( sixtrack PRIVATE ${SIXTRACKLIB_C99_FLAGS} ${SIXTRACKLIB_CPU_FLAGS} ${SIXTRACKL_C99_AUTOVEC_FLAGS} ) diff --git a/sixtracklib/cuda/CMakeLists.txt b/sixtracklib/cuda/CMakeLists.txt index 65e6cba6..231ad37b 100644 --- a/sixtracklib/cuda/CMakeLists.txt +++ b/sixtracklib/cuda/CMakeLists.txt @@ -133,14 +133,10 @@ add_library( sixtrack_cuda_device OBJECT target_compile_definitions( sixtrack_cuda_device PUBLIC ${SIXTRACKL_CUDA_DEVICE_DEFINITIONS} ) -set_target_properties( sixtrack_cuda_device PROPERTIES POSITION_INDEPENDENT_CODE ON ) -set_target_properties( sixtrack_cuda_device PROPERTIES LINKER_LANGUAGE C ) -set_target_properties( sixtrack_cuda_device PROPERTIES CXX_STANDARD 11 ) -set_target_properties( sixtrack_cuda_device PROPERTIES CXX_STANDARD_REQUIRED ON ) -set_target_properties( sixtrack_cuda_device PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) -set_target_properties( sixtrack_cuda_device PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS OFF ) -set_target_properties( sixtrack_cuda_device PROPERTIES CUDA_STANDARD 11 ) -set_target_properties( sixtrack_cuda_device PROPERTIES CUDA_STANDARD_REQUIRED 11 ) +set_target_properties( sixtrack_cuda_device PROPERTIES + POSITION_INDEPENDENT_CODE ON LINKER_LANGUAGE C CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON CUDA_SEPARABLE_COMPILATION ON + CUDA_RESOLVE_DEVICE_SYMBOLS ON CUDA_STANDARD 11 CUDA_STANDARD_REQUIRED 11 ) target_include_directories( sixtrack_cuda_device PRIVATE ${CMAKE_SOURCE_DIR} )