Skip to content

Commit b287ada

Browse files
committed
Remove remaining core deprecated flags with existing replacements
1 parent ffcb779 commit b287ada

File tree

9 files changed

+36
-242
lines changed

9 files changed

+36
-242
lines changed

modules/vstudio/tests/vc2010/test_compile_settings.lua

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@
645645
--
646646

647647
function suite.wchar_onNative()
648-
flags "NativeWChar"
648+
nativewchar "On"
649649
prepare()
650650
test.capture [[
651651
<ClCompile>
@@ -657,7 +657,7 @@
657657
end
658658

659659
function suite.wchar_onNoNative()
660-
flags "NoNativeWChar"
660+
nativewchar "Off"
661661
prepare()
662662
test.capture [[
663663
<ClCompile>
@@ -1636,19 +1636,6 @@
16361636
]]
16371637
end
16381638

1639-
function suite.omitFramePointer_DeprecationFlag()
1640-
flags "NoFramePointer"
1641-
prepare()
1642-
test.capture [[
1643-
<ClCompile>
1644-
<PrecompiledHeader>NotUsing</PrecompiledHeader>
1645-
<WarningLevel>Level3</WarningLevel>
1646-
<Optimization>Disabled</Optimization>
1647-
<OmitFramePointers>true</OmitFramePointers>
1648-
</ClCompile>
1649-
]]
1650-
end
1651-
16521639
--
16531640
-- If useFullPaths flag is set, add <UseFullPaths> element
16541641
--

modules/xcode/tests/test_xcode_project.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,7 @@
23182318

23192319

23202320
function suite.XCBuildConfigurationProject_OnStaticRuntime()
2321-
flags { "StaticRuntime" }
2321+
staticruntime "On"
23222322
prepare()
23232323
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
23242324
test.capture [[
@@ -2725,7 +2725,7 @@
27252725

27262726

27272727
function suite.XCBuildConfigurationProject_OnFloatFast()
2728-
flags { "FloatFast" }
2728+
floatingpoint "Fast"
27292729
prepare()
27302730
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
27312731
test.capture [[
@@ -2858,7 +2858,7 @@
28582858

28592859

28602860
function suite.XCBuildConfigurationProject_OnNoFramePointer()
2861-
flags { "NoFramePointer" }
2861+
omitframepointer "On"
28622862
prepare()
28632863
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
28642864
test.capture [[

modules/xcode/xcode_common.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@
15941594

15951595
settings['OTHER_LDFLAGS'] = table.join(flags, cfg.linkoptions)
15961596

1597-
if cfg.flags.StaticRuntime then
1597+
if cfg.flags.StaticRuntime or cfg.staticruntime == "On" then
15981598
settings['STANDARD_C_PLUS_PLUS_LIBRARY_TYPE'] = 'static'
15991599
end
16001600

premake5.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172

173173
filter "configurations:Debug"
174174
defines "_DEBUG"
175-
flags { "Symbols" }
175+
symbols "On"
176176

177177
filter "configurations:Release"
178178
defines "NDEBUG"

src/_premake_init.lua

Lines changed: 0 additions & 194 deletions
Original file line numberDiff line numberDiff line change
@@ -332,55 +332,33 @@
332332
scope = "config",
333333
kind = "list:string",
334334
allowed = {
335-
"Component", -- DEPRECATED
336335
"DebugEnvsDontMerge",
337336
"DebugEnvsInherit",
338-
"EnableSSE", -- DEPRECATED
339-
"EnableSSE2", -- DEPRECATED
340337
"ExcludeFromBuild",
341-
"ExtraWarnings", -- DEPRECATED
342338
"FatalCompileWarnings",
343339
"FatalLinkWarnings",
344-
"FloatFast", -- DEPRECATED
345-
"FloatStrict", -- DEPRECATED
346340
"LinkTimeOptimization",
347-
"Managed", -- DEPRECATED
348341
"Maps",
349342
"MFC",
350343
"MultiProcessorCompile",
351-
"NativeWChar", -- DEPRECATED
352344
"No64BitChecks",
353345
"NoCopyLocal",
354-
"NoEditAndContinue", -- DEPRECATED
355-
"NoFramePointer", -- DEPRECATED
356346
"NoImplicitLink",
357347
"NoImportLib", -- DEPRECATED
358348
"NoIncrementalLink",
359349
"NoManifest",
360350
"NoMinimalRebuild",
361-
"NoNativeWChar", -- DEPRECATED
362351
"NoPCH",
363352
"NoRuntimeChecks",
364353
"NoBufferSecurityCheck",
365-
"NoWarnings", -- DEPRECATED
366354
"OmitDefaultLibrary",
367-
"Optimize", -- DEPRECATED
368-
"OptimizeSize", -- DEPRECATED
369-
"OptimizeSpeed", -- DEPRECATED
370355
"RelativeLinks",
371-
"ReleaseRuntime", -- DEPRECATED
372356
"ShadowedVariables",
373-
"StaticRuntime", -- DEPRECATED
374-
"Symbols", -- DEPRECATED
375357
"UndefinedIdentifiers",
376-
"WinMain", -- DEPRECATED
377358
"WPF",
378359
},
379360
aliases = {
380361
FatalWarnings = { "FatalWarnings", "FatalCompileWarnings", "FatalLinkWarnings" },
381-
Optimise = 'Optimize',
382-
OptimiseSize = 'OptimizeSize',
383-
OptimiseSpeed = 'OptimizeSpeed',
384362
},
385363
}
386364

@@ -1148,178 +1126,6 @@
11481126
buildoutputs(value.outputs)
11491127
end)
11501128

1151-
1152-
api.deprecateValue("flags", "Component", 'Use `buildaction "Component"` instead.',
1153-
function(value)
1154-
buildaction "Component"
1155-
end)
1156-
1157-
1158-
api.deprecateValue("flags", "EnableSSE", 'Use `vectorextensions "SSE"` instead.',
1159-
function(value)
1160-
vectorextensions("SSE")
1161-
end,
1162-
function(value)
1163-
vectorextensions "Default"
1164-
end)
1165-
1166-
1167-
api.deprecateValue("flags", "EnableSSE2", 'Use `vectorextensions "SSE2"` instead.',
1168-
function(value)
1169-
vectorextensions("SSE2")
1170-
end,
1171-
function(value)
1172-
vectorextensions "Default"
1173-
end)
1174-
1175-
1176-
api.deprecateValue("flags", "FloatFast", 'Use `floatingpoint "Fast"` instead.',
1177-
function(value)
1178-
floatingpoint("Fast")
1179-
end,
1180-
function(value)
1181-
floatingpoint "Default"
1182-
end)
1183-
1184-
1185-
api.deprecateValue("flags", "FloatStrict", 'Use `floatingpoint "Strict"` instead.',
1186-
function(value)
1187-
floatingpoint("Strict")
1188-
end,
1189-
function(value)
1190-
floatingpoint "Default"
1191-
end)
1192-
1193-
1194-
api.deprecateValue("flags", "NativeWChar", 'Use `nativewchar "On"` instead."',
1195-
function(value)
1196-
nativewchar("On")
1197-
end,
1198-
function(value)
1199-
nativewchar "Default"
1200-
end)
1201-
1202-
1203-
api.deprecateValue("flags", "NoNativeWChar", 'Use `nativewchar "Off"` instead."',
1204-
function(value)
1205-
nativewchar("Off")
1206-
end,
1207-
function(value)
1208-
nativewchar "Default"
1209-
end)
1210-
1211-
1212-
api.deprecateValue("flags", "Optimize", 'Use `optimize "On"` instead.',
1213-
function(value)
1214-
optimize ("On")
1215-
end,
1216-
function(value)
1217-
optimize "Off"
1218-
end)
1219-
1220-
1221-
api.deprecateValue("flags", "OptimizeSize", 'Use `optimize "Size"` instead.',
1222-
function(value)
1223-
optimize ("Size")
1224-
end,
1225-
function(value)
1226-
optimize "Off"
1227-
end)
1228-
1229-
1230-
api.deprecateValue("flags", "OptimizeSpeed", 'Use `optimize "Speed"` instead.',
1231-
function(value)
1232-
optimize ("Speed")
1233-
end,
1234-
function(value)
1235-
optimize "Off"
1236-
end)
1237-
1238-
1239-
api.deprecateValue("flags", "ReleaseRuntime", 'Use `runtime "Release"` instead.',
1240-
function(value)
1241-
runtime "Release"
1242-
end,
1243-
function(value)
1244-
end)
1245-
1246-
1247-
api.deprecateValue("flags", "ExtraWarnings", 'Use `warnings "Extra"` instead.',
1248-
function(value)
1249-
warnings "Extra"
1250-
end,
1251-
function(value)
1252-
warnings "Default"
1253-
end)
1254-
1255-
1256-
api.deprecateValue("flags", "NoWarnings", 'Use `warnings "Off"` instead.',
1257-
function(value)
1258-
warnings "Off"
1259-
end,
1260-
function(value)
1261-
warnings "Default"
1262-
end)
1263-
1264-
api.deprecateValue("flags", "Managed", 'Use `clr "On"` instead.',
1265-
function(value)
1266-
clr "On"
1267-
end,
1268-
function(value)
1269-
clr "Off"
1270-
end)
1271-
1272-
1273-
api.deprecateValue("flags", "NoEditAndContinue", 'Use editandcontinue "Off"` instead.',
1274-
function(value)
1275-
editandcontinue "Off"
1276-
end,
1277-
function(value)
1278-
editandcontinue "On"
1279-
end)
1280-
1281-
1282-
-- 21 June 2016
1283-
1284-
api.deprecateValue("flags", "Symbols", 'Use `symbols "On"` instead',
1285-
function(value)
1286-
symbols "On"
1287-
end,
1288-
function(value)
1289-
symbols "Default"
1290-
end)
1291-
1292-
1293-
-- 13 April 2017
1294-
1295-
api.deprecateValue("flags", "WinMain", 'Use `entrypoint "WinMainCRTStartup"` instead',
1296-
function(value)
1297-
entrypoint "WinMainCRTStartup"
1298-
end,
1299-
function(value)
1300-
entrypoint "mainCRTStartup"
1301-
end)
1302-
1303-
-- 31 October 2017
1304-
1305-
api.deprecateValue("flags", "StaticRuntime", 'Use `staticruntime "On"` instead',
1306-
function(value)
1307-
staticruntime "On"
1308-
end,
1309-
function(value)
1310-
staticruntime "Default"
1311-
end)
1312-
1313-
-- 08 April 2018
1314-
1315-
api.deprecateValue("flags", "NoFramePointer", 'Use `omitframepointer "On"` instead.',
1316-
function(value)
1317-
omitframepointer("On")
1318-
end,
1319-
function(value)
1320-
omitframepointer("Default")
1321-
end)
1322-
13231129
-----------------------------------------------------------------------------
13241130
--
13251131
-- Install Premake's default set of command line arguments.

tests/api/test_deprecations.lua

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,30 @@
1414
configurations { "Debug", "Release" }
1515
end
1616

17+
--
18+
-- Replicate previously deprecated (and removed) flags solely for testing purposes.
19+
--
20+
21+
api.addAllowed("flags", "Symbols")
22+
api.addAllowed("flags", "Optimize")
23+
24+
api.deprecateValue("flags", "Optimize", 'Use `optimize "On"` instead.',
25+
function(value)
26+
optimize ("On")
27+
end,
28+
function(value)
29+
optimize "Off"
30+
end)
31+
32+
api.deprecateValue("flags", "Symbols", 'Use `symbols "On"` instead',
33+
function(value)
34+
symbols "On"
35+
end,
36+
function(value)
37+
symbols "Default"
38+
end)
39+
40+
1741
function suite.setsNewValue_whenOldValueIsRemovedViaWildcard_inSubConfig()
1842
local prj = project "MyProject"
1943
filter { "configurations:Debug" }

tests/base/test_configset.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,26 +177,26 @@
177177
function suite.remove_onExactValueMatch()
178178
local f = field.get("flags")
179179

180-
local r, err = configset.store(cset, f, { "Symbols", "WinMain", "MFC" })
180+
local r, err = configset.store(cset, f, { "MFC", "MultiProcessorCompile", "NoPCH" })
181181
test.isnil(err)
182182

183-
configset.remove(cset, f, { "WinMain" })
183+
configset.remove(cset, f, { "MFC" })
184184

185185
local result = configset.fetch(cset, f)
186-
test.isequal({ "Symbols", "MFC" }, result)
186+
test.isequal({ "MultiProcessorCompile", "NoPCH" }, result)
187187
end
188188

189189

190190
function suite.remove_onMultipleValues()
191191
local f = field.get("flags")
192192

193-
local r, err = configset.store(cset, f, { "Symbols", "Maps", "WinMain", "MFC" })
193+
local r, err = configset.store(cset, f, { "Maps", "MFC", "MultiProcessorCompile", "NoPCH" })
194194
test.isnil(err)
195195

196196
configset.remove(cset, f, { "Maps", "MFC" })
197197

198198
local result = configset.fetch(cset, f)
199-
test.isequal({ "Symbols", "WinMain" }, result)
199+
test.isequal({ "MultiProcessorCompile", "NoPCH" }, result)
200200
end
201201

202202

tests/tools/test_msc.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@
6666
test.contains("/Od", msc.getcflags(cfg))
6767
end
6868

69-
function suite.cflags_onNoFramePointers()
70-
flags "NoFramePointer"
71-
prepare()
72-
test.contains("/Oy", msc.getcflags(cfg))
73-
end
74-
7569
function suite.cflags_onOmitFramePointer()
7670
omitframepointer "On"
7771
prepare()

0 commit comments

Comments
 (0)