Skip to main content

flags

Specifies build flags to modify the compiling or linking process.

flags { "flag_list" }

Parameters

flag_list is a list of string flag names; see below for a list of valid flags. The flag values are not case-sensitive. Flags that are not supported by a particular platform or toolset are ignored.

FlagDescriptionNotes
ExcludeFromBuildExclude a source code file from the build, for the current configuration. Deprecated in Premake 5.0.0-beta8. Use excludefrombuild API instead.
FatalCompileWarningsTreat compiler warnings as errors. Deprecated in Premake 5.0.0-beta4. Use fatalwarnings API instead.Removed in Premake 5.0.0-beta8
FatalLinkWarningsTreat linker warnings as errors. Deprecated in Premake 5.0.0-beta4. Use fatalwarnings API instead.Removed in Premake 5.0.0-beta8
FatalWarningsTreat 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
LinkTimeOptimizationEnable 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
MapsEnable Generate Map File for Visual Studio. Deprecated in Premake 5.0.0-beta8. Use mapfile API instead.
MFCEnable support for Microsoft Foundation Classes. Deprecated in Premake 5.0.0-beta4. Use mfc API instead.Removed in Premake 5.0.0-beta8
MultiProcessorCompileEnable Visual Studio to use multiple compiler processes when building. Deprecated in Premake 5.0.0-beta8. Use multiprocessorcompile API instead.
No64BitChecksDisable 64-bit portability warnings. Deprecated in Premake 5.0.0-beta8. Use enable64bitchecks API instead.
NoBufferSecurityCheckTurn off stack protection checks. Deprecated in Premake 5.0.0-beta8. Use buffersecuritycheck API instead.
NoCopyLocalPrevent referenced assemblies from being copied to the target directory (C#). Deprecated in Premake 5.0.0-beta8. Use allowcopylocal API instead.
NoImplicitLinkDisable Visual Studio's default behavior of automatically linking dependent projects. Deprecated in Premake 5.0.0-beta8. Use implicitlink API instead.
NoImportLibPrevent the generation of an import library for a Windows DLL. Deprecated in Premake 5.0.0-beta8. Use useimportlib API instead.
NoIncrementalLinkDisable support for Visual Studio's incremental linking feature. Deprecated in Premake 5.0.0-beta8. Use incrementallink API instead.
NoManifestPrevent the generation of a manifest for Windows executables and shared libraries. Deprecated in Premake 5.0.0-beta8. Use manifest API instead.
NoMinimalRebuildDisable Visual Studio's minimal rebuild feature. Deprecated in Premake 5.0.0-beta8. Use minimalrebuild API instead.Visual Studio has deprecated this feature as of vs2015.
NoPCHDisable precompiled header support. If not specified, the toolset default behavior will be used. Deprecated in Premake 5.0.0-beta8. Use enablepch API instead.
NoRuntimeChecksDisable Visual Studio's default stack frame and uninitialized variable checks on debug builds. Deprecated in Premake 5.0.0-beta8. Use runtimechecks API instead.
OmitDefaultLibraryOmit the specification of a runtime library in object files. Deprecated in Premake 5.0.0-beta8. Use nodefaultlib API instead.
RelativeLinksForces the linker to use relative paths to libraries instead of absolute paths. Deprecated in Premake 5.0.0-beta8. Use userelativelinks API instead.
ShadowedVariablesWarn when a variable, type declaration, or function is shadowed. Deprecated in Premake 5.0.0-beta8. Use buildoptions API instead to add compile warnings.
UndefinedIdentifiersWarn if an undefined identifier is evaluated in an #if directive. Deprecated in Premake 5.0.0-beta8. Use buildoptions API instead to add compile warnings.
WPFMark the project as using Windows Presentation Framework, rather than WinForms. Deprecated in Premake 5.0.0-beta8. Use wpf API instead.
DebugEnvsDontMergePrevent debug environment variables from being merged with system environment. Deprecated in Premake 5.0.0-beta8. Use debugenvsmerge API instead.
DebugEnvsInheritInherit parent environment variables when using debug environment variables. Deprecated in Premake 5.0.0-beta8. Use debugenvsinherit API instead.

Applies To

Project and file configurations, though not all flags are yet supported for files across all exporters.

Availability

Flags are deprecated as of 5.0.0-beta8 in favor of dedicated APIs.

Examples

-- Enable link-time (i.e. whole program) optimizations.
flags { "LinkTimeOptimization" }

See Also