Eliminate lpx-paths.hpp, which contains hardwired paths.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -37,7 +37,6 @@ Binaries/**
|
||||
User/**
|
||||
.vs/**
|
||||
|
||||
Source/Integration/lpx-paths.hpp
|
||||
|
||||
luprex/build/**
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
#include "LockedWrapper.h"
|
||||
#include "lpx-drvutil.hpp"
|
||||
#include "lpx-paths.hpp"
|
||||
#include "Misc/Paths.h"
|
||||
|
||||
using namespace LpxCommonTypes;
|
||||
|
||||
@@ -17,7 +17,13 @@ void FlxLockedWrapper::InitWrapper() {
|
||||
// Already initialized.
|
||||
return;
|
||||
}
|
||||
FString dll((const UTF8CHAR*)LUPREX_DLL_PATH);
|
||||
#if PLATFORM_LINUX
|
||||
FString dll = FPaths::Combine(FPaths::ProjectDir(), TEXT("luprex/build/Linux/luprexlib.so"));
|
||||
#elif PLATFORM_WINDOWS
|
||||
FString dll = FPaths::Combine(FPaths::ProjectDir(), TEXT("luprex/build/Windows/luprexlib.dll"));
|
||||
#else
|
||||
#error "Unsupported platform"
|
||||
#endif
|
||||
UE_LOG(LogLuprex, Verbose, TEXT("Luprex DLL Path: %s"), *dll);
|
||||
void* DLL = FPlatformProcess::GetDllHandle(*dll);
|
||||
if (DLL != nullptr) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "LuprexGameModeBase.h"
|
||||
#include "lpx-drvutil.hpp"
|
||||
#include "lpx-paths.hpp"
|
||||
#include "Misc/Paths.h"
|
||||
#include "Tangible.h"
|
||||
#include "TangibleManager.h"
|
||||
#include "LuaCall.h"
|
||||
@@ -41,7 +41,8 @@ uint32 ALuprexGameModeBase::Run() {
|
||||
if (lockedwrap->get_rescan_lua_source(lockedwrap.Get()))
|
||||
{
|
||||
drvutil::ostringstream srcpak;
|
||||
std::string srcpakerr = drvutil::package_lua_source(LUPREX_ROOT_PATH, &srcpak);
|
||||
FString LuprexRoot = FPaths::Combine(FPaths::ProjectDir(), TEXT("luprex"));
|
||||
std::string srcpakerr = drvutil::package_lua_source(TCHAR_TO_UTF8(*LuprexRoot), &srcpak);
|
||||
if (!srcpakerr.empty())
|
||||
{
|
||||
FString FMessage((const UTF8CHAR *)(srcpakerr.c_str()));
|
||||
|
||||
14
build.py
14
build.py
@@ -247,19 +247,6 @@ def generate_buildconfiguration_xml():
|
||||
target2.write_text(template)
|
||||
|
||||
|
||||
def generate_lpx_paths():
|
||||
"""
|
||||
Unreal needs to be able to find the Luprex DLL, and it also needs to find the
|
||||
Lua source code. For now, we just compile some hardwired paths into the
|
||||
binary. Someday we'll do something more sophisticated.
|
||||
"""
|
||||
target = Path(f"{INTEGRATION}/Source/Integration/lpx-paths.hpp")
|
||||
line1 = f'#define LUPREX_DLL_PATH "{INTEGRATION}/luprex/build/{OS}/luprexlib.{DLL}"'
|
||||
line2 = f'#define LUPREX_ROOT_PATH "{INTEGRATION}/luprex"'
|
||||
code = line1 + "\n" + line2 + "\n"
|
||||
target.unlink(missing_ok=True)
|
||||
target.write_text(code)
|
||||
|
||||
|
||||
def generate_integration_uproject():
|
||||
"""
|
||||
@@ -406,7 +393,6 @@ if MODE == "code-workspace":
|
||||
if MODE == "all":
|
||||
unzip_unreal_engine_and_apply_patch()
|
||||
generate_buildconfiguration_xml()
|
||||
generate_lpx_paths()
|
||||
generate_integration_uproject()
|
||||
run_unrealengine_setup_bat_replacement()
|
||||
run_generateprojectfiles_in_sandbox()
|
||||
|
||||
Reference in New Issue
Block a user