2 Commits

Author SHA1 Message Date
10541b8568 Fix building vorbis on Windows
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
2025-10-18 03:31:07 +03:00
7c38baaa54 Check VS2026 toolset before trying to compile PhysX 2025-10-18 03:24:51 +03:00
2 changed files with 14 additions and 7 deletions

View File

@@ -423,15 +423,20 @@ namespace Flax.Deps.Dependencies
{
if (architecture == TargetArchitecture.x64 || architecture == TargetArchitecture.ARM64)
{
try
if (WindowsPlatform.GetToolsets().Any(x => x.Key == WindowsPlatformToolset.v145))
{
Build(options, architecture == TargetArchitecture.x64 ? "vc18win64" : "vc18win-arm64", platform, architecture);
try
{
Build(options, architecture == TargetArchitecture.x64 ? "vc18win64" : "vc18win-arm64", platform, architecture);
}
catch (Exception e)
{
Log.Warning($"Failed to generate VS2026 solution for PhysX, fallback to VS2022: {e.Message}");
Build(options, architecture == TargetArchitecture.x64 ? "vc17win64" : "vc17win-arm64", platform, architecture);
}
}
catch
{
Log.Verbose("Failed to generate VS2026 solution for PhysX, fallback to VS2022");
else
Build(options, architecture == TargetArchitecture.x64 ? "vc17win64" : "vc17win-arm64", platform, architecture);
}
}
else
throw new InvalidArchitectureException(architecture);

View File

@@ -295,6 +295,7 @@ namespace Flax.Deps.Dependencies
string ext;
string oggConfig = $"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE={_configuration} -DCMAKE_INSTALL_PREFIX=\"{installDir}\"";
string vorbisConfig = $"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE={_configuration} -DCMAKE_INSTALL_PREFIX=\"{installDir}\"";
string liboggFilename = "libogg";
Dictionary<string, string> envVars = new Dictionary<string, string>();
(string, string)[] oggBinariesToCopy;
Binary[] vorbisBinariesToCopy;
@@ -306,6 +307,7 @@ namespace Flax.Deps.Dependencies
oggConfig += " -DBUILD_SHARED_LIBS=OFF";
vorbisConfig += " -DBUILD_SHARED_LIBS=OFF";
ext = ".lib";
liboggFilename = "ogg";
break;
case TargetPlatform.Linux:
oggConfig += " -DCMAKE_POSITION_INDEPENDENT_CODE=ON";
@@ -355,7 +357,7 @@ namespace Flax.Deps.Dependencies
default: throw new InvalidPlatformException(platform);
}
vorbisConfig += $" -DOGG_INCLUDE_DIR=\"{Path.Combine(installDir, "include")}\" -DOGG_LIBRARY=\"{Path.Combine(installDir, "lib", "libogg" + ext)}\"";
vorbisConfig += $" -DOGG_INCLUDE_DIR=\"{Path.Combine(installDir, "include")}\" -DOGG_LIBRARY=\"{Path.Combine(installDir, "lib", liboggFilename + ext)}\"";
var binariesToCopy = new List<(string, string)>();