Files
UnrealEngineUWP/Engine/Source/Programs/Enterprise/Datasmith/DatasmithSketchUpRubyExporter/DatasmithSketchUpRuby2020.Target.cs
JeanLuc Corenthin 33689a5341 Fixed crash on sync on all exporters.
- Root cause: In cl 17646035, the value of bBuildWithEditorOnlyData in the different Target.cs failes was changed from true to false. Doing so implies the use of the wrong BulkData on which the Datasmith mesh serialization is relying on and generates the crash.
  - Solution: Move bBuildWithEditorOnlyData  back to true.
Note the reason why the change was made in the first place has not been found yet.

#jira UE-145285
#rb none
#preflight 6228d36e0d5a90e98ec5719b

[CL 19322125 by JeanLuc Corenthin in ue5-main branch]
2022-03-09 12:23:38 -05:00

86 lines
3.0 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
[SupportedPlatforms("Win64")]
public abstract class DatasmithSketchUpRubyBaseTarget : TargetRules
{
public DatasmithSketchUpRubyBaseTarget(TargetInfo Target)
: base(Target)
{
Type = TargetType.Program;
SolutionDirectory = "Programs/Datasmith";
bBuildInSolutionByDefault = false;
bShouldCompileAsDLL = true;
LinkType = TargetLinkType.Monolithic;
WindowsPlatform.ModuleDefinitionFile = "Programs/Enterprise/Datasmith/DatasmithSketchUpRubyExporter/DatasmithSketchUpRubyExporter.def";
bBuildDeveloperTools = false;
bUseMallocProfiler = false;
bBuildWithEditorOnlyData = true;
bCompileAgainstEngine = false;
bCompileAgainstCoreUObject = true;
bCompileICU = false;
bUsesSlate = false;
bHasExports = true;
bForceEnableExceptions = true;
GlobalDefinitions.Add("UE_EXTERNAL_PROFILING_ENABLED=0"); // For DirectLinkUI (see FDatasmithExporterManager::FInitOptions)
}
protected void AddCopyPostBuildStep(TargetInfo Target)
{
string OutputName = "$(TargetName)";
PostBuildSteps.Add("echo on");
// Copy Ruby scripts
PostBuildSteps.Add(string.Format("echo D|xcopy /Y /R /F /S \"{0}\" \"{1}\"",
string.Format(@"$(EngineDir)/Source/Programs/Enterprise/Datasmith/DatasmithSketchUpRubyExporter/Plugin/*.rb"),
string.Format(@"$(EngineDir)/Binaries/Win64/{0}/Plugin/", ExeBinariesSubFolder)
));
ReadOnlyBuildVersion BuildVersion = Target.Version;
string VersionString = string.Format("{0}.{1}.{2}", BuildVersion.MajorVersion, BuildVersion.MinorVersion, BuildVersion.PatchVersion);
PostBuildSteps.Add(string.Format("echo {1}> \"{0}\"",
string.Format(@"$(EngineDir)/Binaries/Win64/{0}/Plugin/UnrealDatasmithSketchUp/version", ExeBinariesSubFolder), VersionString));
// Copy plugin dll
PostBuildSteps.Add(string.Format("echo F|xcopy /Y /R /F \"{0}\" \"{1}\"",
string.Format(@"$(EngineDir)/Binaries/Win64/{0}/{1}.dll", ExeBinariesSubFolder, OutputName),
string.Format(@"$(EngineDir)/Binaries/Win64/{0}/Plugin/UnrealDatasmithSketchUp/DatasmithSketchUp.so", ExeBinariesSubFolder, OutputName)
));
// Copy support dlls
PostBuildSteps.Add(string.Format("echo F|xcopy /Y /R /F \"{0}\" \"{1}\"",
string.Format(@"$(EngineDir)/Binaries/Win64/{0}/tbb.dll", ExeBinariesSubFolder),
string.Format(@"$(EngineDir)/Binaries/Win64/{0}/Plugin/UnrealDatasmithSketchUp", ExeBinariesSubFolder)
));
// Copy resources
PostBuildSteps.Add(string.Format("echo D|xcopy /Y /R /F /S \"{0}\" \"{1}\"",
string.Format(@"$(EngineDir)/Source/Programs/Enterprise/Datasmith/DatasmithSketchUpRubyExporter/Resources/Windows"),
string.Format(@"$(EngineDir)/Binaries/Win64/{0}/Plugin/UnrealDatasmithSketchUp/Resources", ExeBinariesSubFolder)
));
}
}
[SupportedPlatforms("Win64")]
public class DatasmithSketchUpRuby2020Target : DatasmithSketchUpRubyBaseTarget
{
public DatasmithSketchUpRuby2020Target(TargetInfo Target)
: base(Target)
{
LaunchModuleName = "DatasmithSketchUpRuby2020";
ExeBinariesSubFolder = @"SketchUpRuby/2020";
AddCopyPostBuildStep(Target);
}
}