diff --git a/.gitignore b/.gitignore index 145c87583f..fdf2021a71 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ Makefile *.ninja *.ninja_deps *.ninja_log +.vscode/ *.bbprojectsettings Scratchpad.txt diff --git a/modules/gmakelegacy/tests/cpp/test_clang.lua b/modules/gmakelegacy/tests/cpp/test_clang.lua index 492e8711b0..df25a762a7 100644 --- a/modules/gmakelegacy/tests/cpp/test_clang.lua +++ b/modules/gmakelegacy/tests/cpp/test_clang.lua @@ -44,23 +44,6 @@ ifeq ($(config),debug) ]] end - function suite.usesCorrectCompilersAndLinkTimeOptimizationViaFlag() - flags { "LinkTimeOptimization" } - make.cppConfigs(prj) - test.capture [[ -ifeq ($(config),debug) - ifeq ($(origin CC), default) - CC = clang - endif - ifeq ($(origin CXX), default) - CXX = clang++ - endif - ifeq ($(origin AR), default) - AR = llvm-ar - endif - ]] - end - function suite.usesCorrectCompilersAndLinkTimeOptimizationViaAPI() linktimeoptimization "On" make.cppConfigs(prj) diff --git a/modules/vstudio/_preload.lua b/modules/vstudio/_preload.lua index 8ae35467ce..a2fb292d10 100644 --- a/modules/vstudio/_preload.lua +++ b/modules/vstudio/_preload.lua @@ -636,14 +636,6 @@ } } - p.api.deprecateValue("flags", "MFC", 'Use `mfc` instead.', - function(value) - mfc("On") - end, - function(value) - mfc("Off") - end) - -- -- Register Android properties -- diff --git a/modules/vstudio/tests/cs2005/test_compiler_props.lua b/modules/vstudio/tests/cs2005/test_compiler_props.lua index 1c5b679e99..1baa589a44 100644 --- a/modules/vstudio/tests/cs2005/test_compiler_props.lua +++ b/modules/vstudio/tests/cs2005/test_compiler_props.lua @@ -71,20 +71,8 @@ -- - function suite.treatWarningsAsErrors_onFatalWarningsFlag() - flags { "FatalWarnings" } - prepare() - test.capture [[ - - prompt - 4 - true - ]] - end - - function suite.treatWarningsAsErrors_onFatalWarningsAPI() - fatalwarnings { "All" } + fatalwarnings "All" prepare() test.capture [[ diff --git a/modules/vstudio/tests/vc200x/test_compiler_block.lua b/modules/vstudio/tests/vc200x/test_compiler_block.lua index 5d4772d90b..ca88579b3c 100644 --- a/modules/vstudio/tests/vc200x/test_compiler_block.lua +++ b/modules/vstudio/tests/vc200x/test_compiler_block.lua @@ -354,25 +354,6 @@ -- Verify the correct warnings settings are used when FatalWarnings are enabled. -- - function suite.runtimeLibraryIsDebug_onFatalWarningsViaFlag() - flags { "FatalWarnings" } - prepare() - test.capture [[ - - ]] - end - - function suite.runtimeLibraryIsDebug_onFatalWarningsViaAPI() fatalwarnings { "All" } prepare() @@ -396,25 +377,6 @@ -- Verify the correct warnings settings are used when no warnings are enabled. -- - function suite.runtimeLibraryIsDebug_onNoWarnings_whichDisablesAllOtherWarningsFlagsViaFlag() - flags { "FatalWarnings" } - warnings "Off" - prepare() - test.capture [[ - - ]] - end - - function suite.runtimeLibraryIsDebug_onNoWarnings_whichDisablesAllOtherWarningsFlagsViaAPI() fatalwarnings { "All" } warnings "Off" @@ -608,18 +570,6 @@ -- Check the LinkTimeOptimization flag. -- - function suite.flags_onLinkTimeOptimizationViaFlag() - flags { "LinkTimeOptimization" } - prepare() - test.capture [[ - - NotUsing - TurnOffAllWarnings - Disabled - ]] - end - - function suite.warningLevel_onNoWarningsOverOtherWarningsAPI() fatalwarnings { "All" } warnings "Off" @@ -558,17 +545,6 @@ -- Add if FatalWarnings flag is set. -- - function suite.treatWarningsAsError_onFatalWarningsViaFlag() - flags { "FatalCompileWarnings" } - prepare() - test.capture [[ - - NotUsing - Level3 - true - ]] - end - function suite.treatWarningsAsError_onFatalWarningsViaAPI() fatalwarnings { "All" } diff --git a/modules/vstudio/tests/vc2010/test_config_props.lua b/modules/vstudio/tests/vc2010/test_config_props.lua index 2090c52ee5..24bc79dbe2 100644 --- a/modules/vstudio/tests/vc2010/test_config_props.lua +++ b/modules/vstudio/tests/vc2010/test_config_props.lua @@ -184,17 +184,6 @@ ]] end - function suite.useOfMfc_onDynamicRuntimeViaFlag() - flags { "MFC" } - prepare() - test.capture [[ - - Application - false - Dynamic - ]] - end - function suite.useOfMfc_onStaticRuntime() mfc "On" staticruntime "On" @@ -207,18 +196,6 @@ ]] end - function suite.useOfMfc_onStaticRuntimeViaFlag() - flags { "MFC" } - staticruntime "On" - prepare() - test.capture [[ - - Application - false - Static - ]] - end - function suite.useOfMfc_forceStatic() mfc "Static" prepare() @@ -338,19 +315,6 @@ -- Check the LinkTimeOptimization flag -- - function suite.useOfLinkTimeOptimizationViaFlag() - flags { "LinkTimeOptimization" } - prepare() - test.capture [[ - - Application - false - Unicode - v100 - true - ]] - end - function suite.useOfLinkTimeOptimizationViaAPI() linktimeoptimization "On" prepare() diff --git a/modules/vstudio/tests/vc2010/test_link.lua b/modules/vstudio/tests/vc2010/test_link.lua index ab252c6f94..43aa6cba6e 100644 --- a/modules/vstudio/tests/vc2010/test_link.lua +++ b/modules/vstudio/tests/vc2010/test_link.lua @@ -651,7 +651,7 @@ function suite.fatalWarnings_onDynamicLink() kind "ConsoleApp" - flags { "FatalLinkWarnings" } + linkerfatalwarnings "All" prepare() test.capture [[ @@ -662,7 +662,7 @@ function suite.fatalWarnings_onStaticLink() kind "StaticLib" - flags { "FatalLinkWarnings" } + linkerfatalwarnings "All" prepare() test.capture [[ diff --git a/modules/xcode/tests/test_xcode_project.lua b/modules/xcode/tests/test_xcode_project.lua index d006490ec6..cc994dabaa 100644 --- a/modules/xcode/tests/test_xcode_project.lua +++ b/modules/xcode/tests/test_xcode_project.lua @@ -2945,32 +2945,6 @@ end - function suite.XCBuildConfigurationProject_OnFatalWarningsViaFlag() - flags { "FatalWarnings" } - prepare() - xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) - test.capture [[ - A14350AC4595EE5E57CE36EC /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(NATIVE_ARCH_ACTUAL)"; - CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; - CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - OBJROOT = obj/Debug; - ONLY_ACTIVE_ARCH = NO; - SYMROOT = bin/Debug; - }; - name = Debug; - }; - ]] - end - - function suite.XCBuildConfigurationProject_OnFatalWarningsViaAPI() fatalwarnings { "All" } linkerfatalwarnings { "All" } diff --git a/premake5.lua b/premake5.lua index 364e0b0b71..3a24bb7cbd 100644 --- a/premake5.lua +++ b/premake5.lua @@ -287,7 +287,7 @@ -- MinGW AR does not handle LTO out of the box and need a plugin to be setup filter { "system:windows", "configurations:Release", "toolset:not mingw" } - flags { "LinkTimeOptimization" } + linktimeoptimization "On" filter { "system:windows", "configurations:Release", "toolset:clang", "action:not vs*" } linkoptions { "-fuse-ld=lld" } diff --git a/src/_premake_init.lua b/src/_premake_init.lua index adb7a81c17..663e9211c0 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -338,12 +338,7 @@ "DebugEnvsDontMerge", "DebugEnvsInherit", "ExcludeFromBuild", - "FatalCompileWarnings", -- DEPRECATED - "FatalLinkWarnings", -- DEPRECATED - "FatalWarnings", -- DEPRECATED - "LinkTimeOptimization", -- DEPRECATED "Maps", - "MFC", "MultiProcessorCompile", "No64BitChecks", "NoCopyLocal", @@ -1133,15 +1128,6 @@ } } - --27 November 2024 - api.deprecateValue("flags", "LinkTimeOptimization", "Use `linktimeoptimization` instead.", - function(value) - linktimeoptimization("On") - end, - function(value) - linktimeoptimization("Default") - end) - --25 November 2024 api.deprecateValue("flags", "WPF", 'Use `dotnetsdk "WindowsDesktop"` instead.', function(value) @@ -1150,29 +1136,6 @@ function(value) dotnetsdk "Default" end) - api.deprecateValue("flags", "FatalWarnings", "Use `fatalwarnings { \"All\" }` instead.", - function(value) - fatalwarnings({ "All" }) - end, - function(value) - removefatalwarnings({ "All" }) - end) - - api.deprecateValue("flags", "FatalCompileWarnings", "Use `fatalwarnings { \"All\" }` instead.", - function(value) - fatalwarnings({ "All" }) - end, - function(value) - removefatalwarnings({ "All" }) - end) - - api.deprecateValue("flags", "FatalLinkWarnings", "Use `linkerfatalwarnings { \"All\" }` instead.", - function(value) - linkerfatalwarnings({ "All" }) - end, - function(value) - removelinkerfatalwarnings({ "All" }) - end) premake.filterFatalWarnings = function(tbl) if type(tbl) == "table" then diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index 080fbb3948..211c0fbf7e 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -121,12 +121,6 @@ test.contains({ "-Weverything" }, gcc.getcflags(cfg)) end - function suite.cflags_onFatalWarningsViaFlag() - flags { "FatalWarnings" } - prepare() - test.contains({ "-Werror" }, gcc.getcflags(cfg)) - end - function suite.cflags_onFatalWarningsViaAPI() fatalwarnings { "All" } prepare() @@ -957,24 +951,12 @@ end -- Check handling of link time optimization flag. -- - function suite.cflags_onLinkTimeOptimizationViaFlag() - flags "LinkTimeOptimization" - prepare() - test.contains("-flto", gcc.getcflags(cfg)) - end - function suite.cflags_onLinkTimeOptimizationViaAPI() linktimeoptimization "On" prepare() test.contains("-flto", gcc.getcflags(cfg)) end - function suite.ldflags_onLinkTimeOptimizationViaFlag() - flags "LinkTimeOptimization" - prepare() - test.contains("-flto", gcc.getldflags(cfg)) - end - function suite.ldflags_onLinkTimeOptimizationViaAPI() linktimeoptimization "On" prepare() diff --git a/tests/tools/test_msc.lua b/tests/tools/test_msc.lua index 8e96dd7204..2dd83cba78 100644 --- a/tests/tools/test_msc.lua +++ b/tests/tools/test_msc.lua @@ -101,24 +101,12 @@ test.excludes("/Oy", msc.getcflags(cfg)) end - function suite.cflags_onLinkTimeOptimizationsViaFlag() - flags "LinkTimeOptimization" - prepare() - test.contains("/GL", msc.getcflags(cfg)) - end - function suite.cflags_onLinkTimeOptimizationsViaAPI() linktimeoptimization "On" prepare() test.contains("/GL", msc.getcflags(cfg)) end - function suite.ldflags_onLinkTimeOptimizationsViaFlag() - flags "LinkTimeOptimization" - prepare() - test.contains("/LTCG", msc.getldflags(cfg)) - end - function suite.ldflags_onLinkTimeOptimizationsViaAPI() linktimeoptimization "On" prepare() @@ -296,12 +284,6 @@ test.contains("/Wall", msc.getcflags(cfg)) end - function suite.cflags_OnFatalWarningsViaFlag() - flags "FatalWarnings" - prepare() - test.contains("/WX", msc.getcflags(cfg)) - end - function suite.cflags_OnFatalWarningsViaAPI() fatalwarnings { "All" } prepare() @@ -816,13 +798,13 @@ end -- function suite.mixedToolFlags_onCFlags() - flags { "FatalCompileWarnings" } + fatalwarnings "All" prepare() test.isequal({ "/WX", "/MD" }, msc.getcflags(cfg)) end function suite.mixedToolFlags_onCxxFlags() - flags { "FatalCompileWarnings" } + fatalwarnings "All" prepare() test.isequal({ "/WX", "/MD", "/EHsc" }, msc.getcxxflags(cfg)) end diff --git a/tests/tools/test_snc.lua b/tests/tools/test_snc.lua index ed5416a8a6..c4689ed5b9 100644 --- a/tests/tools/test_snc.lua +++ b/tests/tools/test_snc.lua @@ -60,13 +60,6 @@ -- Check the translation of CFLAGS. -- - function suite.cflags_onFatalWarningsViaFlag() - flags { "FatalWarnings" } - prepare() - test.isequal({ "-Xquit=2" }, snc.getcflags(cfg)) - end - - function suite.cflag_onFatalWarningsViaAPI() fatalwarnings { "All" } prepare() diff --git a/website/docs/flags.md b/website/docs/flags.md index 9764bd174b..5463741f46 100644 --- a/website/docs/flags.md +++ b/website/docs/flags.md @@ -11,12 +11,12 @@ flags { "flag_list" } | Flag | Description | Notes | |-----------------------|---------------------------------------------------------------------|----------------| | ExcludeFromBuild | Exclude a source code file from the build, for the current configuration. | -| FatalCompileWarnings | Treat compiler warnings as errors. Deprecated in Premake 5.0.0-beta4. Use `fatalwarnings` API instead. | -| FatalLinkWarnings | Treat linker warnings as errors. Deprecated in Premake 5.0.0-beta4. Use `fatalwarnings` API instead. | -| FatalWarnings | Treat all warnings as errors; equivalent to FatalCompileWarnings, FatalLinkWarnings. Deprecated in Premake 5.0.0-beta4. Use `fatalwarnings` API instead. | -| LinkTimeOptimization | Enable link-time (i.e. whole program) optimizations. Deprecated in Premake 5.0.0-beta4. Use `linktimeoptimization` API instead. | +| FatalCompileWarnings | Treat compiler warnings as errors. Deprecated in Premake 5.0.0-beta4. Use `fatalwarnings` API instead. | Removed in Premake 5.0.0-beta8 | +| FatalLinkWarnings | Treat linker warnings as errors. Deprecated in Premake 5.0.0-beta4. Use `fatalwarnings` API instead. | Removed in Premake 5.0.0-beta8 | +| FatalWarnings | Treat all warnings as errors; equivalent to FatalCompileWarnings, FatalLinkWarnings. Deprecated in Premake 5.0.0-beta4. Use `fatalwarnings` API instead. | Removed in Premake 5.0.0-beta8 | +| LinkTimeOptimization | Enable link-time (i.e. whole program) optimizations. Deprecated in Premake 5.0.0-beta4. Use `linktimeoptimization` API instead. | Removed in Premake 5.0.0-beta8 | | Maps | Enable Generate Map File for Visual Studio | -| MFC | Enable support for Microsoft Foundation Classes. Deprecated in Premake 5.0.0-beta4. Use `mfc` API instead. | +| MFC | Enable support for Microsoft Foundation Classes. Deprecated in Premake 5.0.0-beta4. Use `mfc` API instead. | Removed in Premake 5.0.0-beta8 | | MultiProcessorCompile | Enable Visual Studio to use multiple compiler processes when building. | | No64BitChecks | Disable 64-bit portability warnings. | | NoBufferSecurityCheck | Turn off stack protection checks. |