Fix NvCloth compilation on Linux and macOS
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -89,6 +90,15 @@ namespace Flax.Deps.Dependencies
|
|||||||
// Get the source
|
// Get the source
|
||||||
CloneGitRepoSingleBranch(root, "https://github.com/FlaxEngine/NvCloth.git", "master");
|
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 platform in options.Platforms)
|
||||||
{
|
{
|
||||||
foreach (var architecture in options.Architectures)
|
foreach (var architecture in options.Architectures)
|
||||||
@@ -184,7 +194,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.Mac:
|
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";
|
cmakeName = "mac";
|
||||||
binariesPrefix = "lib";
|
binariesPrefix = "lib";
|
||||||
break;
|
break;
|
||||||
@@ -194,7 +204,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
binariesPrefix = "lib";
|
binariesPrefix = "lib";
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.Linux:
|
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";
|
cmakeName = "linux";
|
||||||
binariesPrefix = "lib";
|
binariesPrefix = "lib";
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user