Compare commits
3 Commits
0d132473f4
...
c73daf422b
| Author | SHA1 | Date | |
|---|---|---|---|
| c73daf422b | |||
| 7fe2f20699 | |||
| 3ad04230ff |
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user