diff options
author | Raul Tambre <raul@tambre.ee> | 2020-03-12 12:00:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-04-07 13:33:25 (GMT) |
commit | 60e60b9201f832206324542457e04ce2f7e0afd6 (patch) | |
tree | 7096503df295f3e6a1c60c78584d816246eb2e06 /Modules/Compiler | |
parent | 5f02add366f1fb3d952e88df15252945b5fed9b2 (diff) | |
download | CMake-60e60b9201f832206324542457e04ce2f7e0afd6.zip CMake-60e60b9201f832206324542457e04ce2f7e0afd6.tar.gz CMake-60e60b9201f832206324542457e04ce2f7e0afd6.tar.bz2 |
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.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/GNU.cmake | 3 |
1 files changed, 2 insertions, 1 deletions
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. |