summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/build-scripts/codechecker-buildbot.sh
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
committer3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
commit6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch)
tree34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/build-scripts/codechecker-buildbot.sh
parent8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff)
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/build-scripts/codechecker-buildbot.sh')
-rwxr-xr-xsrc/contrib/SDL-3.2.20/build-scripts/codechecker-buildbot.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/build-scripts/codechecker-buildbot.sh b/src/contrib/SDL-3.2.20/build-scripts/codechecker-buildbot.sh
new file mode 100755
index 0000000..76b7853
--- /dev/null
+++ b/src/contrib/SDL-3.2.20/build-scripts/codechecker-buildbot.sh
@@ -0,0 +1,59 @@
1#!/bin/bash
2
3# This is a script used by some Buildbot build workers to push the project
4# through Clang's static analyzer and prepare the output to be uploaded
5# back to the buildmaster. You might find it useful too.
6
7# Install Clang (you already have it on macOS, apt-get install clang
8# on Ubuntu, etc), install CMake, and pip3 install codechecker.
9
10FINALDIR="$1"
11
12set -x
13set -e
14
15cd `dirname "$0"`
16cd ..
17
18rm -rf codechecker-buildbot
19if [ ! -z "$FINALDIR" ]; then
20 rm -rf "$FINALDIR"
21fi
22
23mkdir codechecker-buildbot
24cd codechecker-buildbot
25
26# We turn off deprecated declarations, because we don't care about these warnings during static analysis.
27cmake -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DSDL_ASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
28
29# CMake on macOS adds "-arch arm64" or whatever is appropriate, but this confuses CodeChecker, so strip it out.
30perl -w -pi -e 's/\-arch\s+.*?\s+//g;' compile_commands.json
31
32rm -rf ../analysis
33CodeChecker analyze compile_commands.json -o ./reports
34
35# "parse" returns 2 if there was a static analysis issue to report, but this
36# does not signify an error in the parsing (that would be error code 1). Turn
37# off the abort-on-error flag.
38set +e
39CodeChecker parse ./reports -e html -o ../analysis
40set -e
41
42cd ..
43chmod -R a+r analysis
44chmod -R go-w analysis
45find analysis -type d -exec chmod a+x {} \;
46if [ -x /usr/bin/xattr ]; then find analysis -exec /usr/bin/xattr -d com.apple.quarantine {} \; 2>/dev/null ; fi
47
48if [ ! -z "$FINALDIR" ]; then
49 mv analysis "$FINALDIR"
50else
51 FINALDIR=analysis
52fi
53
54rm -rf codechecker-buildbot
55
56echo "Done. Final output is in '$FINALDIR' ..."
57
58# end of codechecker-buildbot.sh ...
59