From a6c6b58529553703d9f06ecd54f6c3ba430adc49 Mon Sep 17 00:00:00 2001 From: Virgile Bello Date: Fri, 8 May 2026 23:39:30 +0900 Subject: [PATCH] sdk: auto-detect StrideNativeBuildMode, drop redundant overrides MSVC only when targeting Windows AND the VS C++ tools are loaded in the current shell (VCINSTALLDIR set). Clang everywhere else, including cross-compile from Windows hosts. Removes the need for -p:StrideNativeBuildMode=Clang in 12 CI workflows + test-linux-gpu.ps1 (release.yml keeps the override since it runs msbuild.exe with VS env active). --- .github/workflows/build-android.yml | 1 - .github/workflows/build-ios.yml | 1 - .github/workflows/build-linux-runtime.yml | 1 - .github/workflows/build-windows-full.yml | 1 - .github/workflows/build-windows-runtime.yml | 1 - .github/workflows/check-parallel-build.yml | 1 - .github/workflows/test-linux-game.yml | 2 - .github/workflows/test-linux-simple.yml | 1 - .../workflows/test-samples-screenshots.yml | 2 - .github/workflows/test-windows-game.yml | 2 - .github/workflows/test-windows-simple.yml | 1 - build/test-linux-gpu.ps1 | 1 - .../Sdk/Stride.NativeBuildMode.props | 44 ++++--------------- 13 files changed, 8 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 28d35cabfe..7e1c3e1772 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -89,7 +89,6 @@ jobs: - name: Build run: | dotnet build build\Stride.Android.slnf ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` -p:StridePlatforms=Android ` diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index ce4d2697b5..309d576424 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -57,7 +57,6 @@ jobs: - name: Build run: | dotnet build build\Stride.iOS.slnf ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` diff --git a/.github/workflows/build-linux-runtime.yml b/.github/workflows/build-linux-runtime.yml index 019604851a..e048e48cdd 100644 --- a/.github/workflows/build-linux-runtime.yml +++ b/.github/workflows/build-linux-runtime.yml @@ -55,7 +55,6 @@ jobs: - name: Build run: | dotnet build build\Stride.Runtime.slnf ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` diff --git a/.github/workflows/build-windows-full.yml b/.github/workflows/build-windows-full.yml index 9a57fc84c4..ff7385e708 100644 --- a/.github/workflows/build-windows-full.yml +++ b/.github/workflows/build-windows-full.yml @@ -50,7 +50,6 @@ jobs: - name: Build run: | dotnet build build\Stride.sln ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` diff --git a/.github/workflows/build-windows-runtime.yml b/.github/workflows/build-windows-runtime.yml index 00b72b468c..55b40ecddd 100644 --- a/.github/workflows/build-windows-runtime.yml +++ b/.github/workflows/build-windows-runtime.yml @@ -66,7 +66,6 @@ jobs: - name: Build run: | dotnet build build\Stride.Runtime.slnf ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` diff --git a/.github/workflows/check-parallel-build.yml b/.github/workflows/check-parallel-build.yml index a117c9ed87..32bcad633d 100644 --- a/.github/workflows/check-parallel-build.yml +++ b/.github/workflows/check-parallel-build.yml @@ -41,7 +41,6 @@ jobs: run: | dotnet build build\Stride.sln ` -bl:parallel-audit.binlog ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:StrideSkipUnitTests=true ` diff --git a/.github/workflows/test-linux-game.yml b/.github/workflows/test-linux-game.yml index e5cafa8688..901d837943 100644 --- a/.github/workflows/test-linux-game.yml +++ b/.github/workflows/test-linux-game.yml @@ -59,7 +59,6 @@ jobs: run: | dotnet build build\Stride.Tests.Game.GPU.slnf ` -p:StrideTestRuntimeIdentifier=linux-x64 ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` @@ -70,7 +69,6 @@ jobs: run: | dotnet build build\Stride.Tests.Game.Linux.slnf ` -p:StrideTestRuntimeIdentifier=linux-x64 ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` diff --git a/.github/workflows/test-linux-simple.yml b/.github/workflows/test-linux-simple.yml index e97d4fd771..3853cbbbdf 100644 --- a/.github/workflows/test-linux-simple.yml +++ b/.github/workflows/test-linux-simple.yml @@ -38,7 +38,6 @@ jobs: run: | dotnet build build\Stride.Tests.Simple.Linux.slnf ` -p:StrideTestRuntimeIdentifier=linux-x64 ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` diff --git a/.github/workflows/test-samples-screenshots.yml b/.github/workflows/test-samples-screenshots.yml index 832eaa672f..fadfd5f5c3 100644 --- a/.github/workflows/test-samples-screenshots.yml +++ b/.github/workflows/test-samples-screenshots.yml @@ -86,7 +86,6 @@ jobs: - name: Build harness assembly (packs Stride.Games.AutoTesting into bin/packages) run: | dotnet build sources\engine\Stride.Games.AutoTesting\Stride.Games.AutoTesting.csproj ` - -p:StrideNativeBuildMode=Clang ` -nr:false -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || 'Debug' }} ` -p:StrideGraphicsApi=${{ matrix.graphics-api }} ` @@ -117,7 +116,6 @@ jobs: - name: Build test project run: | dotnet build samples\Tests\Stride.Samples.Tests.csproj ` - -p:StrideNativeBuildMode=Clang ` -nr:false -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || 'Debug' }} ` -p:StrideGraphicsApi=${{ matrix.graphics-api }} ` diff --git a/.github/workflows/test-windows-game.yml b/.github/workflows/test-windows-game.yml index 0f7e65d384..793ac32d6d 100644 --- a/.github/workflows/test-windows-game.yml +++ b/.github/workflows/test-windows-game.yml @@ -54,7 +54,6 @@ jobs: run: | dotnet build build\Stride.Tests.Game.slnf ` -p:StrideTestRuntimeIdentifier=win-x64 ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` @@ -153,7 +152,6 @@ jobs: run: | dotnet build build\Stride.Tests.Game.GPU.slnf ` -p:StrideTestRuntimeIdentifier=win-x64 ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` diff --git a/.github/workflows/test-windows-simple.yml b/.github/workflows/test-windows-simple.yml index 99c67af5f8..14fdac348e 100644 --- a/.github/workflows/test-windows-simple.yml +++ b/.github/workflows/test-windows-simple.yml @@ -37,7 +37,6 @@ jobs: run: | dotnet build build\Stride.Tests.Simple.slnf ` -p:StrideTestRuntimeIdentifier=win-x64 ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} ` diff --git a/build/test-linux-gpu.ps1 b/build/test-linux-gpu.ps1 index 20e1452b15..b958f64447 100644 --- a/build/test-linux-gpu.ps1 +++ b/build/test-linux-gpu.ps1 @@ -47,7 +47,6 @@ foreach ($proj in $testProjects) { Write-Host "=== Step 2: Build (targeting Linux/Vulkan) ===" -ForegroundColor Cyan dotnet build build\Stride.Tests.Game.GPU.slnf ` - -p:StrideNativeBuildMode=Clang ` -nr:false ` -v:m -p:WarningLevel=0 ` -p:Configuration=Debug ` diff --git a/sources/sdk/Stride.Build.Sdk/Sdk/Stride.NativeBuildMode.props b/sources/sdk/Stride.Build.Sdk/Sdk/Stride.NativeBuildMode.props index ebdcadaccc..a7bae99d82 100644 --- a/sources/sdk/Stride.Build.Sdk/Sdk/Stride.NativeBuildMode.props +++ b/sources/sdk/Stride.Build.Sdk/Sdk/Stride.NativeBuildMode.props @@ -1,41 +1,13 @@ - - <_IsWindowsBuildForWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true - <_IsWindowsBuildForWindows Condition="'$(_IsWindowsBuildForWindows)' == ''">false - - - Msvc + + MSVC Clang @@ -44,14 +16,14 @@ true false - true - false + true + false - - + +