diff --git a/CMake/Sanitizers.cmake b/CMake/Sanitizers.cmake index dedb07037f3598c6a141b0d6be54b306a0a754c8..dbb3bc12caf466fc6250fcc955ab0e477353644e 100644 --- a/CMake/Sanitizers.cmake +++ b/CMake/Sanitizers.cmake @@ -49,7 +49,11 @@ function(enable_sanitizers project_name) "") message(STATUS "Enabling sanitizers: ${LIST_OF_SANITIZERS}") target_compile_options(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS}) - target_link_options(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS}) + + # From cmake 3.18 the LINK_OPTIONS and INTERFACE_LINK_OPTIONS target properties are now used for the device link step + # https://cmake.org/cmake/help/latest/release/3.18.html + # Thats why we are using a generator expression to only add the sanitizers to the host link step. + target_link_options(${project_name} INTERFACE "$<HOST_LINK:-fsanitize=$<JOIN:${LIST_OF_SANITIZERS},;>>") endif() endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 813ba06002533a750618555cd8447f5ccf5f097b..688673f5323b20ca6927e058ebfd76734da3c004 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,9 +29,6 @@ cmake_minimum_required(VERSION 3.20 FATAL_ERROR) -# https://git.rz.tu-bs.de/irmb/VirtualFluids_dev/-/issues/154 -cmake_policy(SET CMP0105 OLD) - project( VirtualFluids VERSION 0.1.0