Merge pull request #1788 from LoneBoco/feature-modulescansources
Add a new "ScanForModuleDependencies" flag.
This commit is contained in:
commit
7deba66805
@ -169,6 +169,12 @@
|
||||
debugger('VisualStudio' .. value)
|
||||
end)
|
||||
|
||||
p.api.register {
|
||||
name = "scanformoduledependencies",
|
||||
scope = "config",
|
||||
kind = "boolean"
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
-- Decide when the full module should be loaded.
|
||||
|
@ -78,3 +78,31 @@
|
||||
<OpenMPSupport>false</OpenMPSupport>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- Check ClCompile for ScanForModuleDependencies
|
||||
--
|
||||
|
||||
function suite.SupportScanForModuleDependenciesOn()
|
||||
scanformoduledependencies "yes"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ScanSourceForModuleDependencies>true</ScanSourceForModuleDependencies>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.SupportScanForModuleDependenciesOff()
|
||||
scanformoduledependencies "no"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ScanSourceForModuleDependencies>false</ScanSourceForModuleDependencies>
|
||||
]]
|
||||
end
|
||||
|
@ -398,6 +398,7 @@
|
||||
m.compileAsWinRT,
|
||||
m.externalWarningLevel,
|
||||
m.externalAngleBrackets,
|
||||
m.scanSourceForModuleDependencies,
|
||||
}
|
||||
|
||||
if cfg.kind == p.STATICLIB then
|
||||
@ -2888,6 +2889,19 @@
|
||||
end
|
||||
|
||||
|
||||
function m.scanSourceForModuleDependencies(cfg)
|
||||
if _ACTION >= "vs2019" then
|
||||
if cfg.scanformoduledependencies ~= nil then
|
||||
if cfg.scanformoduledependencies then
|
||||
m.element("ScanSourceForModuleDependencies", nil, "true")
|
||||
else
|
||||
m.element("ScanSourceForModuleDependencies", nil, "false")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function m.xmlDeclaration()
|
||||
p.xmlUtf8()
|
||||
end
|
||||
|
25
website/docs/scanformoduledependencies.md
Normal file
25
website/docs/scanformoduledependencies.md
Normal file
@ -0,0 +1,25 @@
|
||||
Enables the `Scan Sources for Module Dependencies` option for Visual Studio projects.
|
||||
|
||||
```lua
|
||||
scanformoduledependencies "value"
|
||||
```
|
||||
|
||||
### Parameters ###
|
||||
|
||||
`value` one of:
|
||||
* `on`, `yes`, `true` - Sets the option to `Yes`.
|
||||
* `off`, `no`, `false` - Sets the option to `No`.
|
||||
|
||||
### Applies To ###
|
||||
|
||||
Project configurations.
|
||||
|
||||
### Availability ###
|
||||
|
||||
Premake 5.0-beta2 or later. Only available for Visual Studio 2019 16.9.x and later.
|
||||
|
||||
## Examples ##
|
||||
|
||||
```lua
|
||||
scanformoduledependencies "true"
|
||||
```
|
@ -233,6 +233,7 @@ module.exports = {
|
||||
'rules',
|
||||
'runpathdirs',
|
||||
'runtime',
|
||||
'scanformoduledependencies',
|
||||
'shaderassembler',
|
||||
'shaderassembleroutput',
|
||||
'shaderdefines',
|
||||
|
Reference in New Issue
Block a user