2012-10-19 22:53:03 +00:00
|
|
|
--
|
|
|
|
-- _premake_init.lua
|
|
|
|
--
|
|
|
|
-- Prepares the runtime environment for the add-ons and user project scripts.
|
|
|
|
--
|
2013-09-04 19:28:22 +00:00
|
|
|
-- Copyright (c) 2012-2013 Jason Perkins and the Premake project
|
2012-10-19 22:53:03 +00:00
|
|
|
--
|
|
|
|
|
|
|
|
|
2013-09-04 19:28:22 +00:00
|
|
|
--
|
|
|
|
-- Set the default module search paths. Modules will generally live in a
|
|
|
|
-- folder of the same name: ninja/ninja.lua. The search order is the same
|
|
|
|
-- as what is specified here.
|
|
|
|
--
|
|
|
|
|
|
|
|
local home = os.getenv("HOME") or os.getenv("USERPROFILE")
|
|
|
|
|
|
|
|
local packagePaths = {
|
|
|
|
path.join(home, ".premake/?/?.lua"),
|
|
|
|
"./modules/?/?.lua",
|
|
|
|
path.join(path.getdirectory(_PREMAKE_COMMAND), "modules/?/?.lua"),
|
|
|
|
path.join(home, "Library/Application Support/Premake/?/?.lua"),
|
|
|
|
"/usr/local/share/premake/?/?.lua",
|
|
|
|
"/usr/share/premake/?/?.lua",
|
|
|
|
}
|
|
|
|
|
|
|
|
package.path = table.concat(packagePaths, ";")
|
|
|
|
|
|
|
|
|
2013-09-08 15:51:33 +00:00
|
|
|
--
|
|
|
|
-- Set up the global environment for the systems I know about. I would like to see
|
|
|
|
-- at least some if not all of this moved into add-ons in the future.
|
2012-10-23 21:03:25 +00:00
|
|
|
--
|
|
|
|
-- Use Posix-style target naming by default, since it is the most common.
|
2012-10-19 22:53:03 +00:00
|
|
|
--
|
|
|
|
|
2012-10-31 19:46:28 +00:00
|
|
|
configuration { "SharedLib" }
|
|
|
|
targetprefix "lib"
|
|
|
|
targetextension ".so"
|
2012-10-19 22:53:03 +00:00
|
|
|
|
2012-10-31 19:46:28 +00:00
|
|
|
configuration { "StaticLib" }
|
|
|
|
targetprefix "lib"
|
|
|
|
targetextension ".a"
|
2012-10-19 22:53:03 +00:00
|
|
|
|
2012-10-23 21:03:25 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Add variations for other Posix-like systems.
|
|
|
|
--
|
|
|
|
|
2012-10-31 19:46:28 +00:00
|
|
|
configuration { "MacOSX", "SharedLib" }
|
|
|
|
targetextension ".dylib"
|
2012-10-19 22:53:03 +00:00
|
|
|
|
2012-10-31 19:46:28 +00:00
|
|
|
configuration { "PS3", "ConsoleApp" }
|
|
|
|
targetextension ".elf"
|
2012-10-19 22:53:03 +00:00
|
|
|
|
2012-10-23 21:03:25 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Windows and friends.
|
|
|
|
--
|
|
|
|
|
2013-03-07 17:14:03 +00:00
|
|
|
configuration { "Windows or C#", "ConsoleApp or WindowedApp" }
|
2012-10-31 19:46:28 +00:00
|
|
|
targetextension ".exe"
|
2012-10-19 22:53:03 +00:00
|
|
|
|
2013-03-07 17:14:03 +00:00
|
|
|
configuration { "Xbox360", "ConsoleApp or WindowedApp" }
|
2013-08-16 02:24:39 +00:00
|
|
|
targetextension ".exe"
|
2013-03-07 17:14:03 +00:00
|
|
|
|
2012-10-31 23:34:53 +00:00
|
|
|
configuration { "Windows or Xbox360 or C#", "SharedLib" }
|
2012-10-31 19:46:28 +00:00
|
|
|
targetprefix ""
|
|
|
|
targetextension ".dll"
|
|
|
|
implibextension ".lib"
|
2012-10-19 22:53:03 +00:00
|
|
|
|
2012-10-31 23:34:53 +00:00
|
|
|
configuration { "Windows or Xbox360 or C#", "StaticLib" }
|
2012-10-31 19:46:28 +00:00
|
|
|
targetprefix ""
|
|
|
|
targetextension ".lib"
|
2013-09-08 15:51:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Install Premake's default set of command line arguments.
|
|
|
|
--
|
|
|
|
|
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "cc",
|
|
|
|
value = "VALUE",
|
|
|
|
description = "Choose a C/C++ compiler set",
|
|
|
|
allowed = {
|
|
|
|
{ "clang", "Clang (clang)" },
|
|
|
|
{ "gcc", "GNU GCC (gcc/g++)" },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "dotnet",
|
|
|
|
value = "VALUE",
|
|
|
|
description = "Choose a .NET compiler set",
|
|
|
|
allowed = {
|
|
|
|
{ "msnet", "Microsoft .NET (csc)" },
|
|
|
|
{ "mono", "Novell Mono (mcs)" },
|
|
|
|
{ "pnet", "Portable.NET (cscc)" },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "file",
|
|
|
|
value = "FILE",
|
|
|
|
description = "Read FILE as a Premake script; default is 'premake4.lua'"
|
|
|
|
}
|
|
|
|
|
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "help",
|
|
|
|
description = "Display this information"
|
|
|
|
}
|
|
|
|
|
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "os",
|
|
|
|
value = "VALUE",
|
|
|
|
description = "Generate files for a different operating system",
|
|
|
|
allowed = {
|
|
|
|
{ "aix", "IBM AIX" },
|
|
|
|
{ "bsd", "OpenBSD, NetBSD, or FreeBSD" },
|
|
|
|
{ "haiku", "Haiku" },
|
|
|
|
{ "hurd", "GNU/Hurd" },
|
|
|
|
{ "linux", "Linux" },
|
|
|
|
{ "macosx", "Apple Mac OS X" },
|
|
|
|
{ "solaris", "Solaris" },
|
|
|
|
{ "windows", "Microsoft Windows" },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "scripts",
|
|
|
|
value = "path",
|
|
|
|
description = "Search for additional scripts on the given path"
|
|
|
|
}
|
|
|
|
|
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "systemscript",
|
|
|
|
value = "FILE",
|
|
|
|
description = "Override default system script (premake5-system.lua)"
|
|
|
|
}
|
|
|
|
|
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "version",
|
|
|
|
description = "Display version information"
|
|
|
|
}
|