From 431fe2afc5395985386ab9835f226c0bd46998f1 Mon Sep 17 00:00:00 2001 From: J Reece Wilson Date: Sun, 20 Mar 2022 08:01:11 +0000 Subject: [PATCH] [*] Linux Fixes [*] Update readme [*] Fix single arch sln regression --- Core/BuildHooks/BuildHooks.lua | 19 +++++++++++++------ Core/JSON/jsonProjectBase.lua | 9 ++++++++- Core/Target/Target.lua | 4 ++-- Public/api.lua | 4 ++-- Public/premake5.lua | 4 ++-- README_Developers.txt | 2 +- Utilities/requireAbs.lua | 4 +++- linux_x64 | 4 ++-- 8 files changed, 33 insertions(+), 17 deletions(-) mode change 100644 => 100755 linux_x64 diff --git a/Core/BuildHooks/BuildHooks.lua b/Core/BuildHooks/BuildHooks.lua index ff2f9b1..dcfe3df 100644 --- a/Core/BuildHooks/BuildHooks.lua +++ b/Core/BuildHooks/BuildHooks.lua @@ -67,9 +67,9 @@ local function addUserDestCopy(name, type, config, platformName, arch, dir) platform.devChainSupportsElfStrip and config ~= Aurora.Settings.sNameOfDebug) then local debugSymbolPath = normalizeCpyPath(Aurora.Settings.sAbsSymbols) .. "/" .. name .. ".dwarf" - postbuildcommands("objcopy --strip-debug " .. file .. " " .. outputPath) + postbuildcommands("objcopy --strip-debug \"" .. file .. "\" \"" .. outputPath .. "\\") if (Aurora.Settings.bUseAuBuildHooks and config ~= Aurora.Settings.sNameOfShip) then - postbuildcommands("objcopy --add-gnu-debuglink=" .. debugSymbolPath .. " " .. outputPath) + postbuildcommands("objcopy --add-gnu-debuglink=\"" .. debugSymbolPath .. "\" \"" .. outputPath .. "\"") end else postbuildcommands(copy) @@ -103,6 +103,8 @@ local function addDest(name, projectType, dest) end local function postBuildCommands(name, type, config, platformName, arch) + local compilerDirectOutput = nil + if (platformName == "win32") then postbuildcommands(formatCpy(Aurora.Settings.sLibPrefix .. name, type, normalizeCpyPath(Aurora.Settings.sAbsSymbols), ".pdb", true, config, platformName, arch, name)) @@ -111,11 +113,16 @@ local function postBuildCommands(name, type, config, platformName, arch) postbuildcommands(formatCpy(Aurora.Settings.sLibPrefix .. name, type, normalizeCpyPath(Aurora.Settings.sAbsLinkLibs), ".lib", true, config, platformName, arch, name)) end else + local ext = (Aurora.Platforms[platformName].exts[type] or "") if (type == "SharedLib" or type == "StaticLib") then - local ext = (auFetchGlobal("Platforms")[platformName][type] or "") - postbuildcommands(formatCpy(Aurora.Settings.sLibPrefix .. name, type, normalizeCpyPath(Aurora.Settings.sAbsLinkLibs), ext, true, config, platformName, arch, name)) + local ext = (Aurora.Platforms[platformName].exts[type] or "") + local cmd = nil + cmd, compilerDirectOutput = formatCpy(Aurora.Settings.sLibPrefix .. name, type, normalizeCpyPath(Aurora.Settings.sAbsLinkLibs), ext, false, config, platformName, arch, name) + postbuildcommands(cmd) end + local idc = nil + idc, idc, compilerDirectOutput = formatCpy(Aurora.Settings.sLibPrefix .. name, type, normalizeCpyPath(Aurora.Settings.sAbsLinkLibs), ext, false, config, platformName, arch, name) end if (config == Aurora.Settings.sNameOfDebug) then @@ -134,7 +141,7 @@ local function postBuildCommands(name, type, config, platformName, arch) platform.devChainSupportsElfStrip) then debugEx = ".dwarf" debugSymbolPath = normalizeCpyPath(Aurora.Settings.sAbsSymbols) .. "/" .. name .. ".dwarf" - postbuildcommands("objcopy --only-keep-debug " .. debugSymbolPath .. " " .. debugSymbolPath) + postbuildcommands("objcopy --only-keep-debug \"" .. compilerDirectOutput .. "\" \"" .. debugSymbolPath .. "\"") elseif (isWin) then debugEx = ".pdb" debugSymbolPath = normalizeCpyPath(Aurora.Settings.sAbsSymbols) .. "/" .. name .. ".pdb" @@ -163,4 +170,4 @@ end return { startProject = startProject, addDest = addDest -} \ No newline at end of file +} diff --git a/Core/JSON/jsonProjectBase.lua b/Core/JSON/jsonProjectBase.lua index b27b5ff..9cf0ef0 100644 --- a/Core/JSON/jsonProjectBase.lua +++ b/Core/JSON/jsonProjectBase.lua @@ -125,12 +125,19 @@ function JsonProcessor(info) dest = info.out, noLink = result.noLink } + if (result.noLink) then print("noLink is deprecated. Use projectType: none") project.projectType = "none" info.projectType = "none" end + + if (project.projectType == "none") then + if (os.host() == "linux") then + project.projectType = "utility" + end + end if (result.type:lower() == "aurora") then @@ -204,4 +211,4 @@ function JsonProcessor(info) end -return JsonProcessor \ No newline at end of file +return JsonProcessor diff --git a/Core/Target/Target.lua b/Core/Target/Target.lua index c209229..4f318a0 100644 --- a/Core/Target/Target.lua +++ b/Core/Target/Target.lua @@ -72,8 +72,8 @@ local function startSolution() _G.platforms(platforms) if (not _auExtendedArch) then + local arch = _auCurrentArchs[1] auForEach(_auCurrentPlatforms, function(platform) - auFilter({"platforms:"..platform}) system(Aurora.Platforms[platform].system) architecture(Aurora.Architectures[arch].architecture) @@ -263,4 +263,4 @@ return { auFilterOf = auFilterOf, auFilterForArchs = auFilterForArchs, defineOutputNames = defineOutputNames -} \ No newline at end of file +} diff --git a/Public/api.lua b/Public/api.lua index 70f78bd..f28b2c3 100644 --- a/Public/api.lua +++ b/Public/api.lua @@ -1,7 +1,7 @@ -- private local buildAction = auRequire("Core/Actions") local target = auRequire("Core/Target") -local main = auRequire("Core/Main") +local main = auRequire("Core/main") local resourceCompiler = auRequire("Core/ResourceCompiler") local protobuf = auRequire("Core/Protobuf") local vala = auRequire("Core/Vala") @@ -164,4 +164,4 @@ end function auAddVala(info) vala(info) -end \ No newline at end of file +end diff --git a/Public/premake5.lua b/Public/premake5.lua index 2dfbaed..bae7f0f 100644 --- a/Public/premake5.lua +++ b/Public/premake5.lua @@ -1,4 +1,4 @@ -premake.path = premake.path .. ";" .. os.realpath("..\\") +premake.path = premake.path .. ";" .. os.realpath(path.translate("..\\")) require("base") @@ -55,4 +55,4 @@ local function start() end end -xpcall(start, auFatal) \ No newline at end of file +xpcall(start, auFatal) diff --git a/README_Developers.txt b/README_Developers.txt index b2b09e5..b1a2840 100644 --- a/README_Developers.txt +++ b/README_Developers.txt @@ -10,7 +10,7 @@ you may decide to fork them and host them alongside your ./Build_UserScripts awa # API Defer to the code under Public for information on how to integrate these Aurora scripts into your premake pipeline. -API -> ./Global/api.lua +API -> ./Public/api.lua Settings -> ./Public/settings.lua Entry -> ./Public/base.lua diff --git a/Utilities/requireAbs.lua b/Utilities/requireAbs.lua index 4dc3f4d..5dc45e9 100644 --- a/Utilities/requireAbs.lua +++ b/Utilities/requireAbs.lua @@ -28,6 +28,8 @@ function auRequire(relPath, subdir, invalidate) relPath = "/" .. relPath .. ".lua" end + relPath = _G.path.translate(relPath) + if (not os.isfile(buildScripts .. relPath)) then auFatal("Script not found: ", relPath) end @@ -46,4 +48,4 @@ function auRequire(relPath, subdir, invalidate) local result = require(realPath:sub(1, #realPath - 4)) _auRequireTable[realPath] = result return result -end \ No newline at end of file +end diff --git a/linux_x64 b/linux_x64 old mode 100644 new mode 100755 index 9576ceb..5a21ad8 --- a/linux_x64 +++ b/linux_x64 @@ -1,5 +1,5 @@ #!/bin/bash -cd Global +cd Public premake5 gmake2 --target-linux --target-x86_64 "$@" -cd .. \ No newline at end of file +cd ..