Merge pull request #1790 from hannes-harnisch/allmodulespublic
Adding C++ module file extensions and implementing "allmodulespublic"
This commit is contained in:
commit
78b7e4525f
@ -57,3 +57,40 @@
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If AllModulesPublic flag is set, add <AllProjectBMIsArePublic> element (supported from VS2019)
|
||||
--
|
||||
|
||||
function suite.onAllModulesPublicOn()
|
||||
allmodulespublic "On"
|
||||
local cfg = test.getconfig(prj, "Debug", platform)
|
||||
vc2010.outputProperties(cfg)
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>bin\Debug\</OutDir>
|
||||
<IntDir>obj\Debug\</IntDir>
|
||||
<TargetName>MyProject</TargetName>
|
||||
<TargetExt>.exe</TargetExt>
|
||||
<AllProjectBMIsArePublic>true</AllProjectBMIsArePublic>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.onAllModulesPublicOff()
|
||||
allmodulespublic "Off"
|
||||
local cfg = test.getconfig(prj, "Debug", platform)
|
||||
vc2010.outputProperties(cfg)
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>bin\Debug\</OutDir>
|
||||
<IntDir>obj\Debug\</IntDir>
|
||||
<TargetName>MyProject</TargetName>
|
||||
<TargetExt>.exe</TargetExt>
|
||||
<AllProjectBMIsArePublic>false</AllProjectBMIsArePublic>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
@ -243,6 +243,7 @@
|
||||
m.generateManifest,
|
||||
m.extensionsToDeleteOnClean,
|
||||
m.executablePath,
|
||||
m.allModulesPublic,
|
||||
}
|
||||
end
|
||||
end
|
||||
@ -795,7 +796,7 @@
|
||||
---
|
||||
m.categories.ClCompile = {
|
||||
name = "ClCompile",
|
||||
extensions = { ".cc", ".cpp", ".cxx", ".c++", ".c", ".s", ".m", ".mm" },
|
||||
extensions = { ".cc", ".cpp", ".cxx", ".c++", ".c", ".s", ".m", ".mm", ".cppm", ".ixx" },
|
||||
priority = 2,
|
||||
|
||||
emitFiles = function(prj, group)
|
||||
@ -1506,11 +1507,15 @@
|
||||
function m.conformanceMode(cfg)
|
||||
if _ACTION >= "vs2017" then
|
||||
if cfg.conformancemode ~= nil then
|
||||
if cfg.conformancemode then
|
||||
m.element("ConformanceMode", nil, "true")
|
||||
else
|
||||
m.element("ConformanceMode", nil, "false")
|
||||
end
|
||||
m.element("ConformanceMode", nil, iif(cfg.conformancemode, "true", "false"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function m.allModulesPublic(cfg)
|
||||
if _ACTION >= "vs2019" then
|
||||
if cfg.allmodulespublic ~= nil then
|
||||
m.element("AllProjectBMIsArePublic", nil, iif(cfg.allmodulespublic, "true", "false"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -190,6 +190,12 @@
|
||||
"HeaderUnit"
|
||||
}
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "allmodulespublic",
|
||||
scope = "config",
|
||||
kind = "boolean"
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "configmap",
|
||||
|
@ -171,7 +171,7 @@
|
||||
end
|
||||
|
||||
function path.iscppfile(fname)
|
||||
return path.hasextension(fname, { ".cc", ".cpp", ".cxx", ".c++" })
|
||||
return path.hasextension(fname, { ".cc", ".cpp", ".cxx", ".c++", ".cppm", ".ixx" })
|
||||
or path.isobjcppfile(fname) -- is this really right?
|
||||
or path.iscfile(fname)
|
||||
end
|
||||
|
27
website/docs/allmodulespublic.md
Normal file
27
website/docs/allmodulespublic.md
Normal file
@ -0,0 +1,27 @@
|
||||
allmodulespublic
|
||||
|
||||
```lua
|
||||
allmodulespublic "value"
|
||||
```
|
||||
|
||||
### Parameters ###
|
||||
|
||||
`value` one of:
|
||||
* `On` - All C++ modules in the given project(s) will be public.
|
||||
* `Off` - Not all C++ modules in the given project(s) will be public.
|
||||
|
||||
## Applies To ###
|
||||
|
||||
The `config` scope.
|
||||
|
||||
### Availability ###
|
||||
|
||||
Visual Studio 2019 and later.
|
||||
Premake 5.0-beta2 or later.
|
||||
|
||||
### Examples ###
|
||||
|
||||
```lua
|
||||
allmodulespublic "On"
|
||||
```
|
||||
|
@ -60,6 +60,7 @@ module.exports = {
|
||||
type: 'category',
|
||||
label: 'Project Settings',
|
||||
items: [
|
||||
'allmodulespublic',
|
||||
'androidapilevel',
|
||||
'androidapplibname',
|
||||
'architecture',
|
||||
|
Reference in New Issue
Block a user