Implementing "inheritdependencies"
This commit is contained in:
parent
9d38e82f7b
commit
827d07c206
@ -723,7 +723,7 @@
|
|||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Test ignoring default libraries with extensions specified.
|
-- Test ignoring default libraries with extensions specified.
|
||||||
--
|
--
|
||||||
|
|
||||||
@ -737,4 +737,33 @@
|
|||||||
<AssemblyDebug>true</AssemblyDebug>
|
<AssemblyDebug>true</AssemblyDebug>
|
||||||
</Link>
|
</Link>
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Test for not including additional dependencies.
|
||||||
|
--
|
||||||
|
|
||||||
|
function suite.inheritDependenciesOff()
|
||||||
|
inheritdependencies "Off"
|
||||||
|
prepare()
|
||||||
|
test.capture [[
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<AdditionalDependencies></AdditionalDependencies>
|
||||||
|
<ImportLibrary>bin\Debug\MyProject.lib</ImportLibrary>
|
||||||
|
</Link>
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function suite.inheritDependenciesOn()
|
||||||
|
inheritdependencies "On"
|
||||||
|
links { "kernel32" }
|
||||||
|
prepare()
|
||||||
|
test.capture [[
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<ImportLibrary>bin\Debug\MyProject.lib</ImportLibrary>
|
||||||
|
</Link>
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
@ -1420,9 +1420,18 @@
|
|||||||
links = vstudio.getLinks(cfg, explicit)
|
links = vstudio.getLinks(cfg, explicit)
|
||||||
end
|
end
|
||||||
|
|
||||||
if #links > 0 then
|
links = path.translate(table.concat(links, ";"))
|
||||||
links = path.translate(table.concat(links, ";"))
|
|
||||||
m.element("AdditionalDependencies", nil, "%s;%%(AdditionalDependencies)", links)
|
local additional = ";%(AdditionalDependencies)"
|
||||||
|
if cfg.inheritdependencies ~= nil then
|
||||||
|
if not cfg.inheritdependencies then
|
||||||
|
additional = ""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- If there are no links and dependencies should be inherited, the tag doesn't have to be generated.
|
||||||
|
if #links > 0 or additional == "" then
|
||||||
|
m.element("AdditionalDependencies", nil, "%s%s", links, additional)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -638,6 +638,12 @@
|
|||||||
tokens = true,
|
tokens = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
api.register {
|
||||||
|
name = "inheritdependencies",
|
||||||
|
scope = "config",
|
||||||
|
kind = "boolean",
|
||||||
|
}
|
||||||
|
|
||||||
api.register {
|
api.register {
|
||||||
name = "icon",
|
name = "icon",
|
||||||
scope = "project",
|
scope = "project",
|
||||||
|
29
website/docs/inheritdependencies.md
Normal file
29
website/docs/inheritdependencies.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
inheritdependencies
|
||||||
|
|
||||||
|
```lua
|
||||||
|
inheritdependencies "value"
|
||||||
|
```
|
||||||
|
|
||||||
|
For Visual Studio project files, this controls the generation of the `%(AdditionalDependencies)` entry in the list of libraries that a project links.
|
||||||
|
|
||||||
|
### Parameters ###
|
||||||
|
|
||||||
|
`value` one of:
|
||||||
|
* `On` - The project(s) will inherit library dependencies based on the parent project (if any) and project default settings. This is the default behavior.
|
||||||
|
* `Off` - The project(s) will not inherit any library dependencies. Only explicitly specified dependencies will be linked.
|
||||||
|
|
||||||
|
## Applies To ###
|
||||||
|
|
||||||
|
The `config` scope.
|
||||||
|
|
||||||
|
### Availability ###
|
||||||
|
|
||||||
|
Visual Studio 2015 and later.
|
||||||
|
Premake 5.0-beta2 or later.
|
||||||
|
|
||||||
|
### Examples ###
|
||||||
|
|
||||||
|
```lua
|
||||||
|
inheritdependencies "Off"
|
||||||
|
```
|
||||||
|
|
@ -178,6 +178,7 @@ module.exports = {
|
|||||||
'implibsuffix',
|
'implibsuffix',
|
||||||
'importdirs',
|
'importdirs',
|
||||||
'includedirs',
|
'includedirs',
|
||||||
|
'inheritdependencies',
|
||||||
'inlinesvisibility',
|
'inlinesvisibility',
|
||||||
'inlining',
|
'inlining',
|
||||||
'intrinsics',
|
'intrinsics',
|
||||||
|
Reference in New Issue
Block a user