1. Premake
  2. Untitled project
  3. premake-dev

Wiki

Clone wiki

premake-dev / flags

We've moved to GitHub!

The latest version of this page is now here.


The flags function specifies build flags to modify the compiling or linking process.

flags { "flag_list" }

If a project includes multiple calls to flags the lists are concatenated, in the order in which they appear in the script.

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.

Flag Description
Component Deprecated; see buildaction
EnableSSE Deprecated; see vectorextensions
EnableSSE2 Deprecated; see vectorextensions
ExcludeFromBuild Exclude a source code file from the build, for the current configuration.
ExtraWarnings Deprecated; see warnings
FatalCompileWarnings Treat compiler warnings as errors.
FatalLinkWarnings Treat linker warnings as errors.
FatalWarnings Treat all warnings as errors; equivalent to FatalCompileWarnings, FatalLinkWarnings
FloatFast Deprecated; see floatingpoint
FloatStrict Deprecated; see floatingpoint
LinkTimeOptimization Enable link-time (i.e. whole program) optimizations.
Managed Deprecated, see clr
Maps Enable Generate Map File for Visual Studio
MFC Enable support for Microsoft Foundation Classes.
MultiProcessorCompile Enable Visual Studio to use multiple compiler processes when building.
No64BitChecks Disable 64-bit portability warnings.
NoBufferSecurityCheck Turn off stack protection checks.
NoCopyLocal Prevent referenced assemblies from being copied to the target directory (C#)
NoEditAndContinue Deprecated, see editAndContinue.
NoExceptions Disable C++ exception support.
NoFramePointer Disable the generation of stack frame pointers.
NativeWChar Deprecated; see nativewchar
NoNativeWChar Deprecated; see nativewchar
NoImplicitLink Disable Visual Studio's default behavior of automatically linking dependent projects.
NoIncrementalLink Disable support for Visual Studio's incremental linking feature.
NoImportLib Prevent the generation of an import library for a Windows DLL.
NoManifest Prevent the generation of a manifest for Windows executables and shared libraries.
NoMinimalRebuild Disable Visual Studio's minimal rebuild feature.
NoPCH Disable precompiled header support. If not specified, the toolset default behavior will be used.
NoRTTI Disable C++ runtime type information.
NoRuntimeChecks Disable Visual Studio's default stack frame and uninitialized variable checks on debug builds.
NoWarnings Deprecated; see warnings
OmitDefaultLibrary Omit the specification of a runtime library in object files.
Optimize Deprecated; see optimize
OptimizeSize Deprecated; see optimize
OptimizeSpeed Deprecated; see optimize
SEH Enable structured exception handling.
StaticRuntime Perform a static link against the standard runtime libraries.
Symbols Generate debugging information.
Unicode Enable Unicode strings. If not specified, the default toolset behavior is used.
Unsafe Deprecated, see clr
WinMain Use WinMain() as entry point for Windows applications, rather than the default main().
WPF Mark the project as using Windows Presentation Framework, rather than WinForms.

Applies To

Configurations, both for projects and individual files, though not all flags are yet supported for files.

Availability

Unless otherwise noted, Premake 4.0 or later.

Examples

A common configuration: enable debugging symbols in the Debug configuration, and optimize the Release configuration.

-- Turn off C++ features
flags { "NoExceptions", "NoRTTI" }

Updated