使用 xcodebuild 构建 llvm 3.8 + clang-tools-extra 3.8

building llvm 3.8 + clang-tools-extra 3.8 with xcodebuild

我正在尝试构建 运行 llvm 3.8 以及 clang 和 clang-tools-extra。 我遵循的步骤是 LLVM 上的步骤,不同之处在于我使用这个 git 镜像来检查我需要什么。

所以,很快,我有:

LLVM 3.8 llvm/tools 中的铿锵声 3.8 llvm/tools 中的 Clang-tools-extra 3.8 我可以执行:

cmake -G Xcode ../llvm 在我的 'build' 文件夹中生成构建文件,但是当我开始构建 llvm 时 xcodebuild 构建失败,因为在 /Users/carlodidomenico/Thesis/git/LLVM/llvm/tools/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h

找不到

构建阶段在

停止
=== BUILD TARGET clangTidyCERTModule OF PROJECT LLVM WITH THE DEFAULT CONFIGURATION (Debug) ===

CompileC /Users/carlodidomenico/Thesis/git/LLVM/build_xcode/tools/clang-tools-extra/clang-tidy/cert/LLVM.build/Debug/clangTidyCERTModule.build/Objects-normal/x86_64/CERTTidyModule.o tools/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/carlodidomenico/Thesis/git/LLVM/llvm
    export LANG=en_US.US-ASCII
    /Applications/Xcode7.3/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=80 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wnon-virtual-dtor -Woverloaded-virtual -Wno-exit-time-destructors -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wsign-compare -Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions -DCMAKE_INTDIR=\"Debug\" -DGTEST_HAS_RTTI=0 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -isysroot /Applications/Xcode7.3/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.11 -g -Wno-sign-conversion -I/Users/carlodidomenico/Thesis/git/LLVM/build_xcode/Debug/lib/include -I/Users/carlodidomenico/Thesis/git/LLVM/build_xcode/tools/clang-tools-extra/clang-tidy/cert -I/Users/carlodidomenico/Thesis/git/LLVM/llvm/tools/clang-tools-extra/clang-tidy/cert -I/Users/carlodidomenico/Thesis/git/LLVM/build_xcode/include -I/Users/carlodidomenico/Thesis/git/LLVM/llvm/include -I/Users/carlodidomenico/Thesis/git/LLVM/build_xcode/tools/clang-tools-extra/clang-tidy/cert/LLVM.build/Debug/clangTidyCERTModule.build/DerivedSources/x86_64 -I/Users/carlodidomenico/Thesis/git/LLVM/build_xcode/tools/clang-tools-extra/clang-tidy/cert/LLVM.build/Debug/clangTidyCERTModule.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/carlodidomenico/Thesis/git/LLVM/build_xcode/Debug/lib -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -std=c++11 -fno-exceptions -fno-rtti -MMD -MT dependencies -MF /Users/carlodidomenico/Thesis/git/LLVM/build_xcode/tools/clang-tools-extra/clang-tidy/cert/LLVM.build/Debug/clangTidyCERTModule.build/Objects-normal/x86_64/CERTTidyModule.d --serialize-diagnostics /Users/carlodidomenico/Thesis/git/LLVM/build_xcode/tools/clang-tools-extra/clang-tidy/cert/LLVM.build/Debug/clangTidyCERTModule.build/Objects-normal/x86_64/CERTTidyModule.dia -c /Users/carlodidomenico/Thesis/git/LLVM/llvm/tools/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp -o /Users/carlodidomenico/Thesis/git/LLVM/build_xcode/tools/clang-tools-extra/clang-tidy/cert/LLVM.build/Debug/clangTidyCERTModule.build/Objects-normal/x86_64/CERTTidyModule.o
In file included from /Users/carlodidomenico/Thesis/git/LLVM/llvm/tools/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp:10:
In file included from /Users/carlodidomenico/Thesis/git/LLVM/llvm/tools/clang-tools-extra/clang-tidy/cert/../ClangTidy.h:13:
/Users/carlodidomenico/Thesis/git/LLVM/llvm/tools/clang-tools-extra/clang-tidy/cert/../ClangTidyDiagnosticConsumer.h:14:10: fatal error: 
      'clang/Basic/Diagnostic.h' file not found
#include "clang/Basic/Diagnostic.h"

我是不是做错了什么。似乎要遵循的步骤序列非常简单,但出了点问题。

最初我认为问题出在 "clang/Basic/Diagnostic.h" 上,所以我用 Xcode 打开了 "LLVM.xcodeproj" 本身,发现找不到 "clang/Basic/SourceManager.h" 文件并且"clang/Tooling/Refactoring.h" 也是。

似乎所有#include "clan/*" 都存在问题

为了使用 clang-tools-extra,您还需要有 clang 源。看来您没有正确准备组合源代码树。请考虑按照 http://clang.llvm.org/get_started.html

中的说明进行操作