Skip to content

Commit

Permalink
Boilerplate: ensure shared libraries are staged when using precompute…
Browse files Browse the repository at this point in the history
…d data
  • Loading branch information
adamrehn committed Aug 12, 2020
1 parent 2c3c900 commit cf716dc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions conan_ue4cli/data/boilerplate_templates/v2/Template.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ private bool ProcessPrecomputedData(ReadOnlyTargetRules target, string engineVer
}
}

//Ensure any shared libraries are staged alongside the binaries for the plugin
string[] searchDirs = new string[]{ binDir, libDir };
foreach (string dir in searchDirs)
{
List<string> binaries = new List<string>();
binaries.AddRange(Directory.GetFiles(dir, "*.dll"));
binaries.AddRange(Directory.GetFiles(dir, "*.dylib"));
binaries.AddRange(Directory.GetFiles(dir, "*.so"));
foreach (string binary in binaries) {
RuntimeDependencies.Add(Path.Combine("$(BinaryOutputDir)", Path.GetFileName(binary)), binary, StagedFileType.NonUFS);
}
}

//Attempt to parse the JSON file containing any additional flags, modules and system libraries
JsonObject flags = JsonObject.Read(new FileReference(flagsFile));

Expand Down
13 changes: 13 additions & 0 deletions conan_ue4cli/data/boilerplate_templates/v3/Template.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ private bool ProcessPrecomputedData(ReadOnlyTargetRules target, string engineVer
}
}

//Ensure any shared libraries are staged alongside the binaries for the plugin
string[] searchDirs = new string[]{ binDir, libDir };
foreach (string dir in searchDirs)
{
List<string> binaries = new List<string>();
binaries.AddRange(Directory.GetFiles(dir, "*.dll"));
binaries.AddRange(Directory.GetFiles(dir, "*.dylib"));
binaries.AddRange(Directory.GetFiles(dir, "*.so"));
foreach (string binary in binaries) {
RuntimeDependencies.Add(Path.Combine("$(BinaryOutputDir)", Path.GetFileName(binary)), binary, StagedFileType.NonUFS);
}
}

//Attempt to parse the JSON file containing any additional flags, modules and system libraries
JsonObject flags = JsonObject.Read(new FileReference(flagsFile));

Expand Down

0 comments on commit cf716dc

Please sign in to comment.