From 33eae7df0a5e6b8a311fa57499272f19c30b0221 Mon Sep 17 00:00:00 2001 From: Leon Oostrum Date: Thu, 2 May 2024 16:46:18 +0200 Subject: [PATCH 1/2] Fix path given to ld in target_embed_source --- cmake/cudawrappers-helper.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/cudawrappers-helper.cmake b/cmake/cudawrappers-helper.cmake index 1b7ee6bc..9438f623 100644 --- a/cmake/cudawrappers-helper.cmake +++ b/cmake/cudawrappers-helper.cmake @@ -34,10 +34,14 @@ function(target_embed_source target input_file) ) inline_local_includes(${input_file_absolute} ${input_file_inlined}) # Link the input_file into an object file + string(REPLACE "${CMAKE_BINARY_DIR}/" input_file_inlined_relative + ${input_file_inlined} + ) add_custom_command( OUTPUT ${NAME}.o - COMMAND ld ARGS -r -b binary -A ${CMAKE_SYSTEM_PROCESSOR} -o - "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.o" ${input_file} + COMMAND + ld ARGS -r -b binary -A ${CMAKE_SYSTEM_PROCESSOR} -o + "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.o" ${input_file_inlined_relative} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} DEPENDS ${input_file} ${input_file_inlined} COMMENT "Creating object file for ${input_file}" From 6c1eb8879d16fc4ee770bc63e770487c3ef3aee0 Mon Sep 17 00:00:00 2001 From: Leon Oostrum Date: Thu, 2 May 2024 16:47:29 +0200 Subject: [PATCH 2/2] Fix missing arg in string replace --- cmake/cudawrappers-helper.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/cudawrappers-helper.cmake b/cmake/cudawrappers-helper.cmake index 9438f623..326563f7 100644 --- a/cmake/cudawrappers-helper.cmake +++ b/cmake/cudawrappers-helper.cmake @@ -34,7 +34,7 @@ function(target_embed_source target input_file) ) inline_local_includes(${input_file_absolute} ${input_file_inlined}) # Link the input_file into an object file - string(REPLACE "${CMAKE_BINARY_DIR}/" input_file_inlined_relative + string(REPLACE "${CMAKE_BINARY_DIR}/" "" input_file_inlined_relative ${input_file_inlined} ) add_custom_command(