File tree Expand file tree Collapse file tree 5 files changed +88
-1
lines changed
Expand file tree Collapse file tree 5 files changed +88
-1
lines changed Original file line number Diff line number Diff line change 15461546 <PrecompiledHeader>NotUsing</PrecompiledHeader>
15471547 <WarningLevel>Level3</WarningLevel>
15481548 <Optimization>Disabled</Optimization>
1549+ </ClCompile>
1550+ ]]
1551+ end
1552+
1553+ --
1554+ -- If removeUnreferencedCodeData flag is set, add <RemoveUnreferencedCodeData> element
1555+ --
1556+
1557+ function suite .onRemoveUnreferencedCodeDataOff ()
1558+ removeunreferencedcodedata " Off"
1559+ prepare ()
1560+ test .capture [[
1561+ <ClCompile>
1562+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
1563+ <WarningLevel>Level3</WarningLevel>
1564+ <Optimization>Disabled</Optimization>
1565+ <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
1566+ ]]
1567+ end
1568+
1569+ function suite .onRemoveUnreferencedCodeDataOn ()
1570+ removeunreferencedcodedata " On"
1571+ prepare ()
1572+ test .capture [[
1573+ <ClCompile>
1574+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
1575+ <WarningLevel>Level3</WarningLevel>
1576+ <Optimization>Disabled</Optimization>
1577+ <RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
1578+ ]]
1579+ end
1580+
1581+ function suite .onRemoveUnreferencedCodeDataNotSpecified ()
1582+ prepare ()
1583+ test .capture [[
1584+ <ClCompile>
1585+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
1586+ <WarningLevel>Level3</WarningLevel>
1587+ <Optimization>Disabled</Optimization>
15491588</ClCompile>
15501589 ]]
15511590 end
Original file line number Diff line number Diff line change 386386 m .languageStandard ,
387387 m .conformanceMode ,
388388 m .structMemberAlignment ,
389- m .useFullPaths
389+ m .useFullPaths ,
390+ m .removeUnreferencedCodeData
390391 }
391392
392393 if cfg .kind == p .STATICLIB then
15151516 end
15161517 end
15171518
1519+ function m .removeUnreferencedCodeData (cfg )
1520+ if cfg .removeUnreferencedCodeData ~= nil then
1521+ if cfg .removeUnreferencedCodeData then
1522+ m .element (" RemoveUnreferencedCodeData" , nil , " true" )
1523+ else
1524+ m .element (" RemoveUnreferencedCodeData" , nil , " false" )
1525+ end
1526+ end
1527+ end
1528+
15181529 function m .additionalCompileOptions (cfg , condition )
15191530 local opts = cfg .buildoptions
15201531 if _ACTION == " vs2015" or vstudio .isMakefile (cfg ) then
Original file line number Diff line number Diff line change 795795 kind = " boolean"
796796 }
797797
798+ api .register {
799+ name = " removeunreferencedcodedata" ,
800+ scope = " config" ,
801+ kind = " boolean"
802+ }
803+
798804 api .register {
799805 name = " swiftversion" ,
800806 scope = " config" ,
Original file line number Diff line number Diff line change 1+ Sets the ` RemoveUnreferencedCodeData ` property for a configuration or all configurations within a project or workspace, adding or removing the ` /Zc:inline[-] ` build option.
2+
3+ [ /Zc: inline (Remove unreferenced COMDAT)] ( https://docs.microsoft.com/en-us/cpp/build/reference/zc-inline-remove-unreferenced-comdat?view=msvc-160 )
4+
5+ If this property is unset, it defaults to ` true ` in Visual Studio.
6+
7+ ``` lua
8+ removeunreferencedcodedata (" value" )
9+ ```
10+
11+ ### Parameters ###
12+
13+ ` value ` one of:
14+ * ` on ` - Enables ` RemoveUnreferencedCodeData ` .
15+ * ` off ` - Disables ` RemoveUnreferencedCodeData ` .
16+
17+ ### Applies To ###
18+
19+ Workspaces and projects.
20+
21+ ### Availability ###
22+
23+ Premake 5.0 alpha 16 or later.
24+
25+ ### Examples ###
26+
27+ ``` lua
28+ RemoveUnreferencedCodeData " Off"
29+ ```
30+
Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ module.exports = {
192192 'project' ,
193193 'propertydefinition' ,
194194 'rebuildcommands' ,
195+ 'removeunreferencedcodedata' ,
195196 'resdefines' ,
196197 'resincludedirs' ,
197198 'resoptions' ,
You can’t perform that action at this time.
0 commit comments