🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.8 KiB

  1. #!/bin/bash
  2. # This is a script used by some Buildbot workers to push the project
  3. # through Clang's static analyzer and prepare the output to be uploaded
  4. # back to the buildmaster. You might find it useful too.
  5. # Install Clang (you already have it on Mac OS X, apt-get install clang
  6. # on Ubuntu, etc), Make sure "scan-build" is in your $PATH.
  7. FINALDIR="$1"
  8. set -x
  9. set -e
  10. cd `dirname "$0"`
  11. cd ..
  12. rm -rf checker-buildbot analysis
  13. if [ ! -z "$FINALDIR" ]; then
  14. rm -rf "$FINALDIR"
  15. fi
  16. mkdir checker-buildbot
  17. cd checker-buildbot
  18. # We turn off deprecated declarations, because we don't care about these warnings during static analysis.
  19. # The -Wno-liblto is new since our checker-279 upgrade, I think; checker otherwise warns "libLTO.dylib relative to clang installed dir not found"
  20. # You might want to do this for CMake-backed builds instead...
  21. scan-build -o analysis cmake -G Ninja -Wno-dev -DPHYSFS_BUILD_SHARED=False -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_EXE_LINKER_FLAGS="-Wno-liblto" ..
  22. rm -rf analysis
  23. scan-build -o analysis cmake --build . --config Debug
  24. if [ `ls -A analysis |wc -l` == 0 ] ; then
  25. mkdir analysis/zarro
  26. echo '<html><head><title>Zarro boogs</title></head><body>Static analysis: no issues to report.</body></html>' >analysis/zarro/index.html
  27. fi
  28. mv analysis/* ../analysis
  29. rmdir analysis # Make sure this is empty.
  30. cd ..
  31. chmod -R a+r analysis
  32. chmod -R go-w analysis
  33. find analysis -type d -exec chmod a+x {} \;
  34. if [ -x /usr/bin/xattr ]; then find analysis -exec /usr/bin/xattr -d com.apple.quarantine {} \; 2>/dev/null ; fi
  35. if [ ! -z "$FINALDIR" ]; then
  36. mv analysis "$FINALDIR"
  37. else
  38. FINALDIR=analysis
  39. fi
  40. rm -rf checker-buildbot
  41. echo "Done. Final output is in '$FINALDIR' ..."
  42. # end of checker-buildbot.sh ...