Skip to content
mba105 edited this page Sep 24, 2014 · 2 revisions

Home > [Scripting Reference](Scripting Reference) > os.get


os.get

The os.get function identifies the currently targeted operating system.

#!lua
id = os.get()

Parameters

None.

Return Value

An operating system identifier, one of bsd, linux, macosx, solaris, or windows.

Note that this function returns the OS being targeted, which is not necessarily the same as the OS on which Premake is being run. If you are running on Mac OS X and generating Visual Studio project files, the identifier is "Windows", since that is the OS being targeted by the Visual Studio action.

Example

#!lua
if os.get() == "windows" then
   -- do something Windows-specific
end
Clone this wiki locally