From d4245b0683f832bd85266cf0d397e7a1f34be6e8 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 22 Nov 2024 10:57:59 +0100 Subject: [PATCH] Don't use PROJECT_SOURCE_DIR in toolchains The key `PROJECT_SOURCE_DIR` refers to the wrong directory when a toolchain is used in a project such as `voicexx`. Using `CMAKE_CURRENT_LIST_DIR` fixes the problem. See merge request gysela-developpers/gyselalibxx!781 -------------------------------------------- --- toolchains/a100.leonardo.spack/toolchain.cmake | 2 +- toolchains/v100.persee/debug_toolchain.cmake | 2 +- toolchains/v100.persee/toolchain.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchains/a100.leonardo.spack/toolchain.cmake b/toolchains/a100.leonardo.spack/toolchain.cmake index f2cf93bd6..412b02b89 100644 --- a/toolchains/a100.leonardo.spack/toolchain.cmake +++ b/toolchains/a100.leonardo.spack/toolchain.cmake @@ -5,7 +5,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/../cicd_default_toolchain.cmake) set(CMAKE_BUILD_TYPE Release) # Compiler options -set(CMAKE_CXX_COMPILER ${PROJECT_SOURCE_DIR}/vendor/kokkos/bin/nvcc_wrapper) +set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_LIST_DIR}/../../vendor/kokkos/bin/nvcc_wrapper) set(CMAKE_CXX_FLAGS "-Wall -Wno-sign-compare --Werror cross-execution-space-call -Xcudafe --diag_suppress=unsigned_compare_with_zero -Xcudafe --diag_suppress=integer_sign_change") # Gyselalibxx options diff --git a/toolchains/v100.persee/debug_toolchain.cmake b/toolchains/v100.persee/debug_toolchain.cmake index 3af06ac7d..a8693ba77 100644 --- a/toolchains/v100.persee/debug_toolchain.cmake +++ b/toolchains/v100.persee/debug_toolchain.cmake @@ -5,7 +5,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/../cicd_default_toolchain.cmake) set(CMAKE_BUILD_TYPE Debug) # Compiler options -set(CMAKE_CXX_COMPILER ${PROJECT_SOURCE_DIR}/vendor/kokkos/bin/nvcc_wrapper) +set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_LIST_DIR}/../../vendor/kokkos/bin/nvcc_wrapper) set(CMAKE_CXX_FLAGS "-g -Wall -Werror -Wno-sign-compare -Xcudafe --diag_suppress=unsigned_compare_with_zero -Xcudafe --diag_suppress=integer_sign_change") # Kokkos options diff --git a/toolchains/v100.persee/toolchain.cmake b/toolchains/v100.persee/toolchain.cmake index f4d8a4014..4d60bb7fc 100644 --- a/toolchains/v100.persee/toolchain.cmake +++ b/toolchains/v100.persee/toolchain.cmake @@ -5,7 +5,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/../cicd_default_toolchain.cmake) set(CMAKE_BUILD_TYPE Release) # Compiler options -set(CMAKE_CXX_COMPILER ${PROJECT_SOURCE_DIR}/vendor/kokkos/bin/nvcc_wrapper) +set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_LIST_DIR}/../../vendor/kokkos/bin/nvcc_wrapper) set(CMAKE_CXX_FLAGS "-Wall -Wno-sign-compare --Werror cross-execution-space-call -Xcudafe --diag_suppress=unsigned_compare_with_zero -Xcudafe --diag_suppress=integer_sign_change") # Gyselalibxx options