<p dir="ltr">FWIW, we use exactly the setup you outlined, for the reasons you mention: CMake build to build LLDB and dependencies, XCode for debugging and code editing. We are mostly concerned with Mac OS X/iOS but are also building for Linux that way.</p>
<p dir="ltr">From an API user perspective it's very nice to have a cross-platform build that also integrates well with CI servers.</p>
<div class="gmail_quote">On Dec 29, 2014 10:13 PM, "Zachary Turner" <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Someone jump in and correct me if I'm wrong, but I believe there are many reasons that Apple sticks with a hand-maintained Xcode project. I will try to summarize some of the reasons here:<br><br>1) People are more comfortable editing a native solution file than editing CMake. I certainly sympathize with this, as I also strongly prefer editing a Visual Studio solution over a CMake file. Before working on LLDB, I had actually never even written a line of CMake before.<br><div><br></div><div>2) The Xcode projects generated by CMake are slow, almost to the point of being unusable. This is a widespread problem with IDEs, and indeed the MSVC generator suffers from the same problem. The issue here is related to the size of the project / solutions. Every CMake target (which ultimately translates to a static library or shared library) ends up as a project in your solution (MSVC) or target in your project (Xcode). This is the layer at which dependency analysis is performed and build parallelization is implemented, so having more projects causes tremendous slowdown in loading projects/solutions and generating information for intellisense/code completion. Visual Studio has gotten much better in this regard with recent versions, but it's still an issue. And I think Xcode has <b>not</b> gotten much better in this regard. In short, an Xcode generated solution, while it will technically work, is almost unusable for performance reasons.</div><div><br></div><div>3) The Xcode projects generated by CMake aren't as pretty as hand-generated Xcode projects. It's actually possible to make prettier generated projects by adding some stuff to the CMake, but right now they just don't look as nice.</div><div><br></div><div>4) Legacy reasons (aka old habits die hard). The LLDB group at Apple has historically treated LLVM and clang as libraries, and in the past the only supported way to build LLDB was against a known revision of clang and LLVM, and only recently (well, not recent anymore, but legacy decisions can have long lasting implications) was it changed so that LLDB is expected to always build against tip of trunk LLVM / clang. One of the things that came out of this early separation was that an Xcode build of LLDB does not even use the canonical on-disk directory hierarchy that all other LLVM subprojects use. A normal LLVM directory layout looks like this:</div><div><br></div><div>llvm</div><div>-- tools</div><div>---- lldb</div><div>---- clang</div><div>---- lld</div><div><br></div><div>Since LLDB considers itself "not an LLVM subproject, but rather a standalone project which uses LLVM", it organizes itself like this:</div><div><br></div><div>lldb</div><div>-- llvm</div><div>---- tools</div><div>------ clang</div><div>------ lld</div><div><br></div><div>Of course, this is just an implementation detail, as we've shown that lldb can be built as a normal subproject on all other platforms using the first layout, but this basically boils down to "old habits die hard". It's what people are used to.</div><div><br></div><div>It's certainly easy to sympathize with numbers 1, 3, and 4 but ultimately I think (or at least hope) that people would be willing to sacrifice these for the greater good of having a unified build system. Number 2 however, is probably a showstopper though.</div><div><br></div><div>I'm not sure just how bad the Xcode solution is in terms of performance, but it's the primary reason why the the standalone build exists. The standalone build generates a much smaller project/solution, with only those projects and targets that are part of LLDB itself, and not projects from LLVM, clang, etc. It attempts to use an installed LLVM / clang instead of building one.</div><div><br></div><div>One thing that has worked very well for me on Windows is using my IDE for editing and debugging, but not for building. There's quite a lot to like about this approach. For starters, the performance of building from inside the IDE is irrelevant now, because you're not building from the IDE anymore. For Visual Studio this makes a huge difference, but I'm not sure if it makes a difference for Xcode. Another advantage of this approach is that honestly, ninja is just faster than everything else. It really is. And not a little bit, but a lot. I'm a big fan of my IDE and you will only pry it out of my cold dead hands, but after I tried ninja once or twice, it was obvious that it was a huge win over building from the IDE. All it takes me is typing "ninja" from a command shell. Even I can manage that. Everything else - debugging, code completion, editing experience, file browsing - still works. I just don't hit build from inside the IDE.</div><div><br></div><div>It would be worth seeing if an approach like this would work well with people from Apple. Or alternatively, maybe seeing if the Xcode IDE team within apple would be willing to prioritize IDE performance in the case of these larger projects. Visual Studio seems to have come a long way here, so it doesn't seem impossible for Xcode to improve here, it just has some work to do.</div><br><div class="gmail_quote">On Mon Dec 29 2014 at 12:25:20 PM Vince Harron <<a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">> <span style="font-size:13px">The main motivation for having a standalone build is that it's a necessary (but not necessarily sufficient) precursor to having a usable xcode solution, which is itself a necessary (but again perhaps not sufficient) precondition to moving towards a single build system.</span><div><span style="font-size:13px"><br></span></div></div><div dir="ltr"><div><span style="font-size:13px">I've always assumed that the reason the apple guys don't generate their xcode projects from cmake is that there is some magic in the xcode projects that isn't supported by cmake-xcode project generator. Is there any truth to that?</span></div><div><span style="font-size:13px"><br></span></div><div>What is the intended purpose of the LLDB CMake standalone build? If it is to build against an installed clang/llvm, it doesn't seem like it's worth the extra complexity...</div><div><br></div><div><span style="font-size:13px">Vince</span></div><div><span style="font-size:13px"><br></span></div></div><div class="gmail_extra"></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 28, 2014 at 9:15 AM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm not using the standalone build on Windows, i just suffer through opening a mega solution. Reid did some work recently to make it better, but it still doesn't totally support anyone's needs. <br><br>The main motivation for having a standalone build is that it's a necessary (but not necessarily sufficient) precursor to having a usable xcode solution, which is itself a necessary (but again perhaps not sufficient) precondition to moving towards a single build system.<br><br>I'm not versed enough in the LLVM core shared CMake infrastructure, but I envision a world where supporting a standalone build requires almost 0 project specific CMake code. Sadly, achieving that seems quite difficult <br><div class="gmail_quote"><div><div>On Sun, Dec 28, 2014 at 7:22 AM Chandler Carruth <<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">I thought that Zach was on Windows, but I would be surprised as I can't get it to work with an installed Clang. It errors in the cmake step, unable to find some cmake module.<div><br></div><div>Is anyone genuinely trying to support this CMake configuration? It adds quite a bit of complexity. If so, could they fix this error or suggest how to fix it on the Clang side? (I help maintain the Clang cmake build, so I'm happy to enact any reasonable changes needed...)</div><div><br></div><div>This came up because I have a change to the LLDB CMake build but am currently unable to test it in a fully standalone build (IE, w/o a source tree).</div><div><br></div><div>-Chandler</div></div></div></div><span>
______________________________<u></u><u></u>_________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailm<u></u>an/listinfo/lldb-dev</a><br>
</span></blockquote></div>
<br>______________________________<u></u>_________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/lldb-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div><div class="gmail_extra">-- <br><div><div dir="ltr"><br><table cellspacing="0" cellpadding="0" style="font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Vince Harron |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Technical Lead Manager |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> <a href="tel:858-442-0868" value="+18584420868" target="_blank">858-442-0868</a></td></tr></tbody></table><br></div></div>
</div></blockquote></div>
<br>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br></blockquote></div>