3 Commits

Author SHA1 Message Date
c73daf422b _ogg vorbis fixes mac
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-15 13:54:32 +03:00
7fe2f20699 Fix NvCloth compilation on Linux and macOS 2025-10-15 13:54:32 +03:00
3ad04230ff Fix PhysX compilation on Linux and macOS 2025-10-15 13:54:32 +03:00
2 changed files with 17 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -89,6 +90,15 @@ namespace Flax.Deps.Dependencies
// Get the source
CloneGitRepoSingleBranch(root, "https://github.com/FlaxEngine/NvCloth.git", "master");
// Patch the CMakeLists.txt to support custom compilation flags
foreach (var os in new[] { "android", "ios", "linux", "mac", "windows", })
{
var filePath = Path.Combine(nvCloth, "compiler", "cmake", os, "CMakeLists.txt");
var appendLine = "SET(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${NVCLOTH_CXX_FLAGS}\")";
if (!File.ReadAllText(filePath).Contains(appendLine))
File.AppendAllText(filePath, Environment.NewLine + appendLine + Environment.NewLine);
}
foreach (var platform in options.Platforms)
{
foreach (var architecture in options.Architectures)
@@ -184,7 +194,7 @@ namespace Flax.Deps.Dependencies
}
break;
case TargetPlatform.Mac:
cmakeArgs += " -DTARGET_BUILD_PLATFORM=mac";
cmakeArgs += " -DTARGET_BUILD_PLATFORM=mac -DNVCLOTH_CXX_FLAGS=\"-Wno-error=poison-system-directories -Wno-error=missing-include-dirs\"";
cmakeName = "mac";
binariesPrefix = "lib";
break;
@@ -194,7 +204,7 @@ namespace Flax.Deps.Dependencies
binariesPrefix = "lib";
break;
case TargetPlatform.Linux:
cmakeArgs += " -DTARGET_BUILD_PLATFORM=linux";
cmakeArgs += " -DTARGET_BUILD_PLATFORM=linux -DNVCLOTH_CXX_FLAGS=\"-Wno-error=poison-system-directories -Wno-error=missing-include-dirs\"";
cmakeName = "linux";
binariesPrefix = "lib";
break;

View File

@@ -135,8 +135,7 @@ namespace Flax.Deps.Dependencies
}
break;
case TargetPlatform.Linux:
ConfigureCmakeSwitch(cmakeParams, "CMAKE_C_FLAGS", ""-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs"");
ConfigureCmakeSwitch(cmakeParams, "CMAKE_CXX_FLAGS", ""-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs"");
ConfigureCmakeSwitch(cmakeParams, "PHYSX_CXX_FLAGS", "\"-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs\"");
break;
case TargetPlatform.Android:
ConfigureCmakeSwitch(cmakeParams, "CMAKE_INSTALL_PREFIX", $"install/android-{Configuration.AndroidPlatformApi}/PhysX");
@@ -145,8 +144,7 @@ namespace Flax.Deps.Dependencies
break;
case TargetPlatform.Mac:
ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.MacOSXMinVer);
ConfigureCmakeSwitch(cmakeParams, "CMAKE_C_FLAGS", "\"-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs\"");
ConfigureCmakeSwitch(cmakeParams, "CMAKE_CXX_FLAGS", "\"-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs\"");
ConfigureCmakeSwitch(cmakeParams, "PHYSX_CXX_FLAGS", "\"-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs\"");
break;
case TargetPlatform.iOS:
ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.iOSMinVer);
@@ -282,10 +280,10 @@ namespace Flax.Deps.Dependencies
}
// Update packman for old PhysX version (https://github.com/NVIDIA-Omniverse/PhysX/issues/229)
/*if (BuildPlatform == TargetPlatform.Windows)
if (BuildPlatform == TargetPlatform.Windows)
Utilities.Run(Path.Combine(projectGenDir, "buildtools", "packman", "packman.cmd"), "update -y");
else
Utilities.Run(Path.Combine(projectGenDir, "buildtools", "packman", "packman"), "update -y");*/
Utilities.Run(Path.Combine(projectGenDir, "buildtools", "packman", "packman"), "update -y");
// Print the PhysX version
Log.Info("Building PhysX version " + File.ReadAllText(Path.Combine(root, "physx", "version.txt")) + " to " + binariesSubDir);
@@ -496,7 +494,7 @@ namespace Flax.Deps.Dependencies
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "PhysX");
Directory.GetFiles(dstIncludePath, "*.h", SearchOption.AllDirectories).ToList().ForEach(File.Delete);
Utilities.FileCopy(Path.Combine(root, "LICENSE.md"), Path.Combine(dstIncludePath, "License.txt"));
Utilities.DirectoryCopy(Path.Combine(root, "physx", "include"), dstIncludePath);
Utilities.DirectoryCopy(Path.Combine(root, "physx", "include"), dstIncludePath, true, true);
}
}
}