Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f078f0c

Browse files
committedDec 5, 2022
Update implicit dependence on headers
1 parent 44bf567 commit f078f0c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed
 

‎cmake/Modules/FindComputeCpp.cmake

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,15 @@ function(__build_ir)
403403

404404
# Depfile support was only added in CMake 3.7
405405
# CMake throws an error if it is unsupported by the generator (i. e. not ninja)
406-
if((NOT CMAKE_VERSION VERSION_LESS 3.7.0) AND
407-
CMAKE_GENERATOR MATCHES "Ninja")
406+
if(((NOT CMAKE_VERSION VERSION_LESS 3.7.0) AND CMAKE_GENERATOR MATCHES "Ninja") OR
407+
((NOT CMAKE_VERSION VERSION_LESS 3.17.0) AND CMAKE_GENERATOR MATCHES "Ninja Multi-Config") OR
408+
((NOT CMAKE_VERSION VERSION_LESS 3.20.0) AND CMAKE_GENERATOR MATCHES "Make")
409+
)
408410
file(RELATIVE_PATH relOutputFile ${CMAKE_BINARY_DIR} ${outputDeviceFile})
409411
set(generate_depfile -MMD -MF ${depFileName} -MT ${relOutputFile})
410-
set(enable_depfile DEPFILE ${depFileName})
412+
set(depfile_arg DEPFILE ${depFileName})
413+
else()
414+
set(implicit_depends_arg IMPLICIT_DEPENDS CXX ${ARG_SOURCE})
411415
endif()
412416

413417
# Add custom command for running compute++
@@ -423,8 +427,8 @@ function(__build_ir)
423427
${generate_depfile}
424428
COMMAND_EXPAND_LISTS
425429
DEPENDS ${ir_dependencies}
426-
IMPLICIT_DEPENDS CXX ${ARG_SOURCE}
427-
${enable_depfile}
430+
${implicit_depends_arg}
431+
${depfile_arg}
428432
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
429433
COMMENT "Building ComputeCpp integration header file ${outputSyclFile}")
430434

0 commit comments

Comments
 (0)
This repository has been archived.