From 0efc3ab387eed41aac461fd11751b7e2300406f6 Mon Sep 17 00:00:00 2001 From: ultimatile Date: Thu, 20 Nov 2025 02:57:03 +0900 Subject: [PATCH] Use TARGET_DIRECTORY for Kron.cpp CUDA property --- src/linalg/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/linalg/CMakeLists.txt b/src/linalg/CMakeLists.txt index c0187725a..8b94a3aff 100644 --- a/src/linalg/CMakeLists.txt +++ b/src/linalg/CMakeLists.txt @@ -1,7 +1,8 @@ -# This must be before the target_sources_local(), so that the target is added as CUDA +# Set Kron.cpp to compile with CUDA compiler when USE_CUDA is enabled +# Use TARGET_DIRECTORY to explicitly specify the target scope (requires CMake 3.18+) if(USE_CUDA) - set_source_files_properties(Kron.cpp DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTIES LANGUAGE CUDA) + set_source_files_properties(Kron.cpp TARGET_DIRECTORY cytnx PROPERTIES LANGUAGE CUDA) endif() target_sources_local(cytnx