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

Nat! nat at mulle-kybernetik.com
Mon Nov 24 10:07:45 PST 2014


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!





More information about the cfe-dev mailing list