[cfe-dev] Visual Studio project for clang has no sources

Chris Tetreault via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 26 06:07:57 PST 2020


Aaron,

   I've struggled with the Visual Studio issue for a few months now. I gave up on using the direct CMake support long ago because I don't care to manage the CMake settings .json file and I think that in its current state, Visual Studio still works better with msbuild projects. That said, I think the issue you're seeing is the fact that Visual Studio shows the files directly under the folder you have open only. If you create a CMakeLists.txt file in the folder above the llvm folder that just does add_subdirectory(llvm), I think it ends up working. You may have to tweak it, but it was something silly like that.

   For my issue, I suspect that I am either not passing a required flag, or the build system is broken for MSVC. I seem to recall it working a few months ago.

Thanks,
   Christopher Tetreault

-----Original Message-----
From: Aaron Ballman <aaron at aaronballman.com>
Sent: Wednesday, February 26, 2020 5:59 AM
To: Chris Tetreault <ctetreau at quicinc.com>
Cc: cfe-dev at lists.llvm.org
Subject: [EXT] Re: [cfe-dev] Visual Studio project for clang has no sources

On Wed, Feb 26, 2020 at 8:38 AM Chris Tetreault via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>
> Hi,
>
>    I'm working on LLVM on Windows using the MSVC CMake generator. Most of my time is spent in LLVM itself, which works fine. Each library has a source, headers, and tablegen directory (if there are tablegen files). However, in the Clang libraries, I only have "Object Libraries", and I can't access any headers or cpp files from visual studio.
>
>    I'm wondering if anybody has encountered this issue before and knows how I might work around it.

I use MSVC to open the LLVM folder as a cmake project (so I don't execute cmake with the MSVC generator and open a solution from there), and I get similarly bad behavior (all the LLVM components show up fine in the solution explorer, but none of the other projects are there).
As best I can tell, Visual Studio doesn't handle the monorepo layout nearly as well as it handled the previous directory layout and I've not found a way to improve the situation. It's frustrating, so if others have ideas on how to make Clang development on Windows at least as good as it was before the git transition, that would be appreciated. FWIW, my CMake configuration settings are:
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_ENABLE_IDE=ON -DLLVM_OPTIMIZED_TABLEGEN=ON

~Aaron


More information about the cfe-dev mailing list