-
Notifications
You must be signed in to change notification settings - Fork 21
flags
Home > [Scripting Reference](Scripting Reference) > flags
The flags function specifies build flags to modify the compiling or linking process.
#!lua
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.
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 |
---|---|
EnableSSE | Use the SSE instruction set for floating point math. |
EnableSSE2 | Use the SSE2 instruction set for floating point math. |
ExtraWarnings | Sets the compiler's maximum warning level. |
FatalWarnings | Treat warnings as errors. |
FloatFast | Enable floating point optimizations at the expense of accuracy. |
FloatStrict | Improve floating point consistency at the expense of performance. |
Managed | Enable Managed C++ (.NET) features. |
MFC | Enable support for Microsoft Foundation Classes. |
NativeWChar, NoNativeWChar | Enable or disable support for the wchar data type. If no flag is specified, the toolset default will be used. |
No64BitChecks | Disable 64-bit portability warnings. |
NoEditAndContinue | Disable support for Visual Studio's Edit-and-Continue feature. |
NoExceptions | Disable C++ exception support. |
NoFramePointer | Disable the generation of stack frame pointers. |
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] |
OptimizeSize | Optimize for the smallest file size. |
OptimizeSpeed | Optimize for the best performance. |
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 | Enable the use of unsafe code in .NET applications. |
WinMain | Use WinMain() as the program entry point for Windows applications, rather than the default main(). |
Configurations, both for projects and individual files, though not all flags are yet supported for files.
Unless otherwise noted, Premake 4.0 or later.
A common configuration: enable debugging symbols in the Debug configuration, and optimize the Release configuration.
#!lua
configuration "Debug"
flags { "Symbols" }
configuration "Release"
flags { "Optimize" }
Enable the maximum warning level, and treat warnings as errors.
#!lua
flags { "ExtraWarnings", "FatalWarnings" }