-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalyze.cmd
More file actions
43 lines (33 loc) · 1.4 KB
/
Copy pathanalyze.cmd
File metadata and controls
43 lines (33 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@echo off
setlocal EnableExtensions
cd /d "%~dp0"
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%VSWHERE%" (
echo ERROR: Visual Studio Installer's vswhere.exe was not found.
exit /b 1
)
set "VSINSTALL="
for /f "usebackq tokens=*" %%I in (`"%VSWHERE%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSINSTALL=%%I"
if not defined VSINSTALL (
echo ERROR: Visual Studio C++ build tools were not found.
exit /b 1
)
call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" >nul
if errorlevel 1 exit /b 1
if exist build\obj\analyze rmdir /s /q build\obj\analyze
mkdir build\obj\analyze\app
mkdir build\obj\analyze\core
mkdir build\obj\analyze\conpty
mkdir build\obj\analyze\update
set "ANALYZE_FLAGS=/nologo /c /std:c11 /utf-8 /W4 /WX /sdl /analyze /analyze:external- /D_DEBUG"
cl %ANALYZE_FLAGS% /Fo:build\obj\analyze\app\ ^
src\main.c src\util.c src\nvml_dyn.c src\dxgi_gpu.c src\d3dkmt_gpu.c src\pdh_gpu.c src\updater.c
if errorlevel 1 exit /b 1
cl %ANALYZE_FLAGS% /Fo:build\obj\analyze\core\ ^
tests\test_core.c src\util.c src\pdh_gpu.c src\updater.c
if errorlevel 1 exit /b 1
cl %ANALYZE_FLAGS% /Fo:build\obj\analyze\conpty\ tests\test_conpty.c
if errorlevel 1 exit /b 1
cl %ANALYZE_FLAGS% /Fo:build\obj\analyze\update\ tests\update_smoke.c
if errorlevel 1 exit /b 1
echo MSVC static analysis passed.