gecko-dev/taskcluster/scripts/misc/source-test-clang-setup.sh
Andi-Bogdan Postelnicu ebe4341314 Bug 1756032 - for clang-tidy based analysis also activate clang-plugin. r=firefox-static-analysis-reviewers,marco
By activating `clang-plugin` we make sure that all defines for static-analysis are
in place.

Differential Revision: https://phabricator.services.mozilla.com/D151136
2022-07-08 17:43:17 +00:00

28 lines
921 B
Bash
Executable File

#!/bin/bash
source $HOME/checkouts/gecko/taskcluster/scripts/misc/source-test-common.sh
# Add clang-tidy to PATH
export PATH=$MOZ_FETCHES_DIR/clang-tidy/bin:$PATH
# Use toolchain clang
export LD_LIBRARY_PATH=$MOZ_FETCHES_DIR/clang/lib
# Write custom mozconfig
export MOZCONFIG=$GECKO_PATH/mozconfig
# Add to mozconfig all the appropriate options
cat <<EOT >> $MOZCONFIG
# Enable debug mode
ac_add_options --enable-debug
# Enable clang-plugin in order to have all defines activated for static-analysis
ac_add_options --enable-clang-plugin
# Enable GC zeal, a testing and debugging feature that helps find GC-related bugs in JSAPI applications.
ac_add_options --enable-gczeal
# Do not treat warnings as errors
ac_add_options --disable-warnings-as-errors
EOT
# Mach lookup clang-tidy in clang-tools
mkdir -p $MOZBUILD_STATE_PATH/clang-tools
ln -s $MOZ_FETCHES_DIR/clang-tidy $MOZBUILD_STATE_PATH/clang-tools/clang-tidy