Lines Matching +full:ninja +full:- +full:build
7 of specific tools using this infrastructure (e.g. ``clang-check``). This
14 Clang Tooling needs a compilation database to figure out specific build
17 invoking clang tools, you can either specify a path to a build directory
18 using a command line parameter ``-p`` or let Clang Tooling find this
20 build using CMake to use clang tools.
25 If you intend to use make to build LLVM, you should have CMake 2.8.6 or
29 make a build directory and run CMake from it:
31 .. code-block:: console
33 $ mkdir your/build/directory
34 $ cd your/build/directory
35 $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON path/to/llvm/sources
38 ``-DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++``.
46 .. code-block:: console
48 $ ln -s $PWD/compile_commands.json path/to/llvm/source/
50 Now you are ready to build and test LLVM using make:
52 .. code-block:: console
54 $ make check-all
60 you have a recent clang installed, you should have ``clang-check`` in
63 .. code-block:: console
65 $ clang-check tools/clang/lib/Tooling/CompilationDatabase.cpp
67 If you're using vim, it's convenient to have clang-check integrated. Put
88 call ClangCheckImpl("clang-check " . l:filename)
92 echo "Can't detect file's compilation arguments and no previous clang-check invocation!"
100 will re-run the last clang-check invocation made from this vim instance
102 automatically when clang-check finds errors, and can be re-opened with
105 Other ``clang-check`` options that can be useful when working with clang
108 * ``-ast-print`` --- Build ASTs and then pretty-print them.
109 * ``-ast-dump`` --- Build ASTs and then debug dump them.
110 * ``-ast-dump-filter=<string>`` --- Use with ``-ast-dump`` or ``-ast-print`` to
112 qualified name. Use ``-ast-list`` to list all filterable declaration node
114 * ``-ast-list`` --- Build ASTs and print the list of declaration node qualified
119 .. code-block:: console
121 …$ clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-dump -ast-dump-filter ActionFactor…
122 Processing: tools/clang/tools/clang-check/ClangCheck.cpp.
124 …r() (CompoundStmt 0x44da290 </home/alexfh/local/llvm/tools/clang/tools/clang-check/ClangCheck.cpp:…
129 …$ clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-print -ast-dump-filter ActionFacto…
130 Processing: tools/clang/tools/clang-check/ClangCheck.cpp.
133 if (this->ASTList.operator _Bool())
135 if (this->ASTDump.operator _Bool())
136 return clang::CreateASTDumper(this->ASTDumpFilter);
137 if (this->ASTPrint.operator _Bool())
138 return clang::CreateASTPrinter(&llvm::outs(), this->ASTDumpFilter);
142 (Experimental) Using Ninja Build System
145 Optionally you can use the `Ninja <https://github.com/martine/ninja>`_
146 build system instead of make. It is aimed at making your builds faster.
147 Currently this step will require building Ninja from sources.
149 To take advantage of using Clang Tools along with Ninja build you need
152 Clone the Ninja git repository and build Ninja from sources:
154 .. code-block:: console
156 $ git clone git://github.com/martine/ninja.git
157 $ cd ninja/
160 This will result in a single binary ``ninja`` in the current directory.
164 .. code-block:: console
166 $ sudo cp ninja /usr/local/bin/
167 $ sudo chmod a+rx /usr/local/bin/ninja
169 After doing all of this, you'll need to generate Ninja build files for
170 LLVM with CMake. You need to make a build directory and run CMake from
173 .. code-block:: console
175 $ mkdir your/build/directory
176 $ cd your/build/directory
177 $ cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON path/to/llvm/sources
180 ``-DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++``.
188 .. code-block:: console
190 $ ln -s $PWD/compile_commands.json path/to/llvm/source/
192 Now you are ready to build and test LLVM using Ninja:
194 .. code-block:: console
196 $ ninja check-all