llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.64k stars 11.37k forks source link

VisualStudio projects always out of date using clang-cl toolset integration #36535

Open llvmbot opened 6 years ago

llvmbot commented 6 years ago
Bugzilla Link 37187
Version 6.0
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @zmodem,@rnk

Extended Description

Issue observed using LLVM 6.0 x64 toolchain (<llvm_insall_dir>/msbuild-bin/cl.exe) with Visual Studio 14 (and Visual Studio 15 using a manual toolset integration),

MSVS default compiler options include flag for specifying location of .pdb file for libraries. clang-cl silently ignores this switch and embeds intermediate debug data in obj files instead of producing a single separate pdb for the entire library. (not an issue - debugging works fine)

Projects always appear out of date due to msbuild expecting a pdb file and not finding one.

This can be remedied by modifying the toolset-vs20XX.props file used for MSVS/MSBuild integration:

Under the compile options add a tag to clear the pdb filename option

<ItemDefinitionGroup>
  <ClCompile>
    ...
    <!-- clang-cl embeds debug data in obj files. does not generate pdb per lib. if option not cleared projects will always appear out of date to MSVS. -->
    <ProgramDataBaseFileName/> 
  </ClCompile>
</ItemDefinitionGroup>
rnk commented 5 years ago

Re-discovered and posted about here: http://lists.llvm.org/pipermail/llvm-dev/2019-January/129589.html

zmodem commented 6 years ago

This is the same problem discussed in llvm/llvm-project#35488 #c6

The workaround of setting an empty ProgramDataBaseFileName is new though.

llvmbot commented 6 years ago

Does the new VS integration (did we land it yet?) fix this?

Latest 7.0 snapshot does not appear to have 2017 integration

rnk commented 6 years ago

Does the new VS integration (did we land it yet?) fix this?