Skip to content

Commit 79f3bbd

Browse files
committed
Allow to pass PREMAKE_OPTS to Bootstrap.bat
[CI] add Visual studio with clang
1 parent 0e4040d commit 79f3bbd

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/ci-workflow.yml

Lines changed: 3 additions & 2 deletions
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: 15
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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ IF "%vsversion%" == "" (
2626
EXIT /B %ERRORLEVEL%
2727
)
2828

29+
SET PREMAKE_OPTS=%2
30+
2931
IF "%vsversion%" == "vs2010" (
3032
CALL :LegacyVisualBootstrap "%vsversion%" "100"
3133

@@ -39,13 +41,13 @@ IF "%vsversion%" == "vs2010" (
3941
CALL :LegacyVisualBootstrap "%vsversion%" "140"
4042

4143
) ELSE IF "%vsversion%" == "vs2017" (
42-
CALL :VsWhereVisualBootstrap "%vsversion%" "15.0" "16.0"
44+
CALL :VsWhereVisualBootstrap "%vsversion%" "15.0" "16.0" %PREMAKE_OPTS%
4345

4446
) ELSE IF "%vsversion%" == "vs2019" (
45-
CALL :VsWhereVisualBootstrap "%vsversion%" "16.0" "17.0"
47+
CALL :VsWhereVisualBootstrap "%vsversion%" "16.0" "17.0" %PREMAKE_OPTS%
4648

4749
) ELSE IF "%vsversion%" == "vs2022" (
48-
CALL :VsWhereVisualBootstrap "%vsversion%" "17.0" "18.0"
50+
CALL :VsWhereVisualBootstrap "%vsversion%" "17.0" "18.0" %PREMAKE_OPTS%
4951

5052
) ELSE (
5153
ECHO Unrecognized Visual Studio version %vsversion%
@@ -93,6 +95,7 @@ REM %3: VisualStudio-style VSversionMax -> ex: 16.0
9395
SET "PremakeVsVersion=%~1"
9496
SET "VsVersionMin=%~2"
9597
SET "VsVersionMax=%~3"
98+
SET PREMAKE_OPTS=%4
9699

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

@@ -104,13 +107,12 @@ IF NOT EXIST %VsWherePath% (
104107
SET VsWhereCmdLine="!VsWherePath! -nologo -latest -version [%VsVersionMin%,%VsVersionMax%) -property installationPath"
105108

106109
FOR /F "usebackq delims=" %%i in (`!VsWhereCmdLine!`) DO (
107-
108110
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
111+
CALL "%%i\VC\Auxiliary\Build\vcvars64.bat" && nmake MSDEV="%PremakeVsVersion%" %PlatformArg% %ConfigArg% %PREMAKE_OPTS% -f Bootstrap.mak windows
110112
EXIT /B %ERRORLEVEL%
111113
) ELSE (
112114
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
115+
CALL "%%i\VC\Auxiliary\Build\vcvars32.bat" && nmake MSDEV="%PremakeVsVersion%" %PlatformArg% %ConfigArg% %PREMAKE_OPTS% -f Bootstrap.mak windows
114116
EXIT /B %ERRORLEVEL%
115117
)
116118
)

0 commit comments

Comments
 (0)