Skip to content

Commit bb1aa81

Browse files
committed
Allow to pass PREMAKE_OPTS to Bootstrap.bat
[CI] add Visual studio with clang
1 parent eb418ab commit bb1aa81

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.github/workflows/ci-workflow.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
config: [debug, release]
6666
platform: [Win32, x64]
6767
msdev: [vs2022]
68+
cc: [msc, clang]
6869
timeout-minutes: 30
6970
steps:
7071
- name: Checkout
@@ -74,15 +75,15 @@ jobs:
7475
env:
7576
PLATFORM: ${{ matrix.platform }}
7677
CONFIG: ${{ matrix.config }}
77-
run: ./Bootstrap.bat ${{ matrix.msdev }}
78+
run: ./Bootstrap.bat ${{ matrix.msdev }} 'PREMAKE_OPTS="--cc=${{ matrix.cc }}"'
7879
- name: Test
7980
run: bin\${{ matrix.config }}\premake5 test --test-all
8081
shell: cmd
8182
- name: Docs check
8283
run: bin\${{ matrix.config }}\premake5 docs-check
8384
shell: cmd
8485
- name: Upload Artifacts
85-
if: matrix.config == 'release'
86+
if: matrix.config == 'release' && matrix.cc == 'msc'
8687
uses: actions/upload-artifact@v4
8788
with:
8889
name: premake-windows-${{ matrix.platform }}

Bootstrap.bat

+10-6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ IF "%vsversion%" == "" (
2626
EXIT /B %ERRORLEVEL%
2727
)
2828

29+
SET PREMAKE_OPTS="%2"
30+
ECHO PREMAKE_OPTS="%2"
31+
2932
IF "%vsversion%" == "vs2010" (
3033
CALL :LegacyVisualBootstrap "%vsversion%" "100"
3134

@@ -39,13 +42,13 @@ IF "%vsversion%" == "vs2010" (
3942
CALL :LegacyVisualBootstrap "%vsversion%" "140"
4043

4144
) ELSE IF "%vsversion%" == "vs2017" (
42-
CALL :VsWhereVisualBootstrap "%vsversion%" "15.0" "16.0"
45+
CALL :VsWhereVisualBootstrap "%vsversion%" "15.0" "16.0" "%PREMAKE_OPTS%"
4346

4447
) ELSE IF "%vsversion%" == "vs2019" (
45-
CALL :VsWhereVisualBootstrap "%vsversion%" "16.0" "17.0"
48+
CALL :VsWhereVisualBootstrap "%vsversion%" "16.0" "17.0" "%PREMAKE_OPTS%"
4649

4750
) ELSE IF "%vsversion%" == "vs2022" (
48-
CALL :VsWhereVisualBootstrap "%vsversion%" "17.0" "18.0"
51+
CALL :VsWhereVisualBootstrap "%vsversion%" "17.0" "18.0" "%PREMAKE_OPTS%"
4952

5053
) ELSE (
5154
ECHO Unrecognized Visual Studio version %vsversion%
@@ -93,6 +96,7 @@ REM %3: VisualStudio-style VSversionMax -> ex: 16.0
9396
SET "PremakeVsVersion=%~1"
9497
SET "VsVersionMin=%~2"
9598
SET "VsVersionMax=%~3"
99+
SET "PREMAKE_OPTS=%~4"
96100

97101
REM ref: https://github.com/Microsoft/vswhere/wiki/Start-Developer-Command-Prompt
98102

@@ -104,13 +108,13 @@ IF NOT EXIST %VsWherePath% (
104108
SET VsWhereCmdLine="!VsWherePath! -nologo -latest -version [%VsVersionMin%,%VsVersionMax%) -property installationPath"
105109

106110
FOR /F "usebackq delims=" %%i in (`!VsWhereCmdLine!`) DO (
107-
111+
ECHO PREMAKE_OPTS="%PREMAKE_OPTS%"
108112
IF EXIST "%%i\VC\Auxiliary\Build\vcvars64.bat" (
109-
CALL "%%i\VC\Auxiliary\Build\vcvars64.bat" && nmake MSDEV="%PremakeVsVersion%" %PlatformArg% %ConfigArg% -f Bootstrap.mak windows
113+
CALL "%%i\VC\Auxiliary\Build\vcvars64.bat" && nmake MSDEV="%PremakeVsVersion%" %PlatformArg% %ConfigArg% "%PREMAKE_OPTS%" -f Bootstrap.mak windows
110114
EXIT /B %ERRORLEVEL%
111115
) ELSE (
112116
IF EXIST "%%i\VC\Auxiliary\Build\vcvars32.bat" (
113-
CALL "%%i\VC\Auxiliary\Build\vcvars32.bat" && nmake MSDEV="%PremakeVsVersion%" %PlatformArg% %ConfigArg% -f Bootstrap.mak windows
117+
CALL "%%i\VC\Auxiliary\Build\vcvars32.bat" && nmake MSDEV="%PremakeVsVersion%" %PlatformArg% %ConfigArg% "%PREMAKE_OPTS%" -f Bootstrap.mak windows
114118
EXIT /B %ERRORLEVEL%
115119
)
116120
)

0 commit comments

Comments
 (0)