Marcel/package development fix (#8189)

* Add workaround for a development package crash.

* Add Definitions.def file generation. Fix incorrect RecastBuilderPath. Enable option checking in CarlaTools.Build.cs.
This commit is contained in:
MarcelPiNacy-CVC 2024-09-27 11:08:19 +02:00 committed by GitHub
parent 6ee86983a4
commit 078029189b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 183 additions and 121 deletions

View File

@ -44,7 +44,7 @@ project (
LANGUAGES LANGUAGES
C C
CXX CXX
ASM # This is required by some dependencies, such as LibPNG. ASM
DESCRIPTION DESCRIPTION
"Open-source simulator for autonomous driving research." "Open-source simulator for autonomous driving research."
HOMEPAGE_URL HOMEPAGE_URL

View File

@ -58,14 +58,6 @@ if (NOT EXISTS ${CARLA_UE_CONTENT_PATH}/.git)
carla_error ("Missing CARLA content.") carla_error ("Missing CARLA content.")
endif () endif ()
if (ENABLE_ROS2)
set (LAUNCH_ARGS ${LAUNCH_ARGS} --ros2)
endif()
if (ENABLE_ROS2_DEMO)
set (LAUNCH_ARGS ${LAUNCH_ARGS} --ros2-demo)
endif()
set ( set (
UNREAL_EDITOR_PATH UNREAL_EDITOR_PATH
${CARLA_UNREAL_ENGINE_PATH}/Engine/Binaries/${UE_SYSTEM_NAME}/UnrealEditor${EXE_EXT} ${CARLA_UNREAL_ENGINE_PATH}/Engine/Binaries/${UE_SYSTEM_NAME}/UnrealEditor${EXE_EXT}
@ -108,19 +100,44 @@ list (
set (
CARLA_UNREAL_INCLUDE_PATHS_FILE_NAME
Includes.def
)
set (
CARLA_UNREAL_LIBRARIES_PATHS_FILE_NAME
Libraries.def
)
set (
CARLA_UNREAL_DEFINITIONS_FILE_NAME
Options.def
)
set (
CARLA_UNREAL_DEFINITIONS_FILE_NAME
Definitions.def
)
set ( set (
CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH
${CMAKE_CURRENT_BINARY_DIR}/Includes.inc ${CMAKE_CURRENT_BINARY_DIR}/${CARLA_UNREAL_INCLUDE_PATHS_FILE_NAME}
) )
set ( set (
CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH
${CMAKE_CURRENT_BINARY_DIR}/Libraries.inc ${CMAKE_CURRENT_BINARY_DIR}/${CARLA_UNREAL_LIBRARIES_PATHS_FILE_NAME}
) )
set ( set (
CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH CARLA_UNREAL_OPTIONS_FILE_PATH
${CMAKE_CURRENT_BINARY_DIR}/Options.inc ${CMAKE_CURRENT_BINARY_DIR}/${CARLA_UNREAL_OPTIONS_FILE_NAME}
)
set (
CARLA_UNREAL_DEFINITIONS_FILE_PATH
${CMAKE_CURRENT_BINARY_DIR}/${CARLA_UNREAL_DEFINITIONS_FILE_NAME}
) )
set ( set (
@ -152,7 +169,12 @@ foreach (UE_DEP ${UE_DEPENDENCIES})
endif () endif ()
endforeach () endforeach ()
set (UNREAL_PROJECT_OPTIONS) set (
CARLA_UNREAL_DEFINITIONS
RECASTBUILDER_PATH="$<TARGET_FILE:RecastBuilder>"
)
set (CARLA_UNREAL_OPTIONS)
if (ENABLE_ROS2) if (ENABLE_ROS2)
list ( list (
@ -181,14 +203,6 @@ endif()
if (WIN32) if (WIN32)
set (
CARLA_UE_GENERATE_PROJECT_FILES_COMMAND
${CARLA_UNREAL_ENGINE_PATH}/GenerateProjectFiles.bat
-project=${CARLA_UE_PROJECT_PATH}
-CMakefile
-game
-engine
)
set ( set (
CARLA_UE_BUILD_COMMAND_PREFIX CARLA_UE_BUILD_COMMAND_PREFIX
${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/Build.bat ${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/Build.bat
@ -198,14 +212,6 @@ if (WIN32)
${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/RunUAT.bat ${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/RunUAT.bat
) )
else () else ()
set (
CARLA_UE_GENERATE_PROJECT_FILES_COMMAND
${CARLA_UNREAL_ENGINE_PATH}/GenerateProjectFiles.sh
-project=${CARLA_UE_PROJECT_PATH}
-CMakefile
-game
-engine
)
set ( set (
CARLA_UE_BUILD_COMMAND_PREFIX CARLA_UE_BUILD_COMMAND_PREFIX
${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/${UE_SYSTEM_NAME}/Build.sh ${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/${UE_SYSTEM_NAME}/Build.sh
@ -218,41 +224,6 @@ endif ()
if (CMAKE_TOOLCHAIN_FILE)
cmake_path (
ABSOLUTE_PATH
CMAKE_TOOLCHAIN_FILE
BASE_DIRECTORY
${CARLA_WORKSPACE_PATH}
NORMALIZE
OUTPUT_VARIABLE
TOOLCHAIN_FILE
)
set (
TOOLCHAIN_FILE_OPTION
--toolchain=${TOOLCHAIN_FILE}
)
else ()
set (TOOLCHAIN_FILE_OPTION)
endif ()
set (
CARLA_UNREAL_CONFIGURE_OUTPUTS
${CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH}
${CARLA_UE_CARLA_PATH}/Includes.def
${CARLA_UE_CARLA_TOOLS_PATH}/Includes.def
${CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH}
${CARLA_UE_CARLA_PATH}/Libraries.def
${CARLA_UE_CARLA_TOOLS_PATH}/Libraries.def
${CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH}
${CARLA_UE_CARLA_PATH}/Options.def
${CARLA_UE_CARLA_TOOLS_PATH}/Options.def
)
file ( file (
GENERATE GENERATE
OUTPUT OUTPUT
@ -272,20 +243,70 @@ file (
file ( file (
GENERATE GENERATE
OUTPUT OUTPUT
${CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH} ${CARLA_UNREAL_OPTIONS_FILE_PATH}
CONTENT CONTENT
"${CARLA_UNREAL_OPTIONS}" "${CARLA_UNREAL_OPTIONS}"
) )
file (
GENERATE
OUTPUT
${CARLA_UNREAL_DEFINITIONS_FILE_PATH}
CONTENT
"${CARLA_UNREAL_DEFINITIONS}"
)
set (
CARLA_UNREAL_CONFIGURE_OUTPUTS
${CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH}
${CARLA_UE_CARLA_PATH}/${CARLA_UNREAL_INCLUDE_PATHS_FILE_NAME}
${CARLA_UE_CARLA_TOOLS_PATH}/${CARLA_UNREAL_INCLUDE_PATHS_FILE_NAME}
${CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH}
${CARLA_UE_CARLA_PATH}/${CARLA_UNREAL_LIBRARIES_PATHS_FILE_NAME}
${CARLA_UE_CARLA_TOOLS_PATH}/${CARLA_UNREAL_LIBRARIES_PATHS_FILE_NAME}
${CARLA_UNREAL_OPTIONS_FILE_PATH}
${CARLA_UE_CARLA_PATH}/${CARLA_UNREAL_OPTIONS_FILE_NAME}
${CARLA_UE_CARLA_TOOLS_PATH}/${CARLA_UNREAL_OPTIONS_FILE_NAME}
${CARLA_UNREAL_DEFINITIONS_FILE_PATH}
${CARLA_UE_CARLA_PATH}/${CARLA_UNREAL_DEFINITIONS_FILE_NAME}
${CARLA_UE_CARLA_TOOLS_PATH}/${CARLA_UNREAL_DEFINITIONS_FILE_NAME}
)
set (CARLA_UNREAL_CONFIGURE_COMMANDS)
set (
CARLA_UNREAL_DEF_FILES
${CARLA_UNREAL_INCLUDE_PATHS_FILE_NAME}
${CARLA_UNREAL_LIBRARIES_PATHS_FILE_NAME}
${CARLA_UNREAL_OPTIONS_FILE_NAME}
${CARLA_UNREAL_DEFINITIONS_FILE_NAME}
)
foreach (DEF_FILE ${CARLA_UNREAL_DEF_FILES})
list (
APPEND
CARLA_UNREAL_CONFIGURE_COMMANDS
COMMAND
${CMAKE_COMMAND}
ARGS
-E create_symlink
${CMAKE_CURRENT_BINARY_DIR}/${DEF_FILE}
${CARLA_UE_CARLA_PATH}/${DEF_FILE}
COMMAND
${CMAKE_COMMAND}
ARGS
-E create_symlink
${CMAKE_CURRENT_BINARY_DIR}/${DEF_FILE}
${CARLA_UE_CARLA_TOOLS_PATH}/${DEF_FILE}
)
endforeach ()
add_custom_command ( add_custom_command (
OUTPUT OUTPUT
${CARLA_UNREAL_CONFIGURE_OUTPUTS} ${CARLA_UNREAL_CONFIGURE_OUTPUTS}
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH} ${CARLA_UE_CARLA_PATH}/Includes.def ${CARLA_UNREAL_CONFIGURE_COMMANDS}
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH} ${CARLA_UE_CARLA_TOOLS_PATH}/Includes.def
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH} ${CARLA_UE_CARLA_PATH}/Libraries.def
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH} ${CARLA_UE_CARLA_TOOLS_PATH}/Libraries.def
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH} ${CARLA_UE_CARLA_PATH}/Options.def
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH} ${CARLA_UE_CARLA_TOOLS_PATH}/Options.def
USES_TERMINAL USES_TERMINAL
VERBATIM VERBATIM
) )
@ -296,6 +317,12 @@ add_custom_target (
${CARLA_UNREAL_CONFIGURE_OUTPUTS} ${CARLA_UNREAL_CONFIGURE_OUTPUTS}
) )
list (
APPEND
UE_DEPENDENCIES_ORDER_ONLY
carla-unreal-configure
)
file ( file (
@ -316,8 +343,6 @@ carla_add_custom_target (
-project=${CARLA_UE_PROJECT_PATH} -project=${CARLA_UE_PROJECT_PATH}
-game -game
-buildscw -buildscw
DEPENDS
${CARLA_UNREAL_CONFIGURE_OUTPUTS}
USES_TERMINAL USES_TERMINAL
VERBATIM VERBATIM
) )
@ -397,11 +422,9 @@ function (
-prereqs -prereqs
-build -build
-archivedirectory=${CARLA_PACKAGE_PATH} -archivedirectory=${CARLA_PACKAGE_PATH}
DEPENDS USES_TERMINAL
${CARLA_UNREAL_CONFIGURE_OUTPUTS} VERBATIM
USES_TERMINAL )
VERBATIM
)
add_custom_command ( add_custom_command (
TARGET ${TARGET_NAME} TARGET ${TARGET_NAME}
@ -468,6 +491,16 @@ add_carla_ue_package_target(Test Test)
set (LAUNCH_ARGS ${CARLA_LAUNCH_ARGS})
if (ENABLE_ROS2)
list (APPEND LAUNCH_ARGS --ros2)
endif()
if (ENABLE_ROS2_DEMO)
list (APPEND LAUNCH_ARGS --ros2-demo)
endif()
set ( set (
CARLA_LAUNCH_TARGET_OPTIONS CARLA_LAUNCH_TARGET_OPTIONS
COMMENT COMMENT

View File

@ -6,17 +6,17 @@ CopyrightNotice="Copyright (c) 2024 Computer Vision Center (CVC) at the Universi
ProjectVersion=0.10.0 ProjectVersion=0.10.0
[/Script/Carla.CarlaSettings] [/Script/Carla.CarlaSettings]
+LowRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SimpleRoad/CheapRoad.CheapRoad"',MaterialSlotName="Tileroad_Road",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000)) # +LowRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SimpleRoad/CheapRoad.CheapRoad"',MaterialSlotName="Tileroad_Road",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
+LowRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SimpleRoad/CheapSideWalkCurb.CheapSideWalkCurb"',MaterialSlotName="TileRoad_Curb",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000)) # +LowRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SimpleRoad/CheapSideWalkCurb.CheapSideWalkCurb"',MaterialSlotName="TileRoad_Curb",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
+LowRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SimpleRoad/CheapSideWalk_00.CheapSideWalk_00"',MaterialSlotName="Tileroad_Sidewalk",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000)) # +LowRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SimpleRoad/CheapSideWalk_00.CheapSideWalk_00"',MaterialSlotName="Tileroad_Sidewalk",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
+LowRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SimpleRoad/CheapLaneMarking.CheapLaneMarking"',MaterialSlotName="TileRoad_LaneMarkingSolid",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000)) # +LowRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SimpleRoad/CheapLaneMarking.CheapLaneMarking"',MaterialSlotName="TileRoad_LaneMarkingSolid",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
# +EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/WetPavement/WetPavement_Complex_Road_N2.WetPavement_Complex_Road_N2"',MaterialSlotName="Tileroad_Road",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
# +EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/WetPavement/WetPavement_Complex_Concrete.WetPavement_Complex_Concrete"',MaterialSlotName="TileRoad_Curb",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
# +EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SideWalks/SidewalkN4/WetPavement_SidewalkN4.WetPavement_SidewalkN4"',MaterialSlotName="Tileroad_Sidewalk",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
# +EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/LaneMarking/Lanemarking.Lanemarking"',MaterialSlotName="TileRoad_LaneMarkingSolid",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
LowLightFadeDistance=1000.000000 LowLightFadeDistance=1000.000000
LowStaticMeshMaxDrawDistance=10000.000000 LowStaticMeshMaxDrawDistance=10000.000000
LowRoadPieceMeshMaxDrawDistance=15000.000000 LowRoadPieceMeshMaxDrawDistance=15000.000000
+EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/WetPavement/WetPavement_Complex_Road_N2.WetPavement_Complex_Road_N2"',MaterialSlotName="Tileroad_Road",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
+EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/WetPavement/WetPavement_Complex_Concrete.WetPavement_Complex_Concrete"',MaterialSlotName="TileRoad_Curb",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
+EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SideWalks/SidewalkN4/WetPavement_SidewalkN4.WetPavement_SidewalkN4"',MaterialSlotName="Tileroad_Sidewalk",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
+EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/LaneMarking/Lanemarking.Lanemarking"',MaterialSlotName="TileRoad_LaneMarkingSolid",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000))
[/Script/UnrealEd.ProjectPackagingSettings] [/Script/UnrealEd.ProjectPackagingSettings]
Build=IfProjectHasCode Build=IfProjectHasCode
@ -36,8 +36,9 @@ HttpChunkInstallDataDirectory=(Path="")
HttpChunkInstallDataVersion= HttpChunkInstallDataVersion=
IncludePrerequisites=True IncludePrerequisites=True
IncludeAppLocalPrerequisites=False IncludeAppLocalPrerequisites=False
bShareMaterialShaderCode=False bShareMaterialShaderCode=True
bSharedMaterialNativeLibraries=False bSharedMaterialNativeLibraries=True
bDeterministicShaderCodeOrder=True
ApplocalPrerequisitesDirectory=(Path="") ApplocalPrerequisitesDirectory=(Path="")
IncludeCrashReporter=False IncludeCrashReporter=False
InternationalizationPreset=English InternationalizationPreset=English

View File

@ -1,3 +1,4 @@
Includes.def Includes.def
Libraries.def Libraries.def
Options.def Options.def
Definitions.def

View File

@ -35,6 +35,11 @@ public class Carla :
public Carla(ReadOnlyTargetRules Target) : public Carla(ReadOnlyTargetRules Target) :
base(Target) base(Target)
{ {
bool IsWindows = Target.Platform == UnrealTargetPlatform.Win64;
PrivatePCHHeaderFile = "Carla.h";
bEnableExceptions = true;
void AddDynamicLibrary(string library) void AddDynamicLibrary(string library)
{ {
PublicAdditionalLibraries.Add(library); PublicAdditionalLibraries.Add(library);
@ -42,31 +47,31 @@ public class Carla :
PublicDelayLoadDLLs.Add(library); PublicDelayLoadDLLs.Add(library);
Console.WriteLine("Dynamic Library Added: " + library); Console.WriteLine("Dynamic Library Added: " + library);
} }
foreach (var Definition in File.ReadAllText(Path.Combine(PluginDirectory, "Definitions.def")).Split(';'))
PrivateDefinitions.Add(Definition.Trim());
Console.WriteLine("PluginDirectory: " + PluginDirectory); foreach (var Option in File.ReadAllText(Path.Combine(PluginDirectory, "Options.def")).Split(';'))
foreach (var option in File.ReadAllText(Path.Combine(PluginDirectory, "Options.def")).Split(';'))
{ {
string optionTrimmed = option.Trim(); string Trimmed = Option.Trim();
if (optionTrimmed.Equals("ROS2")) switch (Trimmed)
{ {
EnableRos2 = true; case "ROS2":
} EnableRos2 = true;
else if (optionTrimmed.Equals("ROS2_DEMO")) break;
{ case "ROS2_DEMO":
EnableRos2 = true; EnableRos2 = true;
EnableRos2Demo = true; EnableRos2Demo = true;
} break;
else if(optionTrimmed.Equals("OSM2ODR")) case "OSM2ODR":
{ EnableOSM2ODR = true;
EnableOSM2ODR = true; break;
default:
Console.WriteLine($"Unknown option \"{Trimmed}\".");
break;
} }
} }
bool IsWindows = Target.Platform == UnrealTargetPlatform.Win64;
PrivatePCHHeaderFile = "Carla.h";
bEnableExceptions = true;
Action<bool, string, string> TestOptionalFeature = (enable, name, definition) => Action<bool, string, string> TestOptionalFeature = (enable, name, definition) =>
{ {
if (enable) if (enable)

View File

@ -31,24 +31,25 @@
#include "Misc/FileHelper.h" #include "Misc/FileHelper.h"
#include "Misc/Paths.h" #include "Misc/Paths.h"
#define TO_STRING_EXPAND(s) #s
#define TO_STRING(s) TO_STRING_EXPAND(s)
constexpr TCHAR DefaultRecastBuilderPath[] = TEXT(TO_STRING(RECASTBUILDER_PATH));
static FString BuildRecastBuilderFile() static FString BuildRecastBuilderFile()
{ {
// Define filename with extension depending on if we are on Windows or not auto Path = FPaths::RootDir();
#if PLATFORM_WINDOWS #if PLATFORM_WINDOWS
const FString RecastToolName = "RecastBuilder.exe"; Path += TEXT("Tools/RecastBuilder.exe");
#else #else
const FString RecastToolName = "RecastBuilder"; Path += TEXT("Tools/RecastBuilder");
#endif // PLATFORM_WINDOWS
// Define path depending on the UE4 build type (Package or Editor)
#if UE_BUILD_SHIPPING
const FString AbsoluteRecastBuilderPath = FPaths::ConvertRelativePathToFull(
FPaths::RootDir() + "Tools/" + RecastToolName);
#else
const FString AbsoluteRecastBuilderPath = FPaths::ConvertRelativePathToFull(
FPaths::ProjectDir() + "../../Build/_deps/recastnavigation-build/RecastBuilder/" + RecastToolName);
#endif #endif
return AbsoluteRecastBuilderPath; Path = FPaths::ConvertRelativePathToFull(Path);
if (FPaths::FileExists(Path))
return Path;
else
return DefaultRecastBuilderPath;
} }
static FString UCarlaEpisode_GetTrafficSignId(ETrafficSignState State) static FString UCarlaEpisode_GetTrafficSignId(ETrafficSignState State)

View File

@ -1,3 +1,4 @@
Includes.def Includes.def
Libraries.def Libraries.def
Options.def Options.def
Definitions.def

View File

@ -27,6 +27,26 @@ public class CarlaTools :
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
bEnableExceptions = true; bEnableExceptions = true;
foreach (var Definition in File.ReadAllText(Path.Combine(PluginDirectory, "Definitions.def")).Split(';'))
PrivateDefinitions.Add(Definition.Trim());
foreach (var Option in File.ReadAllText(Path.Combine(PluginDirectory, "Options.def")).Split(';'))
{
string Trimmed = Option.Trim();
switch (Trimmed)
{
case "NV_OMNIVERSE":
EnableNVIDIAOmniverse = true;
break;
case "OSM2ODR":
EnableOSM2ODR = true;
break;
default:
Console.WriteLine($"Unknown option \"{Trimmed}\".");
break;
}
}
Action<bool, string, string> TestOptionalFeature = (enable, name, definition) => Action<bool, string, string> TestOptionalFeature = (enable, name, definition) =>
{ {
if (enable) if (enable)