-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest_compiler_compatible.bat
61 lines (49 loc) · 1.95 KB
/
test_compiler_compatible.bat
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@echo off
setlocal
REM set build folder
set PROJECT_ROOT=%~dp0
set BUILD_DIR=%PROJECT_ROOT%Build
echo search msbuild.exe...
REM define search paths
set "MSBUILD_PATHS="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64";"C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64";"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64";"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64";"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\amd64";"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64""
REM find msbuild.exe
for %%p in (%MSBUILD_PATHS%) do (
if exist %%~p\msbuild.exe (
set "MSBUILD_EXE=%%~p\msbuild.exe"
goto found
)
)
echo Unable to find msbuild.exe
exit /b 1
:found
echo Found msbuild.exe at %MSBUILD_EXE%
echo generate projects with C++ 14
REM call generate_projects.bat
call generate_projects.bat --nopause --cppstd 14
REM compile with different C++ standards
echo Compiling with C++ 14...
"%MSBUILD_EXE%" %BUILD_DIR%\vs2022_x64\CPPStringFormatting.sln /p:PlatformToolset=v143
if %errorlevel% neq 0 (
echo Failed to compile with C++ 14
exit /b %errorlevel%
)
echo generate projects with C++ 17
REM call generate_projects.bat
call generate_projects.bat --nopause --cppstd 17
echo Compiling with C++ 17...
"%MSBUILD_EXE%" %BUILD_DIR%\vs2022_x64\CPPStringFormatting.sln /p:PlatformToolset=v143
if %errorlevel% neq 0 (
echo Failed to compile with C++ 17
exit /b %errorlevel%
)
echo generate projects with C++ 20
REM call generate_projects.bat
call generate_projects.bat --nopause --cppstd 20
echo Compiling with C++ 20...
"%MSBUILD_EXE%" %BUILD_DIR%\vs2022_x64\CPPStringFormatting.sln /p:PlatformToolset=v143
if %errorlevel% neq 0 (
echo Failed to compile with C++ 20
exit /b %errorlevel%
)
echo Compilation complete.
endlocal