You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: definition of macro 'VCXPROJ_DIR' differs between the precompiled header ('L"D:\\src\\path\\to\\some\\project"')
and the command line ('L"D:\src\path\to\some\project"') [clang-diagnostic-error]
What I tried
First, am I correct to assume that the escaped backslashes in our generated .vcxproj are not the problem? I tried adding a -replace "\\", "\\" in Get-ProjectPreprocessorDefines, which didn't help:
error: definition of macro 'VCXPROJ_DIR' differs between the precompiled header ('L"D:\\\\src\\\\path\\\\to\\\\some\\\\project"')
and the command line ('L"D:\\\src\\\path\\\to\\\some\\\project"') [clang-diagnostic-error]
Then I tried removing the double backslashes, i.e. -replace "\\\\", "\". That seemed to work, but somehow I doubt that this is the real solution: Wouldn't we want to preserve the ecape sequences as is? Does the Clang(++) handle these escapes differently than CL? Can the PCH be fixed so that both contain the escaped backslashes?
The text was updated successfully, but these errors were encountered:
When I the run a tool that uses this compilation database (e.g. clang-rename), clang complains:
In file included from <built-in>:444:
<command line>:14:23: warning: missing terminating '"' character [-Winvalid-pp-token]
14 | #define VCXPROJ_DIR L/"
| ^
Should I create a separate issue, or are they related enough?
Similar to #410, and maybe related to bdd86b8 and 5a46525.
Problem
Some of the
<PreprocessorDefinitions>
generated by our custom build tool contain escaped backslashes, e.g.[...];VCXPROJ_DIR=L"D:\\src\\path\\to\\some\\project";[...]
The corresponding clang++ parameter generated by
clang-build.ps1
looks like this (from verbose output):INVOKE: C:\Program Files\LLVM\bin\clang++.exe [...] "-DVCXPROJ_DIR=L\"D:\\src\\path\\to\\some\\project\"" [...]
.Clang then produces the following error:
What I tried
First, am I correct to assume that the escaped backslashes in our generated .vcxproj are not the problem? I tried adding a
-replace "\\", "\\"
in Get-ProjectPreprocessorDefines, which didn't help:Then I tried removing the double backslashes, i.e.
-replace "\\\\", "\"
. That seemed to work, but somehow I doubt that this is the real solution: Wouldn't we want to preserve the ecape sequences as is? Does the Clang(++) handle these escapes differently than CL? Can the PCH be fixed so that both contain the escaped backslashes?The text was updated successfully, but these errors were encountered: