<div dir="ltr">If I execute the following command from the <b>build directory</b> (llvm-project/build) <div><br></div><div><i>cmake -G Ninja ../llvm/tools/llc <br></i></div><div><br></div><div>then I am getting the following error </div><div><br></div><div><i>CMake Error: The source "/Users/jagratpatkar/Desktop/ComputerScience/llvm-project/llvm/tools/llc/CMakeLists.txt" does not match the source "/Users/jagratpatkar/Desktop/ComputerScience/llvm-project/llvm/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.</i><br></div><div><br></div><div>Thanks!</div><div>Jagrat Patkar.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 2, 2020 at 5:55 PM Tim Northover <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.com</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">On Wed, 2 Dec 2020 at 02:09, Jagrat Patkar <<a href="mailto:jagratpatkar@gmail.com" target="_blank">jagratpatkar@gmail.com</a>> wrote:<br>
> I tried this out inside llvm-project/build<br>
> cmake -G Ninja  tools/lli<br>
> cmake -G Ninja  tools/llc<br>
><br>
> but none of it worked, although the subdirectories do exist under the  llvm-project/build/tools/llc or lli<br>
<br>
Yep, those two are never going to work. The CMakeLists.txt in those<br>
directories aren't self-contained.<br>
<br>
> cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lli;llc" ../llvm  this command which resulted in the build directory getting loaded with many subdirectories including tools directory containing lli and llc. But still it didn't enable lli and llc even after mentioning it in the ENABLE_PROJECTS flag<br>
<br>
You don't need lli or llc in LLVM_ENABLE_PROJECTS because they're part<br>
of baseline LLVM. But other than that it should have worked. What<br>
error message did you get when you tried running "ninja llc" after<br>
that CMake command?<br>
<br>
Cheers.<br>
<br>
Tim.<br>
</blockquote></div>