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.
FatalCompileWarningsTreat compiler warnings as errors.
FatalLinkWarningsTreat linker warnings as errors.
FatalWarningsTreat all warnings as errors; equivalent to FatalCompileWarnings, FatalLinkWarnings
LinkTimeOptimizationEnable link-time (i.e. whole program) optimizations.
MapsEnable Generate Map File for Visual Studio
MFCEnable support for Microsoft Foundation Classes.
MultiProcessorCompileEnable Visual Studio to use multiple compiler processes when building.
No64BitChecksDisable 64-bit portability warnings.
NoBufferSecurityCheckTurn off stack protection checks.
NoCopyLocalPrevent referenced assemblies from being copied to the target directory (C#)
NoFramePointerDisable the generation of stack frame pointers.
NoImplicitLinkDisable Visual Studio's default behavior of automatically linking dependent projects.
NoImportLibPrevent the generation of an import library for a Windows DLL.
NoIncrementalLinkDisable support for Visual Studio's incremental linking feature.
NoManifestPrevent the generation of a manifest for Windows executables and shared libraries.
NoMinimalRebuildDisable Visual Studio's minimal rebuild feature.Visual Studio has deprecated this feature as of vs2015.
NoPCHDisable precompiled header support. If not specified, the toolset default behavior will be used.
NoRuntimeChecksDisable Visual Studio's default stack frame and uninitialized variable checks on debug builds.
OmitDefaultLibraryOmit the specification of a runtime library in object files.
RelativeLinksForces the linker to use relative paths to libraries instead of absolute paths.
ShadowedVariablesWarn when a variable, type declaration, or function is shadowed.
StaticRuntimePerform a static link against the standard runtime libraries.Deprecated - use staticruntime "On" instead.
UndefinedIdentifiersWarn if an undefined identifier is evaluated in an #if directive.
WinMainUse WinMain() as entry point for Windows applications, rather than the default main().
WPFMark the project as using Windows Presentation Framework, rather than WinForms.
C++11Pass the c++11 flag to the gcc/clang compilers (msvc ignores this currently)
C++14Pass the c++14 flag to the gcc/clang compilers (msvc ignores this currently)
C90Pass the c90 flag to the gcc/clang compilers (msvc ignores this currently)
C99Pass the c99 flag to the gcc/clang compilers (msvc ignores this currently)
ComponentNeeds documentation
DebugEnvsDontMergeNeeds documentation
DebugEnvsInheritNeeds documentation
EnableSSENeeds documentation
EnableSSE2Needs documentation
ExtraWarningsNeeds documentation
FloatFastNeeds documentation
FloatStrictNeeds documentation
ManagedNeeds documentation
NoNativeWCharNeeds documentation
NoEditAndContinueNeeds documentation
NoWarningsNeeds documentation
OptimizeNeeds documentation
OptimizeSizeNeeds documentation
OptimizeSpeedNeeds documentation
ReleaseRuntimeNeeds documentation
SymbolsNeeds documentation
C11Needs documentation
CodeCoverageNeeds documentation
ColorNeeds documentation
DocumentationNeeds documentation
GenerateHeaderNeeds documentation
GenerateJSONNeeds documentation
GenerateMapNeeds documentation
LowMemNeeds documentation
ProfileNeeds documentation
QuietNeeds documentation
RetainPathsNeeds documentation
SymbolsLikeCNeeds documentation
UnitTestNeeds documentation
UseLDCNeeds documentation
ProfileGCNeeds documentation
StackFrameNeeds documentation
StackStompNeeds documentation
AllInstantiateNeeds documentation
BetterCNeeds documentation
PerformSyntaxCheckOnlyNeeds documentation
ShowCommandLineNeeds documentation
VerboseNeeds documentation
ShowTLSNeeds documentation
ShowGCNeeds documentation
IgnorePragmaNeeds documentation
ShowDependenciesNeeds documentation
ThumbNeeds documentation

Applies To

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

Availability

Unless otherwise noted, Premake 5.0 or later.

Examples

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