<div dir="ltr">I have separate build directories Ninja Debug and Ninja Release and another "build" directory for Visual Studio.<div><br></div><div><div>

I build in a Ninja directory.  I never build in Visual Studio.  My Visual Studio directory is exclusively for project and solution files to make navigating through the code work well in the IDE.</div><div><br></div><div>To debug in Visual Studio, I open the project properties for the executable I want to debug and point at the appropriate executable in one of the Ninja directories.  

Occasionally, it's worth regenerating the VS projects and solutions to account for new, moved, and removed files.  But then you have to remember to update the project properties again.<br></div><div><br></div><div>I have a stupid batch file that lets me (re)create any of my build directories and runs Cmake with the appropriate generators.  <br></div><div><br></div><div></div><div>A "Visual Studio command prompt" is just a normal command prompt that has executed `vcvarsall.bat`.  That batch file adds a ridiculous number of things to PATH and other environment variables--almost certainly more than is necessary--but I haven't bothered to figure which bits can be eliminated.  I made two shortcuts for launching command prompts that set up their environment (which includes calling vcvarsall.bat) for one particular type of build.</div></div><div><br></div><div>So my general pattern is to browse and edit in Visual Studio, save all, run ninja in one of my customized command prompts, debug in Visual Studio, repeat.  I have yet another command prompt set up for git.</div><div><br></div><div>There are probably lots of ways to handle LLVM on Windows with Visual Studio.  Some of those may be better than mine, but mine has worked well for me for a while.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 10, 2020 at 3:05 AM Andrzej Warzynski via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On 09/08/2020 16:00, Paul C. Anagnostopoulos via llvm-dev wrote:<br>
<br>
> <br>
> 1. Building with Visual Studio created build/release/bin. Building with Ninja created build/bin (no release directory). Does that make sense? (I have -DCMAKE_BUILD_TYPE=Release on the cmake command.)<br>
> <br>
<br>
Yes. CMake's Visual Studio generators are multiconfig, which means that <br>
you specify the build type (Release vs Debug etc) when _building_. <br>
Ninja, by default, is single-config (i.e. you specify build type when <br>
_configuring_ with CMake).<br>
<br>
You can check your generator via CMake's GENERETOR_IS_MULTICONFIG <br>
(<a href="https://cmake.org/cmake/help/v3.18/prop_gbl/GENERATOR_IS_MULTI_CONFIG.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.18/prop_gbl/GENERATOR_IS_MULTI_CONFIG.html</a>). <br>
Also, recently CMake added support for multi-config builds for Ninja: <br>
<a href="https://cmake.org/cmake/help/v3.18/generator/Ninja%20Multi-Config.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.18/generator/Ninja%20Multi-Config.html</a><br>
<br>
-Andrzej<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>