diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs index e9a43b2f3..e74c4bf22 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs @@ -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) { diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.h index c95ec777b..07f249bdb 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.h @@ -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); diff --git a/Unreal/CarlaUE4/Plugins/CarlaExporter/Source/CarlaExporter/CarlaExporter.Build.cs b/Unreal/CarlaUE4/Plugins/CarlaExporter/Source/CarlaExporter/CarlaExporter.Build.cs index f842db0d8..e1391b73a 100644 --- a/Unreal/CarlaUE4/Plugins/CarlaExporter/Source/CarlaExporter/CarlaExporter.Build.cs +++ b/Unreal/CarlaUE4/Plugins/CarlaExporter/Source/CarlaExporter/CarlaExporter.Build.cs @@ -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[] { }); } } diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs index d2b500b90..07aafb9a3 100644 --- a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs +++ b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs @@ -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 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"); } } diff --git a/Unreal/CarlaUE4/Source/CarlaUE4.Target.cs b/Unreal/CarlaUE4/Source/CarlaUE4.Target.cs index 5c5096cb9..3fe660e24 100644 --- a/Unreal/CarlaUE4/Source/CarlaUE4.Target.cs +++ b/Unreal/CarlaUE4/Source/CarlaUE4.Target.cs @@ -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; diff --git a/Unreal/CarlaUE4/Source/CarlaUE4/CarlaUE4.Build.cs b/Unreal/CarlaUE4/Source/CarlaUE4/CarlaUE4.Build.cs index 722d56acf..e5418362b 100644 --- a/Unreal/CarlaUE4/Source/CarlaUE4/CarlaUE4.Build.cs +++ b/Unreal/CarlaUE4/Source/CarlaUE4/CarlaUE4.Build.cs @@ -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 + } } diff --git a/Unreal/CarlaUE4/Source/CarlaUE4Editor.Target.cs b/Unreal/CarlaUE4/Source/CarlaUE4Editor.Target.cs index 78e82e33e..8e1c53ad3 100644 --- a/Unreal/CarlaUE4/Source/CarlaUE4Editor.Target.cs +++ b/Unreal/CarlaUE4/Source/CarlaUE4Editor.Target.cs @@ -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; + } } }