[+] staticImpDefines for stupid modules that assume shared linkage over static
This commit is contained in:
parent
d4d6151260
commit
353237353a
@ -76,13 +76,13 @@ function JsonProcessor(info)
|
||||
|
||||
local handleDllImportMaybe = function(this)
|
||||
if (this.info.isShared) then
|
||||
defines(this.result.dllimport)
|
||||
forEach(this.result.dllimport, defines)
|
||||
end
|
||||
end
|
||||
|
||||
local handleDllExportMaybe = function(this)
|
||||
if (this.info.isShared) then
|
||||
defines(this.result.dllexport)
|
||||
forEach(this.result.dllexport, defines)
|
||||
end
|
||||
end
|
||||
|
||||
@ -124,6 +124,10 @@ function JsonProcessor(info)
|
||||
forEach(result.staticImport, defines)
|
||||
end
|
||||
|
||||
if (this.info.isStatic) then
|
||||
forEach(result.staticImpDefines, defines)
|
||||
end
|
||||
|
||||
handleInclude(this, false)
|
||||
|
||||
defines(("_auhas_" .. this.result.name):upper() .. "=1")
|
||||
@ -267,6 +271,7 @@ function JsonProcessor(info)
|
||||
forEach(object.depends, handleDepends, a, false)
|
||||
forEach(object["soft-depends"], handleDepends, a, true)
|
||||
forEach(object.impDefines, defines)
|
||||
forEach(object.links, links)
|
||||
if (usingMSVC) then
|
||||
forEach(object.msvcIgnore, disablewarnings)
|
||||
end
|
||||
@ -322,13 +327,17 @@ function JsonProcessor(info)
|
||||
forEach(result.impInclude, handleUserJsonInclude, info.path, true)
|
||||
|
||||
if (a.info.projectType:lower() == "sharedlib") then
|
||||
tryAddDefine(result.dllexport)
|
||||
forEach(result.dllexport, defines)
|
||||
end
|
||||
end
|
||||
|
||||
forEach(result.actions, handleAction, info.path)
|
||||
forEach(result.events, handleBuildEvent, info.path)
|
||||
|
||||
if (info.isStatic) then
|
||||
forEach(result.staticImpDefines, defines)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
forEach(result.subprojs, function(subproj)
|
||||
|
@ -68,6 +68,15 @@
|
||||
},
|
||||
"description": "adds a preprocessor definition to translation units linking against a shared project"
|
||||
},
|
||||
"staticImpDefines":
|
||||
{
|
||||
"type": ["array", "string"],
|
||||
"items":
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
"description": "adds a preprocessor definition to translation units linking against or compiling a static project"
|
||||
},
|
||||
|
||||
|
||||
"impDefines":
|
||||
|
Loading…
Reference in New Issue
Block a user