From 76d73a6a3538ae06b0f92af8c55ca5e686c24ccc Mon Sep 17 00:00:00 2001 From: BeastLe9enD Date: Sat, 5 Apr 2025 14:47:00 +0200 Subject: [PATCH] Initial project build steps --- .gitignore | 16 +++++++++- Source/LandOfBarl.Target.cs | 8 ++--- Source/LandOfBarl/Bridge.cpp | 0 Source/LandOfBarl/Bridge.h | 2 ++ Source/LandOfBarl/LandOfBarl.Build.cs | 43 +++++++++++++++++---------- Source/LandOfBarl/LandOfBarl.cpp | 2 -- Source/LandOfBarl/LandOfBarl.h | 2 -- Source/LandOfBarlEditor.Target.cs | 8 ++--- 8 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 Source/LandOfBarl/Bridge.cpp create mode 100644 Source/LandOfBarl/Bridge.h diff --git a/.gitignore b/.gitignore index f4334a5..b38b1c7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ Binaries DerivedDataCache Intermediate Saved +Build .vscode .vs *.VC.db @@ -11,4 +12,17 @@ Saved *.sln *.suo *.xcodeproj -*.xcworkspace \ No newline at end of file +*.xcworkspace + +# IntelliJ +.idea/ +*.DS_Store* +*.DotSettings.user + +# Rust crate +Source/land_of_barl/.idea/ +Source/land_of_barl/Cargo.lock +Source/land_of_barl/gen/ +Source/land_of_barl/target/ + + diff --git a/Source/LandOfBarl.Target.cs b/Source/LandOfBarl.Target.cs index 6d7104b..c4a1946 100644 --- a/Source/LandOfBarl.Target.cs +++ b/Source/LandOfBarl.Target.cs @@ -1,12 +1,8 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - using UnrealBuildTool; using System.Collections.Generic; -public class LandOfBarlTarget : TargetRules -{ - public LandOfBarlTarget(TargetInfo Target) : base(Target) - { +public class LandOfBarlTarget : TargetRules { + public LandOfBarlTarget(TargetInfo Target) : base(Target) { Type = TargetType.Game; DefaultBuildSettings = BuildSettingsVersion.V5; IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_5; diff --git a/Source/LandOfBarl/Bridge.cpp b/Source/LandOfBarl/Bridge.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/LandOfBarl/Bridge.h b/Source/LandOfBarl/Bridge.h new file mode 100644 index 0000000..3f59c93 --- /dev/null +++ b/Source/LandOfBarl/Bridge.h @@ -0,0 +1,2 @@ +#pragma once + diff --git a/Source/LandOfBarl/LandOfBarl.Build.cs b/Source/LandOfBarl/LandOfBarl.Build.cs index c8e92fe..ff909a8 100644 --- a/Source/LandOfBarl/LandOfBarl.Build.cs +++ b/Source/LandOfBarl/LandOfBarl.Build.cs @@ -1,23 +1,36 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - +using System.IO; using UnrealBuildTool; -public class LandOfBarl : ModuleRules -{ - public LandOfBarl(ReadOnlyTargetRules Target) : base(Target) - { +public class LandOfBarl : ModuleRules { + private void AddRustLibrary(ReadOnlyTargetRules Target) { + var CrateDir = Path.Combine(ModuleDirectory, "..", "land_of_barl"); + + var TargetName = "release"; + + var LibraryPath = ""; + if (Target.Platform == UnrealTargetPlatform.Win64) { + LibraryPath = Path.Combine(CrateDir, "target", TargetName, "land_of_barl.lib"); + + PublicSystemLibraries.Add("Bcrypt.Lib"); + PublicSystemLibraries.Add("Ntdll.Lib"); + PublicSystemLibraries.Add("Userenv.Lib"); + PublicSystemLibraries.Add("WSock32.Lib"); + PublicSystemLibraries.Add("WS2_32.Lib"); + } else if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux) { + LibraryPath = Path.Combine(CrateDir, "target", TargetName, "libland_of_barl.a"); + } + + ExternalDependencies.Add(LibraryPath); + PublicAdditionalLibraries.Add(LibraryPath); + } + + public LandOfBarl(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" }); - PrivateDependencyModuleNames.AddRange(new string[] { }); - - // Uncomment if you are using Slate UI - // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); + PrivateDependencyModuleNames.AddRange(new string[] { }); - // Uncomment if you are using online features - // PrivateDependencyModuleNames.Add("OnlineSubsystem"); - - // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true + AddRustLibrary(Target); } -} +} \ No newline at end of file diff --git a/Source/LandOfBarl/LandOfBarl.cpp b/Source/LandOfBarl/LandOfBarl.cpp index 409546b..dd8db81 100644 --- a/Source/LandOfBarl/LandOfBarl.cpp +++ b/Source/LandOfBarl/LandOfBarl.cpp @@ -1,5 +1,3 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - #include "LandOfBarl.h" #include "Modules/ModuleManager.h" diff --git a/Source/LandOfBarl/LandOfBarl.h b/Source/LandOfBarl/LandOfBarl.h index 677c8e2..fe82abe 100644 --- a/Source/LandOfBarl/LandOfBarl.h +++ b/Source/LandOfBarl/LandOfBarl.h @@ -1,5 +1,3 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - #pragma once #include "CoreMinimal.h" diff --git a/Source/LandOfBarlEditor.Target.cs b/Source/LandOfBarlEditor.Target.cs index 9e52788..180cb10 100644 --- a/Source/LandOfBarlEditor.Target.cs +++ b/Source/LandOfBarlEditor.Target.cs @@ -1,12 +1,8 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - using UnrealBuildTool; using System.Collections.Generic; -public class LandOfBarlEditorTarget : TargetRules -{ - public LandOfBarlEditorTarget( TargetInfo Target) : base(Target) - { +public class LandOfBarlEditorTarget : TargetRules { + public LandOfBarlEditorTarget( TargetInfo Target) : base(Target) { Type = TargetType.Editor; DefaultBuildSettings = BuildSettingsVersion.V5; IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_5;