Skip to content

Commit 0d04713

Browse files
authored
Update depfile generation for device compiler
Ninja has a problem if the name of the object doesn't match what it expects, so this changes the generation to output a relative path, not an absolute one. Additionally, the quotes in the optional DEPFILE variable were causing problems, so they have also been removed. Many thanks to @jwlawson for finding and fixing this.
1 parent a9db659 commit 0d04713

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmake/Modules/FindComputeCpp.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,9 @@ function(__build_ir)
286286
# CMake throws an error if it is unsupported by the generator (i. e. not ninja)
287287
if((NOT CMAKE_VERSION VERSION_LESS 3.7.0) AND
288288
CMAKE_GENERATOR MATCHES "Ninja")
289-
set(generate_depfile -MMD -MF ${depFileName})
290-
set(enable_depfile "DEPFILE ${depFileName}")
289+
file(RELATIVE_PATH relOutputFile ${CMAKE_BINARY_DIR} ${outputSyclFile})
290+
set(generate_depfile -MMD -MF ${depFileName} -MT ${relOutputFile})
291+
set(enable_depfile DEPFILE ${depFileName})
291292
endif()
292293

293294
# Add custom command for running compute++

0 commit comments

Comments
 (0)