[*] project names containing hyphens will screw with the macro preprocessor in vs (and other compilers. msvc compiles, vs doesnt like it, other compilers will probably complain)

This commit is contained in:
Reece Wilson 2021-07-05 14:36:37 +01:00
parent 8059031835
commit 66b3281934
2 changed files with 11 additions and 8 deletions

View File

@ -141,8 +141,6 @@ function JsonProcessor(info)
_G["info"] = info
local loadstring = loadstring or load
if (_if) then
local val = eval("return " .. _if)
if (not val) then
@ -328,8 +326,10 @@ function JsonProcessor(info)
local iface = proj.processor
local macro = ("_auhas_" .. dep):upper():gsub("%-", "_");
if (isProjectLoaded(dep)) then
defines(("_auhas_" .. dep):upper() .. "=1")
defines(macro .. "=1")
iface:handleReference(isWeakCircularReference(dep))
@ -337,7 +337,7 @@ function JsonProcessor(info)
iface:handleLink()
end
else
defines(("_auhas_" .. dep):upper() .. "=0")
defines(macro .. "=0")
if (not soft) then
fatal("missing project: ", dep)
end

View File

@ -270,16 +270,13 @@ function attemptNS(ns)
attemptLoad = true
end
-- this seems to be singleshot.
-- once you switch namespaces, theres no going back, it seems.
-- we try to preserve namespace-project contiguity as much as possible through sorting and evil recursion
group(ns)
return attemptLoad
end
resolved = {}
function processProject(name, required, noNs)
function processProject(name, required, noNs)
local a = projectsprocessor[name]
if (not a) then
if (required) then
@ -289,17 +286,21 @@ function processProject(name, required, noNs)
end
end
-- ensure the project is initializd
processInit(a)
-- legacy recursion
if (projectsblocked[name]) then
return true
end
projectsblocked[name] = name
-- process all within the namespace before processing the actual project
local ns = a.info.namespace
local loadOthers = attemptNS(ns)
-- {
local cwd = os.getcwd()
local old = _G["current_project"]
@ -310,9 +311,11 @@ function processProject(name, required, noNs)
os.chdir(cwd)
_G["current_project"] = old
-- }
projectsemitted[name] = name
-- cont
if (loadOthers) then
namespacesemitted[ns] = "";
processNS(ns)