Unable to build clang project using Xcode 10.2.1 on MACOS MOJAVE 10.14.4
I want to build and debug clang project on xcode. I could able to build it using command line MakeFile build system but not on Xcode. I am seeing link error on Xcode as below clang: error: no such file or directory: '/Users/srinivas/Work/clang/llvm-project/build/Debug/lib/libclangBasic.a'
I followed below steps:
- git clone https://github.com/llvm/llvm-project.git
- mkdir build && cd build
- cmake -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD="X86" -G "Xcode" ../llvm
- open LLVM.xcodeproj
- select 'clang' scheme from available schemes.
- build
error:
Ld /Users/srinivas/Work/clang/llvm-project/build/Debug/bin/clang-offload-bundler normal x86_64 cd /Users/srinivas/Work/clang/llvm-project/llvm export MACOSX_DEPLOYMENT_TARGET=10.14 clang: error: no such file or directory: '/Users/srinivas/Work/clang/llvm-project/build/Debug/lib/libclangBasic.a'
I don't see any of libclang* libraries getting generated in build/Debug/lib directory while building but I see lot of libLLVM* libraries getting generated.
I tried uninstalling and installing Xcode and LLVM sources multiple times and cleaning cache every time.
I tried setting 'Build Active Architectures Only' to 'No' also in build settings.
I tried from command line also xcodebuild -project LLVM.xcodeproj -scheme clang -arch=X86 -sdk "macOS 10.14"
But I couldn't get rid of these errors.
Please note that I could able to build successfully using Unix Make files build system cmake -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD="X86" -G "Unix Makefiles" ../llvm && make This is successful. I see only issue with building on Xcode
Am I missing some thing (or) could you please point me to right resources for the steps to be followed.