Lines Matching +full:clang +full:- +full:tidy
1 .. _module-pw_toolchain:
11 ----------
13 ----------
15 Pigweed. Various GCC and Clang toolchains for multiple platforms are provided.
16 Toolchains names typically include the compiler (``clang`` or ``gcc`` and
19 --------------------
20 Non-C/C++ toolchains
21 --------------------
28 Non-C/C++ toolchains can be used to consolidate actions that should only occur
29 once in a multi-toolchain build. Build targets from all toolchains can refer to
30 these actions in a non-C/C++ toolchain so they only execute once instead of once
38 -------------------------------
40 -------------------------------
41 The clang-based toolchain provided by Pigweed can be substituted with another
43 point to the directory that contains the desired clang, clang++, and llvm-ar
47 ------------------------------
49 ------------------------------
50 ``clang-tidy`` can be run as a compiler replacement, to analyze all sources
53 that execute ``clang-tidy`` for C/C++ sources, and mock implementations of
60 .. code-block::
66 # Optionally override clang-tidy binary to use by setting to proper path.
82 snippet below where we enable clang-tidy caching and add ``//.clang-tidy`` as a
86 .. code-block::
89 clang_tidy_path = "//third_party/ctcache/clang-tidy"
90 _clang_tidy_cfg_path = rebase_path("//.clang-tidy", root_build_dir)
91 cc_post = "echo '-: $_clang_tidy_cfg_path' >> {{output}}.d"
92 cxx_post = "echo '-: $_clang_tidy_cfg_path' >> {{output}}.d"
105 POSIX-style path suffixes for include paths, or regular expressions matching
108 while passing ``.*/third_party/.*`` excludes all third-party header files.
112 include ``-Idrivers``, and this results in a file at ``drivers/public/i2c.h``
123 - pw_toolchain_host_clang.debug.static_analysis
124 - pw_toolchain_host_clang.speed_optimized.static_analysis
125 - pw_toolchain_host_clang.size_optimized.static_analysis
126 - pw_toolchain_host_clang.fuzz.static_analysis
128 - pw_toolchain_arm_clang.debug.static_analysis
129 - pw_toolchain_arm_clang.speed_optimized.static_analysis
130 - pw_toolchain_arm_clang.size_optimized.static_analysis
132 For example, to run ``clang-tidy`` on all source dependencies of the
135 .. code-block::
151 any relevant .clang-tidy file is updated. You should
153 ``clang-tidy``.
155 -------------
157 -------------
175 - ``CXX_STANDARD``. The C++ standard used by the toolchain. The value must be an
181 ---------------
183 ---------------
184 ``pw_toolchain`` provides some toolchain-related C/C++ libraries.
199 ``-Wl,--wrap=abort`` linker option to redirect to ``abort`` calls to
202 arm-none-eabi-gcc support
204 Targets building with the GNU Arm Embedded Toolchain (``arm-none-eabi-gcc``)
210 -------------------
212 implementation provided with ``arm-none-eabi-gcc``, defines a set of `OS
228 Helper type to create a function-local static variable of type ``T`` when
229 ``T`` has a non-trivial destructor. Storing a ``T`` in a
234 has a non-trivial destructor. Destructor ordering is not defined and can
243 ``->`` to access the wrapped type.
248 In Clang, ``pw::NoDestructor`` can be replaced with the `[[clang::no_destroy]]
249 <https://clang.llvm.org/docs/AttributeReference.html#no-destroy>`_.
253 -------------
254 .. code-block:: cpp
257 // Use NoDestructor to avoid running the mutex destructor when exit-time