Fix *.cs issues.

This commit is contained in:
Marcel Pi 2023-11-30 17:43:56 +01:00
parent 5d3f9219af
commit 46a8e37784
7 changed files with 77 additions and 82 deletions

View File

@ -22,9 +22,6 @@ public class Carla :
[CommandLine("-ros2")]
bool EnableRos2 = false;
[CommandLine("-unity")]
bool EnableUnityBuild = false;
[CommandLine("-carla-install-path")]
string CarlaInstallPath = null;
@ -38,16 +35,8 @@ public class Carla :
{
bool IsWindows = Target.Platform == UnrealTargetPlatform.Win64;
bLegacyPublicIncludePaths = false;
ModuleIncludePathWarningLevel = WarningLevel.Warning;
ModuleIncludeSubdirectoryWarningLevel = WarningLevel.Warning;
ShadowVariableWarningLevel = WarningLevel.Warning;
UnsafeTypeCastWarningLevel = WarningLevel.Warning;
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
CppStandard = CppStandardVersion.Cpp20;
bEnableExceptions = bEnableExceptions || IsWindows;
bUseUnity = EnableUnityBuild;
PrivatePCHHeaderFile = "Carla.h";
bEnableExceptions = bEnableExceptions || IsWindows;
var DirectoryInfo = new DirectoryInfo(ModuleDirectory);
for (int i = 0; i != 6; ++i)
@ -86,7 +75,6 @@ public class Carla :
LogBuildFlagStatus("Chrono support", EnableChrono);
LogBuildFlagStatus("PyTorch support", EnablePytorch);
LogBuildFlagStatus("ROS2 support", EnableRos2);
LogBuildFlagStatus("Unity build", EnableUnityBuild);
if (EnableCarSim)
{

View File

@ -8,6 +8,7 @@
#include "Logging/LogMacros.h"
#include "Util/NonCopyable.h"
#include "Modules/ModuleInterface.h"
#include "Stats/Stats.h"
DECLARE_LOG_CATEGORY_EXTERN(LogCarla, Log, All);
DECLARE_LOG_CATEGORY_EXTERN(LogCarlaServer, Log, All);

View File

@ -6,22 +6,14 @@
using UnrealBuildTool;
public class CarlaExporter :
ModuleRules
public class CarlaExporter : ModuleRules
{
public CarlaExporter(ReadOnlyTargetRules Target) :
base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
// PublicIncludePaths.AddRange(new string[] { });
// PrivateIncludePaths.AddRange(new string[] { });
PublicDependencyModuleNames.AddRange(new string[]
{
"Core",
});
PublicDependencyModuleNames.Add("Core");
PrivateDependencyModuleNames.AddRange(new string[]
{
@ -36,7 +28,5 @@ public class CarlaExporter :
"Chaos",
"EditorStyle",
});
// DynamicallyLoadedModuleNames.AddRange(new string[] { });
}
}

View File

@ -16,9 +16,6 @@ public class CarlaTools :
[CommandLine("-nv-omniverse")]
bool EnableNVIDIAOmniverse = false;
[CommandLine("-unity")]
bool EnableUnityBuild = false;
[CommandLine("-carla-install-path")]
string CarlaInstallPath = null;
@ -27,6 +24,12 @@ public class CarlaTools :
private static void LogFlagStatus(string name, bool value)
{
var state = value ? "enabled" : "disabled";
Console.WriteLine(string.Format("{0} is {1}.", name, state));
}
public static string FindLibrary(string SearchPath, params string[] Patterns)
{
foreach (var Pattern in Patterns)
@ -58,18 +61,8 @@ public class CarlaTools :
public CarlaTools(ReadOnlyTargetRules Target) :
base(Target)
{
bool IsWindows = Target.Platform == UnrealTargetPlatform.Win64;
bLegacyPublicIncludePaths = false;
ModuleIncludePathWarningLevel = WarningLevel.Warning;
ModuleIncludeSubdirectoryWarningLevel = WarningLevel.Warning;
ShadowVariableWarningLevel = WarningLevel.Warning;
UnsafeTypeCastWarningLevel = WarningLevel.Warning;
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
CppStandard = CppStandardVersion.Cpp20;
bEnableExceptions = bEnableExceptions || IsWindows;
bUseUnity = EnableUnityBuild;
CppStandard = CppStandardVersion.Cpp20;
LogFlagStatus("Houdini support", EnableHoudini);
LogFlagStatus("NVIDIA Omniverse support", EnableNVIDIAOmniverse);
var DirectoryInfo = new DirectoryInfo(ModuleDirectory);
for (int i = 0; i != 6; ++i)
@ -95,21 +88,12 @@ public class CarlaTools :
Console.WriteLine("Using \"" + CarlaDependenciesPath + "\" as the CARLA depenencies install path.");
}
bool IsWindows = Target.Platform == UnrealTargetPlatform.Win64;
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
bEnableExceptions = bEnableExceptions || IsWindows;
// PrivatePCHHeaderFile = "Carla.h";
Action<string, bool> LogBuildFlagStatus = (name, enabled) =>
{
Console.WriteLine(
string.Format(
"{0} is {1}.",
name,
enabled ? "enabled" : "disabled"));
};
LogBuildFlagStatus("Houdini support", EnableHoudini);
LogBuildFlagStatus("NVIDIA Omniverse support", EnableNVIDIAOmniverse);
LogBuildFlagStatus("Unity build", EnableUnityBuild);
// PublicIncludePaths.AddRange(new string[] { });
// PrivateIncludePaths.AddRange(new string[] { });
@ -152,8 +136,8 @@ public class CarlaTools :
});
if (EnableHoudini)
{
PrivateDependencyModuleNames.AddRange(new string[]
{
PrivateDependencyModuleNames.AddRange(new string[]
{
"HoudiniEngine",
"HoudiniEngineEditor",
@ -162,15 +146,22 @@ public class CarlaTools :
}
if (EnableNVIDIAOmniverse)
{
PrivateDependencyModuleNames.AddRange(new string[]
{
PublicDefinitions.Add("WITH_OMNIVERSE");
PrivateDefinitions.Add("WITH_OMNIVERSE");
PrivateDependencyModuleNames.AddRange(new string[]
{
"OmniverseUSD",
"OmniverseRuntime"
});
}
// DynamicallyLoadedModuleNames.AddRange(new string[] { });
PrivateDefinitions.Add("BOOST_DISABLE_ABI_HEADERS");
PrivateDefinitions.Add("BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY");
PrivateDefinitions.Add("ASIO_NO_EXCEPTIONS");
PrivateDefinitions.Add("BOOST_NO_EXCEPTIONS");
PrivateDefinitions.Add("LIBCARLA_NO_EXCEPTIONS");
PrivateDefinitions.Add("PUGIXML_NO_EXCEPTIONS");
var LibraryPrefix = IsWindows ? "" : "lib";
var LibrarySuffix = IsWindows ? ".lib" : ".a";
@ -233,13 +224,5 @@ public class CarlaTools :
GetIncludePath("zlib"),
});
PrivateIncludePaths.Add(LibCarlaIncludePath);
PrivateDefinitions.Add("BOOST_DISABLE_ABI_HEADERS");
PrivateDefinitions.Add("BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY");
PrivateDefinitions.Add("ASIO_NO_EXCEPTIONS");
PrivateDefinitions.Add("BOOST_NO_EXCEPTIONS");
PrivateDefinitions.Add("LIBCARLA_NO_EXCEPTIONS");
PrivateDefinitions.Add("PUGIXML_NO_EXCEPTIONS");
if (EnableHoudini)
PrivateDefinitions.Add("CARLA_HOUDINI_ENABLED");
}
}

View File

@ -7,7 +7,13 @@ using EpicGames.Core;
public class CarlaUE4Target : TargetRules
{
[CommandLine("-unity-build")]
bool EnableUnityBuild = false;
bool EnableUnityBuild = true;
private static void LogFlagStatus(string name, bool value)
{
var state = value ? "enabled" : "disabled";
Console.WriteLine(string.Format("{0} is {1}.", name, state));
}
public CarlaUE4Target(TargetInfo Target) :
base(Target)
@ -16,7 +22,8 @@ public class CarlaUE4Target : TargetRules
ExtraModuleNames.Add("CarlaUE4");
Console.WriteLine("Unity build is disabled.");
LogFlagStatus("Unity build", EnableUnityBuild);
bUseUnityBuild = EnableUnityBuild;
bForceUnityBuild = EnableUnityBuild;
bUseAdaptiveUnityBuild = EnableUnityBuild;

View File

@ -1,10 +1,24 @@
// Fill out your copyright notice in the Description page of Project Settings.
using EpicGames.Core;
using System;
using UnrealBuildTool;
public class CarlaUE4 : ModuleRules
{
public CarlaUE4(ReadOnlyTargetRules Target) : base(Target)
[CommandLine("-slate-ui")]
bool EnableSlateUI = false;
[CommandLine("-online-subsys")]
bool EnableOnlineSubSys = false;
private static void LogFlagStatus(string name, bool value)
{
var state = value ? "enabled" : "disabled";
Console.WriteLine(string.Format("{0} is {1}.", name, state));
}
public CarlaUE4(ReadOnlyTargetRules Target) : base(Target)
{
PrivatePCHHeaderFile = "CarlaUE4.h";
@ -19,14 +33,16 @@ public class CarlaUE4 : ModuleRules
if (Target.Type == TargetType.Editor)
PublicDependencyModuleNames.Add("UnrealEd");
PrivateDependencyModuleNames.AddRange(new string[] { });
LogFlagStatus("Slate UI", EnableSlateUI);
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
if (EnableSlateUI)
PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
LogFlagStatus("Online Subsystem", EnableOnlineSubSys);
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
}
if (EnableOnlineSubSys)
PrivateDependencyModuleNames.Add("OnlineSubsystem");
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
}
}

View File

@ -7,7 +7,13 @@ using EpicGames.Core;
public class CarlaUE4EditorTarget : TargetRules
{
[CommandLine("-unity-build")]
bool EnableUnityBuild = false;
bool EnableUnityBuild = true;
private static void LogFlagStatus(string name, bool value)
{
var state = value ? "enabled" : "disabled";
Console.WriteLine(string.Format("{0} is {1}.", name, state));
}
public CarlaUE4EditorTarget(TargetInfo Target) :
base(Target)
@ -16,9 +22,13 @@ public class CarlaUE4EditorTarget : TargetRules
ExtraModuleNames.Add("CarlaUE4");
Console.WriteLine("Unity build is disabled.");
bUseUnityBuild = EnableUnityBuild;
bForceUnityBuild = EnableUnityBuild;
bUseAdaptiveUnityBuild = EnableUnityBuild;
LogFlagStatus("Unity build", EnableUnityBuild);
if (!EnableUnityBuild)
{
bUseUnityBuild =
bForceUnityBuild =
bUseAdaptiveUnityBuild = false;
}
}
}