[*] Deprecate noLink

This commit is contained in:
Reece Wilson 2021-11-16 11:03:56 +00:00
parent 029875af0a
commit 76405a5b58
2 changed files with 55 additions and 26 deletions

View File

@ -33,8 +33,12 @@ local function archiveShipPdb(pdbPath)
-- TODO (reece):
end
local function isUtils(projectType)
return projectType == "Blank" or projectType == "Utility" or projectType == "None"
end
local function isNoLinkType(projectType)
return projectType == "StaticLib" or projectType == "Blank" or projectType == "Utility"
return projectType == "StaticLib" or isUtils(projectType)
end
local function addUserDestCopy(name, type, config, platformName, arch, dir)
@ -110,28 +114,31 @@ local function postBuildCommands(name, type, config, platformName, arch)
end
end
if (config ~= Aurora.Settings.sNameOfDebug) then
if (config == Aurora.Settings.sNameOfDebug) then
return
end
local platform = Aurora.Platforms[platformName]
if (not platform) then
return
end
local debugSymbolPath = nil
local debugExt = ""
if (platform.devChainRequiresElfStrip and
platform.devChainSupportsElfStrip) then
debugEx = ".dwarf"
debugSymbolPath = normalizeCpyPath(Aurora.Settings.sAbsSymbols) .. "/" .. name .. ".dwarf"
postbuildcommands("objcopy --only-keep-debug " .. file .. " " .. debugSymbolPath)
elseif (isWin) then
debugEx = ".pdb"
debugSymbolPath = normalizeCpyPath(Aurora.Settings.sAbsSymbols) .. "/" .. name .. ".pdb"
end
if (debugSymbolPath and
config == Aurora.Settings.sNameOfShip) then
archiveShipPdb(debugSymbolPath)
end
else
postbuildcommands(copy)
archiveShipPdb(debugSymbolPath, debugEx)
end
end
@ -140,7 +147,7 @@ local function startProject(name, projectType)
return
end
if (isNoLinkType(projectType)) then
if (isUtils(projectType)) then
return
end

View File

@ -1,4 +1,4 @@
local auProject = auRequire("Core/project").setupProjectCompat
local auProject = auRequire("Core/project").startProject
local valaGo = auRequire("Core/Vala")
function JsonProcessor(info)
@ -289,21 +289,43 @@ function JsonProcessor(info)
auForEach(result.unpack, runCopies, info.path, info.name)
local prj_ = {
name = info.name,
projectType = info.projectType or result.projectType,
dest = info.out,
noLink = result.noLink
}
if (result.noLink) then
print("noLink is deprecated. Use projectType: None")
prj_.projectType = "None"
info.projectType = "None"
end
if (result.type:lower() == "aurora") then
local srcPath = path .. "/Source"
local incPath = path .. "/Include" -- /Source is emitted by design. Use it as a prefix in <> includes; eg, #include <Source/MyLib.hpp>
auProject(name, a.info.projectType, {srcPath}, {incPath, path}, a.info.out, path)
prj_.src = srcPath
prj_.inc = {incPath, path}
auProject(prj_)
elseif (result.type:lower() == "lazy_free") then
auProject(name, a.info.projectType, {path .. "/*.*"}, {path .. "/"}, a.info.out, path)
prj_.src = path .. "/*.*"
prj_.inc = path .. "/"
auProject(prj_)
elseif (result.type:lower() == "root") then
auProject(name, a.info.projectType, path, path, a.info.out, path)
prj_.src = path
prj_.inc = path
auProject(prj_)
elseif (result.type:lower() == "generic") then
auProject(name, a.info.projectType, nil, nil, a.info.out, path)
auProject(prj_)
elseif (result.type:lower() == "utility") then
project(name)