build-scripts: Attempt at a static analysis batch file for Windows.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 19 May 2020 04:01:03 -0400
changeset 138282fb45c5c0563
parent 13827 a4bf87033fd5
child 13829 d735f145ecef
build-scripts: Attempt at a static analysis batch file for Windows.
build-scripts/checker-buildbot.bat
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build-scripts/checker-buildbot.bat	Tue May 19 04:01:03 2020 -0400
     1.3 @@ -0,0 +1,36 @@
     1.4 +rem This is checker-buildbot.sh, simplified into a Windows .bat file
     1.5 +rem We assume a lot of non-standard Windows stuff is in your PATH:
     1.6 +rem  cmake, ninja, clang, perl...
     1.7 +
     1.8 +erase /q /f /s %1 checker-buildbot analysis
     1.9 +mkdir checker-buildbot
    1.10 +cd checker-buildbot
    1.11 +
    1.12 +# We turn off deprecated declarations, because we don't care about these warnings during static analysis.
    1.13 +# The -Wno-liblto is new since our checker-279 upgrade, I think; checker otherwise warns "libLTO.dylib relative to clang installed dir not found"
    1.14 +
    1.15 +scan-build -o analysis cmake -G Ninja -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_SHARED_LINKER_FLAGS="-Wno-liblto" ..
    1.16 +
    1.17 +erase /q /f /s analysis
    1.18 +scan-build -o analysis ninja
    1.19 +
    1.20 +for /F %%i in ('dir /b /a "analysis\*"') do (
    1.21 +    goto packageit
    1.22 +)
    1.23 +
    1.24 +mkdir analysis\zarro
    1.25 +echo '<html><head><title>Zarro boogs</title></head><body>Static analysis: no issues to report.</body></html>' >analysis\zarro\index.html
    1.26 +
    1.27 +packageit:
    1.28 +move analysis\* ..\analysis
    1.29 +rmdir analysis   # Make sure this is empty.
    1.30 +cd ..
    1.31 +
    1.32 +move analysis %1
    1.33 +
    1.34 +erase /q /f /s checker-buildbot
    1.35 +
    1.36 +echo "Done"
    1.37 +
    1.38 +rem end of checker-buildbot.bat ...
    1.39 +