[cfe-dev] Using Xcode to compile clang, still possible ?

Reid Kleckner rnk at google.com
Mon Nov 24 10:57:15 PST 2014


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.

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.

On Mon, Nov 24, 2014 at 10:07 AM, Nat! <nat at mulle-kybernetik.com> wrote:

> Hi
>
> as a clang newbie, I used the „Getting Started“ (
> http://clang.llvm.org/get_started.html)  documentation and I could build
> everything nicely using cmake. I was also able to create a LLVM.xcodeproj
> file. But that project is huge.
>
> Judging from an older blog entry (
> http://www.stuartcarnie.com/2012/06/llvm-clang-hacking-part-1.html), 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.
>
> I set this environment variables to get llvm-config to be found
>
> PATH=`pwd`/build/bin:`pwd`/build/tools:$PATH
> export PATH
>
> But then I get
>
> walitza:clang nat$ cmake -DCLANG_PATH_TO_LLVM_SOURCE=../llvm
> -DCLANG_PATH_TO_LLVM_BUILD=../build -DCMAKE_BUILD_TYPE=Debug
> ../llvm/tools/clang
> -- Found LLVM_CONFIG as
> /Volumes/Source/srcM/clang-test/build/bin/llvm-config
> -- Building with -fPIC
> -- Clang version: 3.6.0
> CMake Error at
> /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/AddLLVM.cmake:438
> (add_executable):
>   add_executable cannot create target "clang-tblgen" because an imported
>   target with the same name already exists.
> Call Stack (most recent call first):
>   /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/AddLLVM.cmake:501
> (add_llvm_executable)
>   /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/TableGen.cmake:76
> (add_llvm_utility)
>   utils/TableGen/CMakeLists.txt:3 (add_tablegen)
>
>
> CMake Error at
> /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/LLVM-Config.cmake:49
> (target_link_libraries):
>   Cannot specify link libraries for target "clang-tblgen" which is not
> built
>   by this project.
> Call Stack (most recent call first):
>
> /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/LLVM-Config.cmake:34
> (explicit_llvm_config)
>   /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/AddLLVM.cmake:455
> (llvm_config)
>   /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/AddLLVM.cmake:501
> (add_llvm_executable)
>   /Volumes/Source/srcM/clang-test/build/share/llvm/cmake/TableGen.cmake:76
> (add_llvm_utility)
>   utils/TableGen/CMakeLists.txt:3 (add_tablegen)
>
>
> -- Configuring incomplete, errors occurred!
> See also
> "/Volumes/Source/srcM/clang-test/clang/CMakeFiles/CMakeOutput.log".
> See also "/Volumes/Source/srcM/clang-test/clang/CMakeFiles/CMakeError.log“.
>
> Doesn’t that work anymore ?
>
> Ciao
>    Nat!
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141124/62bee352/attachment.html>


More information about the cfe-dev mailing list