From 0f88b7a5924bbb37239ebb8399096cf9ebb6b7f0 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sun, 7 Jun 2020 15:26:42 +0300 Subject: CUDA: Fix Clang depfile flags when simulating MSVC __compiler_clang() doesn't call __compiler_gnu() if we're emulating MSVC. Thus CMAKE_DEPFILE_FLAGS_CUDA remains unset and compiling doesn't work, due to NVCC dependency injection workaround in CMakeCUDAInformation.cmake, which triggers for Ninja if they're not set. Always set the depfile flags to fix this. Most other compiler modules seem to do the same. --- Modules/Compiler/Clang-CUDA.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/Compiler/Clang-CUDA.cmake b/Modules/Compiler/Clang-CUDA.cmake index a970985..336827b 100644 --- a/Modules/Compiler/Clang-CUDA.cmake +++ b/Modules/Compiler/Clang-CUDA.cmake @@ -1,6 +1,9 @@ include(Compiler/Clang) __compiler_clang(CUDA) +# Set explicitly, because __compiler_clang() doesn't set this if we're simulating MSVC. +set(CMAKE_DEPFILE_FLAGS_CUDA "-MD -MT -MF ") + # C++03 isn't supported for CXX, but is for CUDA, so we need to set these manually. # Do this before __compiler_clang_cxx_standards() since that adds the feature. set(CMAKE_CUDA03_STANDARD_COMPILE_OPTION "-std=c++03") -- cgit v0.12