Skip to content

Instantly share code, notes, and snippets.

@koko1000ban
Created June 15, 2011 16:09
Show Gist options
  • Save koko1000ban/1027429 to your computer and use it in GitHub Desktop.
Save koko1000ban/1027429 to your computer and use it in GitHub Desktop.
build pch-header and use it with clang-completion on osx10.6.7 clang(tags/Apple/clang-139)
build cxx pch-header
% clang -cc1 -triple x86_64-apple-darwin10 -emit-pch -disable-free -disable-llvm-verifier -main-file-name pchheader.h \
-pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 123.2 \
-resource-dir /Developer/usr/bin/../lib/clang/2.0 -ferror-limit 19 -fmessage-length 171 -stack-protector 1 \
-fblocks -fdiagnostics-show-option -fcolor-diagnostics -o /path/to/pchheader-nu.pch -x c++-header /path/to/pchheader.h
use it
% clang -cc1 -triple x86_64-apple-darwin10 -emit-pch -disable-free -disable-llvm-verifier -pic-level 1 -mdisable-fp-elim \
-masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 123.2 -resource-dir /Developer/usr/bin/../lib/clang/2.0 \
-ferror-limit 19 -fmessage-length 171 -stack-protector 1 -fblocks -fdiagnostics-show-option -fcolor-diagnostics -fsyntax-only \
-include-pch /path/to/pchheader-nu.pch -code-completion-at hoge.cpp:72:16 hoge.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment