VS: cmake with --trace-expand crashes if CUDA is enabled for the project
Hi! I'm trying to debug an issue in CMake project, but it turned out that my debug capabilities are quite limited as --trace-expand doesn't work if CUDA is enabled. Environment: Windows 10, MSVC 2017, CUDA 10.2, CMake 3.17 (reproduced on master 91f0f4aa as well) CMakeList.txt
cmake_minimum_required(VERSION 3.17)
project(test VERSION 1.0 LANGUAGES CUDA)
I am launching this by
cmake -A x64 -T cuda=10.2,host=x64 --trace-expand --trace-redirect=<some log> -B <build dir> .
But this call quickly stops with
Running with expanded trace output on.
Trace will be written to 10.txt
Trace will be written to 10.txt
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19041.
CMake Error at D:/work/3pp/cmake/Modules/CMakeDetermineCompilerId.cmake:440 (string):
Syntax error in cmake code when parsing string
<Import Project="$(VCTargetsPath)\BuildCustomizations\
Invalid character escape '\B'.
Call Stack (most recent call first):
D:/work/3pp/cmake/Modules/CMakeDetermineCompilerId.cmake:34 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
D:/work/3pp/cmake/Modules/CMakeDetermineCUDACompiler.cmake:266 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "D:/work/example/10/CMakeFiles/CMakeOutput.log".
This is already minimized CMakeLists.txt, If CUDA is not used (other language is used in project is CXX, but I removed it from here for simplicity) then everything works fine. Just --trace works fine, but doesn't provide me enough info. Are there maybe any known workarounds?
Edited by Brad King