2012-10-19 22:53:03 +00:00
|
|
|
--
|
|
|
|
-- _premake_init.lua
|
|
|
|
--
|
|
|
|
-- Prepares the runtime environment for the add-ons and user project scripts.
|
|
|
|
--
|
2014-04-25 15:53:01 +00:00
|
|
|
-- Copyright (c) 2012-2014 Jason Perkins and the Premake project
|
2012-10-19 22:53:03 +00:00
|
|
|
--
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
local api = premake.api
|
2012-10-19 22:53:03 +00:00
|
|
|
|
2013-10-02 19:59:54 +00:00
|
|
|
local DOC_URL = "See https://bitbucket.org/premake/premake-dev/wiki/"
|
2013-09-27 19:12:50 +00:00
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
2013-09-08 15:51:33 +00:00
|
|
|
--
|
2013-09-26 16:24:10 +00:00
|
|
|
-- Register the core API functions.
|
2012-10-23 21:03:25 +00:00
|
|
|
--
|
2013-09-26 16:24:10 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "architecture",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"universal",
|
|
|
|
"x32",
|
|
|
|
"x64",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2014-07-23 19:53:43 +00:00
|
|
|
api.register {
|
|
|
|
name = "atl",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"Off",
|
|
|
|
"Dynamic",
|
|
|
|
"Static",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "basedir",
|
|
|
|
scope = "project",
|
|
|
|
kind = "path"
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "buildaction",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
2013-11-15 22:17:41 +00:00
|
|
|
"Application",
|
2013-09-26 16:24:10 +00:00
|
|
|
"Compile",
|
|
|
|
"Component",
|
|
|
|
"Copy",
|
|
|
|
"Embed",
|
|
|
|
"Form",
|
|
|
|
"None",
|
2013-11-16 16:53:48 +00:00
|
|
|
"Resource",
|
2013-09-26 16:24:10 +00:00
|
|
|
"UserControl",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "buildcommands",
|
2014-08-27 20:38:58 +00:00
|
|
|
scope = { "config", "rule" },
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-08-27 20:38:58 +00:00
|
|
|
api.alias("buildcommands", "buildCommands")
|
|
|
|
|
2014-09-03 20:14:42 +00:00
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "buildDependencies",
|
|
|
|
scope = { "rule" },
|
|
|
|
kind = "list:string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "buildmessage",
|
|
|
|
scope = { "config", "rule" },
|
|
|
|
kind = "string",
|
|
|
|
tokens = true
|
|
|
|
}
|
|
|
|
|
|
|
|
api.alias("buildmessage", "buildMessage")
|
|
|
|
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "buildoptions",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-09-03 20:14:42 +00:00
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "buildoutputs",
|
2014-09-03 20:14:42 +00:00
|
|
|
scope = { "config", "rule" },
|
2014-07-23 19:53:43 +00:00
|
|
|
kind = "list:path",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-09-03 20:14:42 +00:00
|
|
|
api.alias("buildoutputs", "buildOutputs")
|
|
|
|
|
|
|
|
|
2014-09-25 08:41:27 +00:00
|
|
|
api.register {
|
|
|
|
name = "buildinputs",
|
|
|
|
scope = "config",
|
|
|
|
kind = "list:path",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "buildrule", -- DEPRECATED
|
|
|
|
scope = "config",
|
2014-02-27 22:40:25 +00:00
|
|
|
kind = "table",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "cleancommands",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-07-16 19:32:08 +00:00
|
|
|
api.register {
|
|
|
|
name = "cleanExtensions",
|
|
|
|
scope = "config",
|
|
|
|
kind = "list:string",
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "configmap",
|
|
|
|
scope = "config",
|
2014-08-28 13:19:14 +00:00
|
|
|
kind = "list:keyed:array:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
}
|
|
|
|
|
2014-09-20 22:32:18 +00:00
|
|
|
api.register {
|
|
|
|
name = "configFile",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "configurations",
|
|
|
|
scope = "project",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "copylocal",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:mixed",
|
2014-06-10 20:38:16 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "debugargs",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "debugcommand",
|
|
|
|
scope = "config",
|
|
|
|
kind = "path",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "debugdir",
|
|
|
|
scope = "config",
|
|
|
|
kind = "path",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "debugenvs",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "debugformat",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"c7",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2014-03-18 22:01:59 +00:00
|
|
|
api.register {
|
|
|
|
name = "defaultplatform",
|
|
|
|
scope = "project",
|
|
|
|
kind = "string",
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "defines",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "dependson",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "deploymentoptions",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-09-10 20:38:38 +00:00
|
|
|
|
|
|
|
api.register {
|
2014-09-11 14:20:13 +00:00
|
|
|
name = "display",
|
2014-09-10 20:38:38 +00:00
|
|
|
scope = "rule",
|
|
|
|
kind = "string",
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
-- For backward compatibility, excludes() is now an alias for removefiles()
|
|
|
|
function excludes(value)
|
|
|
|
removefiles(value)
|
|
|
|
end
|
|
|
|
|
2014-09-19 19:26:56 +00:00
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "fileExtension",
|
|
|
|
scope = "rule",
|
|
|
|
kind = "string",
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "filename",
|
2014-08-27 20:38:58 +00:00
|
|
|
scope = { "project", "rule" },
|
2013-09-26 16:24:10 +00:00
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "files",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:file",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "flags",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
allowed = {
|
|
|
|
"Component", -- DEPRECATED
|
|
|
|
"DebugEnvsDontMerge",
|
|
|
|
"DebugEnvsInherit",
|
2013-09-27 18:25:10 +00:00
|
|
|
"EnableSSE", -- DEPRECATED
|
|
|
|
"EnableSSE2", -- DEPRECATED
|
2013-09-26 16:24:10 +00:00
|
|
|
"ExcludeFromBuild",
|
2013-09-27 18:25:10 +00:00
|
|
|
"ExtraWarnings", -- DEPRECATED
|
2014-02-14 17:23:12 +00:00
|
|
|
"FatalCompileWarnings",
|
|
|
|
"FatalLinkWarnings",
|
2013-09-27 18:25:10 +00:00
|
|
|
"FloatFast", -- DEPRECATED
|
|
|
|
"FloatStrict", -- DEPRECATED
|
2013-09-26 16:24:10 +00:00
|
|
|
"LinkTimeOptimization",
|
|
|
|
"Managed",
|
2014-05-01 19:32:50 +00:00
|
|
|
"Maps",
|
2013-09-26 16:24:10 +00:00
|
|
|
"MFC",
|
|
|
|
"MultiProcessorCompile",
|
2013-09-27 18:25:10 +00:00
|
|
|
"NativeWChar", -- DEPRECATED
|
2013-09-26 16:24:10 +00:00
|
|
|
"No64BitChecks",
|
|
|
|
"NoCopyLocal",
|
|
|
|
"NoEditAndContinue",
|
|
|
|
"NoExceptions",
|
|
|
|
"NoFramePointer",
|
|
|
|
"NoImplicitLink",
|
|
|
|
"NoImportLib",
|
|
|
|
"NoIncrementalLink",
|
|
|
|
"NoManifest",
|
|
|
|
"NoMinimalRebuild",
|
2013-09-27 18:25:10 +00:00
|
|
|
"NoNativeWChar", -- DEPRECATED
|
2013-09-26 16:24:10 +00:00
|
|
|
"NoPCH",
|
|
|
|
"NoRuntimeChecks",
|
|
|
|
"NoRTTI",
|
|
|
|
"NoBufferSecurityCheck",
|
2013-09-27 18:25:10 +00:00
|
|
|
"NoWarnings", -- DEPRECATED
|
2013-11-22 19:06:41 +00:00
|
|
|
"OmitDefaultLibrary",
|
2013-09-27 18:25:10 +00:00
|
|
|
"Optimize", -- DEPRECATED
|
|
|
|
"OptimizeSize", -- DEPRECATED
|
|
|
|
"OptimizeSpeed", -- DEPRECATED
|
2013-09-26 16:24:10 +00:00
|
|
|
"ReleaseRuntime",
|
|
|
|
"SEH",
|
|
|
|
"StaticRuntime",
|
|
|
|
"Symbols",
|
|
|
|
"Unicode",
|
|
|
|
"Unsafe",
|
|
|
|
"WinMain",
|
2013-11-15 21:35:27 +00:00
|
|
|
"WPF",
|
2013-09-26 16:24:10 +00:00
|
|
|
},
|
|
|
|
aliases = {
|
2014-03-09 13:55:18 +00:00
|
|
|
FatalWarnings = { "FatalWarnings", "FatalCompileWarnings", "FatalLinkWarnings" },
|
2013-09-26 16:24:10 +00:00
|
|
|
Optimise = 'Optimize',
|
|
|
|
OptimiseSize = 'OptimizeSize',
|
|
|
|
OptimiseSpeed = 'OptimizeSpeed',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2013-09-27 18:49:21 +00:00
|
|
|
api.register {
|
|
|
|
name = "floatingpoint",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"Default",
|
|
|
|
"Fast",
|
|
|
|
"Strict",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "forceincludes",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:mixed",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "forceusings",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:file",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "framework",
|
2014-02-14 20:18:37 +00:00
|
|
|
scope = "config",
|
2013-09-26 16:24:10 +00:00
|
|
|
kind = "string",
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "icon",
|
|
|
|
scope = "project",
|
|
|
|
kind = "file",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "imageoptions",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "imagepath",
|
|
|
|
scope = "config",
|
|
|
|
kind = "path",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "implibdir",
|
|
|
|
scope = "config",
|
|
|
|
kind = "path",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "implibextension",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "implibname",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "implibprefix",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "implibsuffix",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "includedirs",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:directory",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "kind",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"ConsoleApp",
|
|
|
|
"Makefile",
|
|
|
|
"None",
|
|
|
|
"SharedLib",
|
|
|
|
"StaticLib",
|
|
|
|
"WindowedApp",
|
2014-03-01 17:20:06 +00:00
|
|
|
"Utility",
|
2013-09-26 16:24:10 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "language",
|
|
|
|
scope = "project",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"C",
|
|
|
|
"C++",
|
|
|
|
"C#",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "libdirs",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:directory",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "linkoptions",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "links",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:mixed",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-02-06 20:38:51 +00:00
|
|
|
api.register {
|
|
|
|
name = "locale",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = false,
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "location",
|
2014-08-27 20:38:58 +00:00
|
|
|
scope = { "project", "rule" },
|
2013-09-26 16:24:10 +00:00
|
|
|
kind = "path",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "makesettings",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "namespace",
|
|
|
|
scope = "project",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2013-09-27 19:12:50 +00:00
|
|
|
api.register {
|
|
|
|
name = "nativewchar",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"Default",
|
|
|
|
"On",
|
|
|
|
"Off",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "objdir",
|
|
|
|
scope = "config",
|
|
|
|
kind = "path",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2013-09-29 15:23:39 +00:00
|
|
|
api.register {
|
|
|
|
name = "optimize",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"Off",
|
|
|
|
"On",
|
2013-10-16 17:47:09 +00:00
|
|
|
"Debug",
|
2013-09-29 15:23:39 +00:00
|
|
|
"Size",
|
|
|
|
"Speed",
|
2013-10-16 17:47:09 +00:00
|
|
|
"Full",
|
2013-09-29 15:23:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "pchheader",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "pchsource",
|
|
|
|
scope = "config",
|
|
|
|
kind = "path",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "platforms",
|
|
|
|
scope = "project",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "postbuildcommands",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-01-15 21:12:29 +00:00
|
|
|
api.register {
|
|
|
|
name = "postbuildmessage",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "prebuildcommands",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-01-15 21:12:29 +00:00
|
|
|
api.register {
|
|
|
|
name = "prebuildmessage",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "prelinkcommands",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-01-15 21:12:29 +00:00
|
|
|
api.register {
|
|
|
|
name = "prelinkmessage",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-08-27 14:40:36 +00:00
|
|
|
api.register {
|
|
|
|
name = "propertyDefinition",
|
|
|
|
scope = "rule",
|
|
|
|
kind = "list:table",
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "rebuildcommands",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "resdefines",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "resincludedirs",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:directory",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "resoptions",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:string",
|
2013-09-26 16:24:10 +00:00
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
2014-10-20 19:41:00 +00:00
|
|
|
api.register {
|
|
|
|
name = "rules",
|
|
|
|
scope = "project",
|
|
|
|
kind = "list:string",
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "startproject",
|
|
|
|
scope = "solution",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "system",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"aix",
|
|
|
|
"bsd",
|
|
|
|
"haiku",
|
|
|
|
"linux",
|
|
|
|
"macosx",
|
|
|
|
"ps3",
|
|
|
|
"solaris",
|
|
|
|
"wii",
|
|
|
|
"windows",
|
|
|
|
"xbox360",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "targetdir",
|
|
|
|
scope = "config",
|
|
|
|
kind = "path",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "targetextension",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "targetname",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "targetprefix",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "targetsuffix",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
tokens = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
api.register {
|
|
|
|
name = "toolset",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
2014-02-27 14:54:55 +00:00
|
|
|
allowed = function(value)
|
|
|
|
local key = value:lower()
|
|
|
|
if premake.tools[key] ~= nil then
|
|
|
|
return key
|
|
|
|
end
|
|
|
|
end,
|
2013-09-26 16:24:10 +00:00
|
|
|
}
|
|
|
|
|
2013-09-27 23:04:18 +00:00
|
|
|
api.register {
|
|
|
|
name = "usingdirs",
|
|
|
|
scope = "config",
|
2014-03-09 13:55:18 +00:00
|
|
|
kind = "list:directory",
|
2013-09-27 23:04:18 +00:00
|
|
|
tokens = true,
|
2013-11-15 21:35:27 +00:00
|
|
|
}
|
2013-09-27 23:04:18 +00:00
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "uuid",
|
|
|
|
scope = "project",
|
|
|
|
kind = "string",
|
|
|
|
allowed = function(value)
|
|
|
|
local ok = true
|
|
|
|
if (#value ~= 36) then ok = false end
|
|
|
|
for i=1,36 do
|
|
|
|
local ch = value:sub(i,i)
|
|
|
|
if (not ch:find("[ABCDEFabcdef0123456789-]")) then ok = false end
|
|
|
|
end
|
|
|
|
if (value:sub(9,9) ~= "-") then ok = false end
|
|
|
|
if (value:sub(14,14) ~= "-") then ok = false end
|
|
|
|
if (value:sub(19,19) ~= "-") then ok = false end
|
|
|
|
if (value:sub(24,24) ~= "-") then ok = false end
|
|
|
|
if (not ok) then
|
|
|
|
return nil, "invalid UUID"
|
|
|
|
end
|
|
|
|
return value:upper()
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
2013-09-27 18:25:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "vectorextensions",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"Default",
|
2014-03-18 20:26:21 +00:00
|
|
|
"AVX",
|
2013-09-27 18:25:10 +00:00
|
|
|
"SSE",
|
|
|
|
"SSE2",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
api.register {
|
|
|
|
name = "vpaths",
|
|
|
|
scope = "project",
|
2014-03-09 17:17:10 +00:00
|
|
|
kind = "list:keyed:list:path",
|
2013-09-26 16:24:10 +00:00
|
|
|
}
|
|
|
|
|
2013-09-29 16:39:07 +00:00
|
|
|
api.register {
|
|
|
|
name = "warnings",
|
|
|
|
scope = "config",
|
|
|
|
kind = "string",
|
|
|
|
allowed = {
|
|
|
|
"Off",
|
|
|
|
"Default",
|
|
|
|
"Extra",
|
|
|
|
}
|
|
|
|
}
|
2013-09-26 16:24:10 +00:00
|
|
|
|
2013-09-27 18:25:10 +00:00
|
|
|
|
2014-09-20 22:32:18 +00:00
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
-----------------------------------------------------------------------------
|
2012-10-19 22:53:03 +00:00
|
|
|
--
|
2013-09-26 16:24:10 +00:00
|
|
|
-- Handlers for deprecated fields and values.
|
|
|
|
--
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
-- 09 Apr 2013
|
|
|
|
|
2013-10-02 19:59:54 +00:00
|
|
|
api.deprecateField("buildrule", DOC_URL .. "Custom_Build_Commands",
|
|
|
|
function(value)
|
2013-09-26 16:24:10 +00:00
|
|
|
if value.description then
|
|
|
|
buildmessage(value.description)
|
|
|
|
end
|
|
|
|
buildcommands(value.commands)
|
|
|
|
buildoutputs(value.outputs)
|
|
|
|
end)
|
|
|
|
|
|
|
|
-- 17 Jun 2013
|
|
|
|
|
2013-10-02 19:59:54 +00:00
|
|
|
api.deprecateValue("flags", "Component", DOC_URL .. "buildaction",
|
|
|
|
function(value)
|
2013-09-26 16:24:10 +00:00
|
|
|
buildaction "Component"
|
|
|
|
end)
|
|
|
|
|
2013-09-27 18:25:10 +00:00
|
|
|
-- 26 Sep 2013
|
2013-09-26 16:24:10 +00:00
|
|
|
|
2013-10-02 19:59:54 +00:00
|
|
|
api.deprecateValue("flags", { "EnableSSE", "EnableSSE2" }, DOC_URL .. "vectorextensions",
|
|
|
|
function(value)
|
2013-09-27 18:25:10 +00:00
|
|
|
vectorextensions(value:sub(7))
|
2013-10-02 19:59:54 +00:00
|
|
|
end,
|
|
|
|
function(value)
|
|
|
|
vectorextension "Default"
|
2013-09-27 18:25:10 +00:00
|
|
|
end)
|
2012-10-19 22:53:03 +00:00
|
|
|
|
2013-10-02 19:59:54 +00:00
|
|
|
api.deprecateValue("flags", { "FloatFast", "FloatStrict" }, DOC_URL .. "floatingpoint",
|
|
|
|
function(value)
|
2013-09-27 18:49:21 +00:00
|
|
|
floatingpoint(value:sub(6))
|
2013-10-02 19:59:54 +00:00
|
|
|
end,
|
|
|
|
function(value)
|
|
|
|
floatingpoint "Default"
|
2013-09-27 19:12:50 +00:00
|
|
|
end)
|
|
|
|
|
2013-10-02 19:59:54 +00:00
|
|
|
api.deprecateValue("flags", { "NativeWChar", "NoNativeWChar" }, DOC_URL .. "nativewchar",
|
|
|
|
function(value)
|
2013-09-27 19:12:50 +00:00
|
|
|
local map = { NativeWChar = "On", NoNativeWChar = "Off" }
|
|
|
|
nativewchar(map[value] or "Default")
|
2013-10-02 19:59:54 +00:00
|
|
|
end,
|
|
|
|
function(value)
|
|
|
|
nativewchar "Default"
|
2013-09-27 18:49:21 +00:00
|
|
|
end)
|
|
|
|
|
2013-10-02 19:59:54 +00:00
|
|
|
api.deprecateValue("flags", { "Optimize", "OptimizeSize", "OptimizeSpeed" }, DOC_URL .. "optimize",
|
|
|
|
function(value)
|
2013-09-29 15:23:39 +00:00
|
|
|
local map = { Optimize = "On", OptimizeSize = "Size", OptimizeSpeed = "Speed" }
|
|
|
|
optimize (map[value] or "Off")
|
2013-10-02 19:59:54 +00:00
|
|
|
end,
|
|
|
|
function(value)
|
|
|
|
optimize "Off"
|
2013-09-29 15:23:39 +00:00
|
|
|
end)
|
2013-09-08 15:51:33 +00:00
|
|
|
|
2014-02-14 17:23:12 +00:00
|
|
|
api.deprecateValue("flags", { "Optimise", "OptimiseSize", "OptimiseSpeed" }, DOC_URL .. "optimize",
|
|
|
|
function(value)
|
|
|
|
local map = { Optimise = "On", OptimiseSize = "Size", OptimiseSpeed = "Speed" }
|
|
|
|
optimize (map[value] or "Off")
|
|
|
|
end,
|
|
|
|
function(value)
|
|
|
|
optimize "Off"
|
|
|
|
end)
|
|
|
|
|
2013-10-02 19:59:54 +00:00
|
|
|
api.deprecateValue("flags", { "ExtraWarnings", "NoWarnings" }, DOC_URL .. "warnings",
|
|
|
|
function(value)
|
2013-09-29 16:39:07 +00:00
|
|
|
local map = { ExtraWarnings = "Extra", NoWarnings = "Off" }
|
|
|
|
warnings (map[value] or "Default")
|
2013-10-02 19:59:54 +00:00
|
|
|
end,
|
|
|
|
function(value)
|
|
|
|
warnings "Default"
|
2013-09-29 16:39:07 +00:00
|
|
|
end)
|
|
|
|
|
2013-09-08 15:51:33 +00:00
|
|
|
|
2013-09-26 16:24:10 +00:00
|
|
|
-----------------------------------------------------------------------------
|
2013-09-08 15:51:33 +00:00
|
|
|
--
|
|
|
|
-- Install Premake's default set of command line arguments.
|
|
|
|
--
|
2013-09-26 16:24:10 +00:00
|
|
|
-----------------------------------------------------------------------------
|
2013-09-08 15:51:33 +00:00
|
|
|
|
|
|
|
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)" },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-09 19:17:00 +00:00
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "fatal",
|
|
|
|
description = "Treat warnings from project scripts as errors"
|
|
|
|
}
|
|
|
|
|
2013-09-08 15:51:33 +00:00
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "file",
|
|
|
|
value = "FILE",
|
2013-09-10 20:24:39 +00:00
|
|
|
description = "Read FILE as a Premake script; default is 'premake5.lua'"
|
2013-09-08 15:51:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "help",
|
|
|
|
description = "Display this information"
|
|
|
|
}
|
|
|
|
|
2014-05-13 23:17:50 +00:00
|
|
|
newoption
|
|
|
|
{
|
|
|
|
trigger = "interactive",
|
|
|
|
description = "Interactive command prompt"
|
|
|
|
}
|
|
|
|
|
2013-09-08 15:51:33 +00:00
|
|
|
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",
|
2014-05-09 19:17:00 +00:00
|
|
|
value = "PATH",
|
2013-09-08 15:51:33 +00:00
|
|
|
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"
|
|
|
|
}
|
2013-09-27 18:25:10 +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.
|
|
|
|
--
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
2013-10-24 13:59:24 +00:00
|
|
|
-- Setting a default language makes some validation easier later
|
|
|
|
|
|
|
|
language "C++"
|
|
|
|
|
2013-09-27 18:25:10 +00:00
|
|
|
-- Use Posix-style target naming by default, since it is the most common.
|
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "kind:SharedLib" }
|
2013-09-27 18:25:10 +00:00
|
|
|
targetprefix "lib"
|
|
|
|
targetextension ".so"
|
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "kind:StaticLib" }
|
2013-09-27 18:25:10 +00:00
|
|
|
targetprefix "lib"
|
|
|
|
targetextension ".a"
|
|
|
|
|
|
|
|
-- Add variations for other Posix-like systems.
|
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "system:MacOSX", "kind:SharedLib" }
|
2013-09-27 18:25:10 +00:00
|
|
|
targetextension ".dylib"
|
|
|
|
|
|
|
|
-- Windows and friends.
|
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "system:Windows or language:C#", "kind:ConsoleApp or WindowedApp" }
|
2013-09-27 18:25:10 +00:00
|
|
|
targetextension ".exe"
|
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "system:Xbox360", "kind:ConsoleApp or WindowedApp" }
|
2013-09-27 18:25:10 +00:00
|
|
|
targetextension ".exe"
|
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "system:Windows or Xbox360", "kind:SharedLib" }
|
2013-09-27 18:25:10 +00:00
|
|
|
targetprefix ""
|
|
|
|
targetextension ".dll"
|
|
|
|
implibextension ".lib"
|
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "system:Windows or Xbox360", "kind:StaticLib" }
|
2013-09-27 18:25:10 +00:00
|
|
|
targetprefix ""
|
|
|
|
targetextension ".lib"
|
2013-12-20 14:48:03 +00:00
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "language:C#", "kind:SharedLib" }
|
2013-12-20 14:48:03 +00:00
|
|
|
targetprefix ""
|
|
|
|
targetextension ".dll"
|
|
|
|
implibextension ".dll"
|
2014-02-27 14:54:55 +00:00
|
|
|
|
|
|
|
-- PS3 configurations
|
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "system:PS3" }
|
2014-02-27 14:54:55 +00:00
|
|
|
toolset "snc"
|
|
|
|
|
2014-04-25 15:53:01 +00:00
|
|
|
filter { "system:PS3", "kind:ConsoleApp" }
|
2014-02-27 14:54:55 +00:00
|
|
|
targetextension ".elf"
|