From 60e60b9201f832206324542457e04ce2f7e0afd6 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Thu, 12 Mar 2020 14:00:00 +0200 Subject: GNU: Disable depfiles in try-compile mode only for GCC Disabling them causes issues for Clang's CUDA frontend. Since this is a GCC bug, simply check for GCC. --- Modules/Compiler/GNU.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index 3357a86..df6d6b8 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -44,7 +44,8 @@ macro(__compiler_gnu lang) # tests to always succeed. Work around this by disabling dependency tracking # in try_compile mode. get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE) - if(NOT _IN_TC OR CMAKE_FORCE_DEPFILES) + if(CMAKE_${lang}_COMPILER_ID STREQUAL "GNU" AND _IN_TC AND NOT CMAKE_FORCE_DEPFILES) + else() # distcc does not transform -o to -MT when invoking the preprocessor # internally, as it ought to. Work around this bug by setting -MT here # even though it isn't strictly necessary. -- cgit v0.12