<div dir="ltr">It looks like you are trying to use the so-called "standalone" clang build, but you checked out clang into llvm/tools/clang. You only need to put clang sources in llvm/tools/clang if you want it to be part of the LLVM build. If you move the sources out to somewhere alongside the llvm sources, the standalone build will probably work. I did this with VS a few weeks ago.<div><br></div><div>Also, you probably want to delete your initial llvm build directory before retrying, because it will probably contain variables defined by clang's cmake that shouldn't be there.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 24, 2014 at 10:07 AM, Nat! <span dir="ltr"><<a href="mailto:nat@mulle-kybernetik.com" target="_blank">nat@mulle-kybernetik.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
as a clang newbie, I used the „Getting Started“ (<a href="http://clang.llvm.org/get_started.html" target="_blank">http://clang.llvm.org/get_started.html</a>)  documentation and I could build everything nicely using cmake. I was also able to create a LLVM.xcodeproj file. But that project is huge.<br>
<br>
Judging from an older blog entry (<a href="http://www.stuartcarnie.com/2012/06/llvm-clang-hacking-part-1.html" target="_blank">http://www.stuartcarnie.com/2012/06/llvm-clang-hacking-part-1.html</a>), it should also be possible to just create a clang.xcodeproj file, which would be much preferable to me, but I can’t get it to work.<br>
<br>
I set this environment variables to get llvm-config to be found<br>
<br>
PATH=`pwd`/build/bin:`pwd`/build/tools:$PATH<br>
export PATH<br>
<br>
But then I get<br>
<br>
walitza:clang nat$ cmake -DCLANG_PATH_TO_LLVM_SOURCE=../llvm -DCLANG_PATH_TO_LLVM_BUILD=../build -DCMAKE_BUILD_TYPE=Debug ../llvm/tools/clang<br>
-- Found LLVM_CONFIG as /Volumes/Source/srcM/clang-test/build/bin/llvm-config<br>
-- Building with -fPIC<br>
-- Clang version: 3.6.0<br>
CMake Error at /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/AddLLVM.cmake:438 (add_executable):<br>
  add_executable cannot create target "clang-tblgen" because an imported<br>
  target with the same name already exists.<br>
Call Stack (most recent call first):<br>
  /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/AddLLVM.cmake:501 (add_llvm_executable)<br>
  /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/TableGen.cmake:76 (add_llvm_utility)<br>
  utils/TableGen/CMakeLists.txt:3 (add_tablegen)<br>
<br>
<br>
CMake Error at /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/LLVM-Config.cmake:49 (target_link_libraries):<br>
  Cannot specify link libraries for target "clang-tblgen" which is not built<br>
  by this project.<br>
Call Stack (most recent call first):<br>
  /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/LLVM-Config.cmake:34 (explicit_llvm_config)<br>
  /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/AddLLVM.cmake:455 (llvm_config)<br>
  /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/AddLLVM.cmake:501 (add_llvm_executable)<br>
  /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/TableGen.cmake:76 (add_llvm_utility)<br>
  utils/TableGen/CMakeLists.txt:3 (add_tablegen)<br>
<br>
<br>
-- Configuring incomplete, errors occurred!<br>
See also "/Volumes/Source/srcM/clang-test/clang/CMakeFiles/CMakeOutput.log".<br>
See also "/Volumes/Source/srcM/clang-test/clang/CMakeFiles/CMakeError.log“.<br>
<br>
Doesn’t that work anymore ?<br>
<br>
Ciao<br>
   Nat!<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>