diff --git a/modules/vstudio/_preload.lua b/modules/vstudio/_preload.lua index 8b628b303d..eae6fae82b 100644 --- a/modules/vstudio/_preload.lua +++ b/modules/vstudio/_preload.lua @@ -185,6 +185,15 @@ } } + p.api.register { + name = "enableunitybuild", + scope = { "config" }, + kind = "string", + allowed = { + "On", + "Off" + } + } -- -- Decide when the full module should be loaded. diff --git a/modules/vstudio/vs2010_vcxproj.lua b/modules/vstudio/vs2010_vcxproj.lua index 8c56d5713f..ab9bb5e50e 100644 --- a/modules/vstudio/vs2010_vcxproj.lua +++ b/modules/vstudio/vs2010_vcxproj.lua @@ -196,6 +196,7 @@ m.clrSupport, m.characterSet, m.platformToolset, + m.enableUnityBuild, m.sanitizers, m.toolsVersion, m.wholeProgramOptimization, @@ -2550,6 +2551,12 @@ end end + function m.enableUnityBuild(cfg) + if _ACTION >= "vs2017" and cfg.enableunitybuild then + m.element("EnableUnitySupport", nil, iif(cfg.enableunitybuild == "On", "true", "false")) + end + end + function m.sanitizers(cfg) if _ACTION >= "vs2019" and cfg.sanitize then if table.contains(cfg.sanitize, "Address") then diff --git a/website/docs/Project-API.md b/website/docs/Project-API.md index 2b456fd52e..ae34fd2d37 100644 --- a/website/docs/Project-API.md +++ b/website/docs/Project-API.md @@ -71,6 +71,7 @@ | [docname](docname.md) | | | [editandcontinue](editandcontinue.md) | | | [editorintegration](editorintegration.md) | Enable or disable IDE integration | +| [enableunitybuild](enableunitybuild.md) | | | [enablewarnings](enablewarnings.md) | | | [endian](endian.md) | | | [entrypoint](entrypoint.md) | Specify the program entry point function | diff --git a/website/docs/enableunitybuild.md b/website/docs/enableunitybuild.md new file mode 100644 index 0000000000..5567c8af13 --- /dev/null +++ b/website/docs/enableunitybuild.md @@ -0,0 +1,27 @@ +Enables Unity Builds in Visual Studio, also known as Jumbo Builds + +```lua +enableunitybuild "value" +``` + +### Parameters ### + +`value` is one of: +* `On` - Enables Unity Builds. +* `Off` - Disables Unity Builds. + +### Applies To ### + +Project configurations. + +### Availability ### + +Premake 5.0 and later. Versions are currently only implemented for Visual Studio 2017+. + +### Examples ### + +Enable Unity Builds. + +```lua +enableunitybuild "On" +``` diff --git a/website/sidebars.js b/website/sidebars.js index 80eb76aaca..2c5d4a4851 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -139,6 +139,7 @@ module.exports = { 'embed', 'embedandsign', 'enabledefaultcompileitems', + 'enableunitybuild', 'enablewarnings', 'endian', 'entrypoint',