Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt4
-rw-r--r--samples/project/CppConsoleApp/premake4.lua2
-rw-r--r--samples/project/CppSharedLib/premake4.lua1
-rw-r--r--samples/project/premake4.lua2
-rw-r--r--src/base/project.lua5
-rw-r--r--src/host/scripts.c2
6 files changed, 9 insertions, 7 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 4c1f382..85c7bd8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,6 +11,10 @@ This version is a complete rewrite of Premake.
- Upgraded to Lua 5.1.4
- Many, many bug fixes
+RC4 ->
+
+- Bug 2533504: Files above project root not added to project
+
RC3 -> RC4
- Embed scripts instead of bytecodes to avoid portability issues
diff --git a/samples/project/CppConsoleApp/premake4.lua b/samples/project/CppConsoleApp/premake4.lua
index 665789b..50c22d8 100644
--- a/samples/project/CppConsoleApp/premake4.lua
+++ b/samples/project/CppConsoleApp/premake4.lua
@@ -3,7 +3,7 @@ project "CppConsoleApp"
kind "ConsoleApp"
language "C++"
- files "*.cpp"
+ files { "*.cpp", "../fakefile.cpp" }
includedirs { "I:/Code" }
diff --git a/samples/project/CppSharedLib/premake4.lua b/samples/project/CppSharedLib/premake4.lua
index f774605..9f66cea 100644
--- a/samples/project/CppSharedLib/premake4.lua
+++ b/samples/project/CppSharedLib/premake4.lua
@@ -3,7 +3,6 @@ project "CppSharedLib"
kind "SharedLib"
language "C++"
files { "*.cpp", "CppSharedLib.def" }
- flags { "NoImportLib" }
configuration "Debug"
targetdir "lib/debug"
diff --git a/samples/project/premake4.lua b/samples/project/premake4.lua
index f97d16f..24a1cd0 100644
--- a/samples/project/premake4.lua
+++ b/samples/project/premake4.lua
@@ -42,5 +42,3 @@ solution "PremakeTestbox"
end
}
-print(os.findlib("hal"))
-
diff --git a/src/base/project.lua b/src/base/project.lua
index fe6930c..6a2ddde 100644
--- a/src/base/project.lua
+++ b/src/base/project.lua
@@ -311,6 +311,7 @@
result.fullpath = path.join(result.directory, result.name)
return result
end
+
--
@@ -320,7 +321,7 @@
local function walksources(prj, files, fn, group, nestlevel, finished)
local grouplen = group:len()
- local gname = iif(group:endswith("/"), group:sub(1,-2), group)
+ local gname = iif(group:endswith("/"), group:sub(1, -2), group)
-- open this new group
if (nestlevel >= 0) then
@@ -346,7 +347,7 @@
-- process all files that belong in this group
for _,fname in ipairs(files) do
- if (fname:startswith(group) and not fname:find("/", grouplen + 1, true)) then
+ if (fname:startswith(group) and not fname:find("[^\.]/", grouplen + 1)) then
fn(prj, fname, "GroupItem", nestlevel + 1)
end
end
diff --git a/src/host/scripts.c b/src/host/scripts.c
index ae3a6a4..b400123 100644
--- a/src/host/scripts.c
+++ b/src/host/scripts.c
@@ -8,7 +8,7 @@ const char* builtin_scripts[] = {
"--\n\n\n\nfunction table.contains(t, value)\nfor _,v in pairs(t) do\nif (v == value) then\nreturn true\nend\nend\nreturn false\nend\n\n\n\nfunction table.extract(arr, fname)\nlocal result = { }\nfor _,v in ipairs(arr) do\ntable.insert(result, v[fname])\nend\nreturn result\nend\n\n\n\n\nfunction table.implode(arr, before, after, between)\nlocal result = \"\"\nfor _,v in ipairs(arr) do\nif (result ~= \"\" and between) then\nresult = result .. between\nend\nresult = result .. before .. v .. after\nend\nreturn result\nend\n\n\n\nfunction table.join(...)\nlocal result = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor _,v in ipairs(t) do\ntable.insert(result, v)\nend\nelse\ntable.insert(result, t)\nend\nend\nreturn result\nend\n\n\n\nfunction table.translate(arr, translation)\nlocal result = { }\nfor _, value in ipairs(arr) do\nlocal tvalue\nif type(translation) == \"function\" then\ntvalue = translation(value)\nelse\ntvalue = translation[value]\nend\nif (tvalue) then\ntable.insert(result, tvalue)\nend\nend\nreturn result\nend\n\n",
"--\n\n\n\n_SOLUTIONS = { }\n\n\n\n_TEMPLATES = { }\n\n\n\npremake = { }\n\n\n\npremake.actions = { }\npremake.options = { }\n\n\n\n\nlocal builtin_dofile = dofile\nfunction dofile(fname)\n-- remember the current working directory; I'll restore it shortly\nlocal oldcwd = os.getcwd()\n\n-- if the file doesn't exist, check the search path\nif (not os.isfile(fname)) then\nlocal path = os.pathsearch(fname, _OPTIONS[\"scripts\"], os.getenv(\"PREMAKE_PATH\"))\nif (path) then\nfname = path..\"/\"..fname\nend\nend\n\n-- use the absolute path to the script file, to avoid any file name\n-- ambiguity if an error should arise\nfname = path.getabsolute(fname)\n\n-- switch the working directory to the new script location\nlocal newcwd = path.getdirectory(fname)\nos.chdir(newcwd)\n\n-- run the chunk. How can I catch variable return values?\nlocal a, b, c, d, e, f = builtin_dofile(fname)\n\n-- restore the previous working directory when done\nos.chdir(oldcwd)\nreturn a, b, c, d, e, f\nend\n\n\n\n\nfunction iif(expr, trueval, falseval)\nif (expr) then\nreturn trueval\nelse\nreturn falseval\nend\nend\n\n\n\n\nfunction include(fname)\nreturn dofile(fname .. \"/premake4.lua\")\nend\n\n\n\n\nlocal builtin_open = io.open\nfunction io.open(fname, mode)\nif (mode) then\nif (mode:find(\"w\")) then\nlocal dir = path.getdirectory(fname)\nok, err = os.mkdir(dir)\nif (not ok) then\nerror(err, 0)\nend\nend\nend\nreturn builtin_open(fname, mode)\nend\n\n\n\n\nfunction printf(msg, ...)\nprint(string.format(msg, unpack(arg)))\nend\n\n\n\n\nlocal builtin_type = type\nfunction type(t)\nlocal mt = getmetatable(t)\nif (mt) then\nif (mt.__type) then\nreturn mt.__type\nend\nend\nreturn builtin_type(t)\nend\n",
"--\n\n\n\nlocal function literal(str)\nlocal code = \"\"\n\nfor line in str:gmatch(\"[^\\n]*\") do\nif (line:len() > 0) then\ncode = code .. \"io.write[=[\" .. line .. \"]=]\"\nelse\ncode = code .. \"io.write(eol)\\n\"\nend\nend\n\nreturn code:sub(1, -15)\nend\n\n\n\n\nfunction premake.encodetemplate(tmpl)\ncode = \"\"\n\n-- normalize line endings\ntmpl = tmpl:gsub(\"\\r\\n\", \"\\n\")\n\nwhile (true) do\n-- find an escaped block\nstart, finish = tmpl:find(\"<%%.-%%>\")\nif (not start) then break end\n\nlocal before = tmpl:sub(1, start - 1)\nlocal after = tmpl:sub(finish + 1)\n\n-- get the block type and contents\nlocal block\nlocal isexpr = (tmpl:sub(start + 2, start + 2) == \"=\")\nif (isexpr) then\nblock = tmpl:sub(start + 3, finish - 2)\nelse\nblock = tmpl:sub(start + 2, finish - 2)\nend\n\n-- if a statement block, strip out everything else on that line\nif (not isexpr) then\nfinish = before:findlast(\"\\n\", true)\nif (finish) then \nbefore = before:sub(1, finish)\nelse\nbefore = nil\nend\n\nstart = after:find(\"\\n\", 1, true)\nif (start) then \nafter = after:sub(start + 1) \nend\nend\n\n-- output everything before the block\nif (before) then\ncode = code .. literal(before)\nend\n\n-- output the block itself\nif (isexpr) then\ncode = code .. \"io.write(\" .. block .. \")\"\nelse\ncode = code .. block .. \"\\n\"\nend\n\n-- do it again, with everything after the block\ntmpl = after\nend\n\n-- tack on everything after the last block\ncode = code .. literal(tmpl)\nreturn code\nend\n\n\n\n\nfunction premake.loadtemplatestring(name, str)\nlocal code = premake.encodetemplate(str)\nlocal fn, msg = loadstring(\"return function (this) eol='\\\\n';\" .. code .. \" end\", name)\nif (not fn) then\nerror(msg, 0)\nend\nreturn fn()\nend\n\n\n\n\nfunction premake.getoutputname(this, namespec)\nlocal fname\nif (type(namespec) == \"function\") then\nfname = namespec(this)\nelse\nfname = this.name .. namespec\nend\nreturn path.join(this.location, fname)\nend\n\n\n\n\nfunction premake.loadtemplatefile(fname)\nlocal f = io.open(fname, \"rb\")\nlocal tmpl = f:read(\"*a\")\nf:close()\nreturn premake.loadtemplatestring(path.getname(fname), tmpl)\nend\n\n",
- "--\n\n\n\n\nfunction premake.eachconfig(prj)\n-- I probably have the project root config, rather than the actual project\nif prj.project then prj = prj.project end\nlocal i = 0\nlocal t = prj.solution.configurations\nreturn function ()\ni = i + 1\nif (i <= #t) then\nreturn prj.__configs[t[i]]\nend\nend\nend\n\n\n\n\nfunction premake.eachfile(prj)\n-- project root config contains the file config list\nif not prj.project then prj = premake.getconfig(prj) end\nlocal i = 0\nlocal t = prj.files\nreturn function ()\ni = i + 1\nif (i <= #t) then\nreturn prj.__fileconfigs[t[i]]\nend\nend\nend\n\n\n\n\nfunction premake.eachproject(sln)\nlocal i = 0\nreturn function ()\ni = i + 1\nif (i <= #sln.projects) then\nlocal prj = sln.projects[i]\nlocal cfg = premake.getconfig(prj)\ncfg.name = prj.name\ncfg.blocks = prj.blocks\nreturn cfg\nend\nend\nend\n\n\n\n\nfunction premake.esc(value)\nif (type(value) == \"table\") then\nlocal result = { }\nfor _,v in ipairs(value) do\ntable.insert(result, premake.esc(v))\nend\nreturn result\nelse\nvalue = value:gsub('&', \"&amp;\")\nvalue = value:gsub('\"', \"&quot;\")\nvalue = value:gsub(\"'\", \"&apos;\")\nvalue = value:gsub('<', \"&lt;\")\nvalue = value:gsub('>', \"&gt;\")\nvalue = value:gsub('\\r', \"&#x0D;\")\nvalue = value:gsub('\\n', \"&#x0A;\")\nreturn value\nend\nend\n\n\n\n\nfunction premake.findproject(name)\nname = name:lower()\nfor _, sln in ipairs(_SOLUTIONS) do\nfor _, prj in ipairs(sln.projects) do\nif (prj.name:lower() == name) then\nreturn prj\nend\nend\nend\nend\n\n\n\n\nfunction premake.findfile(prj, extension)\nfor _, fname in ipairs(prj.files) do\nif fname:endswith(extension) then return fname end\nend\nend\n\n\n\n\nfunction premake.getconfig(prj, cfgname)\n-- might have the root configuration, rather than the actual project\nif prj.project then prj = prj.project end\nreturn prj.__configs[cfgname or \"\"]\nend\n\n\n\n\nfunction premake.getdependencies(cfg)\nlocal results = { }\nfor _, link in ipairs(cfg.links) do\nlocal prj = premake.findproject(link)\nif (prj) then\ntable.insert(results, prj)\nend\nend\nreturn results\nend\n\n\n\n\nfunction premake.getlinks(cfg, kind, part)\n-- if I'm building a list of link directories, include libdirs\nlocal result = iif (part == \"directory\" and kind == \"all\", cfg.libdirs, {})\n\n-- am I getting links for a configuration or a project?\nlocal cfgname = iif(cfg.name == cfg.project.name, \"\", cfg.name)\n\nlocal function canlink(source, target)\nif (target.kind ~= \"SharedLib\" and target.kind ~= \"StaticLib\") then return false end\nif (source.language == \"C\" or source.language == \"C++\") then\nif (target.language ~= \"C\" and target.language ~= \"C++\") then return false end\nreturn true\nelseif (source.language == \"C#\") then\nif (target.language ~= \"C#\") then return false end\nreturn true\nend\nend\n\nfor _, link in ipairs(cfg.links) do\nlocal item\n\n-- is this a sibling project?\nlocal prj = premake.findproject(link)\nif prj and kind ~= \"system\" then\n\nlocal prjcfg = premake.getconfig(prj, cfgname)\nif kind == \"dependencies\" or canlink(cfg, prjcfg) then\nif (part == \"directory\") then\nitem = path.rebase(prjcfg.linktarget.directory, prjcfg.location, cfg.location)\nelseif (part == \"basename\") then\nitem = prjcfg.linktarget.basename\nelseif (part == \"fullpath\") then\nitem = path.rebase(prjcfg.linktarget.fullpath, prjcfg.location, cfg.location)\nelseif (part == \"object\") then\nitem = prjcfg\nend\nend\n\nelseif not prj and (kind == \"system\" or kind == \"all\") then\n\nif (part == \"directory\") then\nlocal dir = path.getdirectory(link)\nif (dir ~= \".\") then\nitem = dir\nend\nelseif (part == \"fullpath\") then\nitem = link\nif premake.actions[_ACTION].targetstyle == \"windows\" then\nitem = item .. iif(cfg.language == \"C\" or cfg.language == \"C++\", \".lib\", \".dll\")\nend\nif item:find(\"/\", nil, true) then\nitem = path.getrelative(cfg.basedir, item)\nend\nelse\nitem = link\nend\n\nend\n\nif item then\nif premake.actions[_ACTION].targetstyle == \"windows\" and part ~= \"object\" then\nitem = path.translate(item, \"\\\\\")\nend\nif not table.contains(result, item) then\ntable.insert(result, item)\nend\nend\nend\n\nreturn result\nend\n\n\n\n\nfunction premake.gettarget(cfg, direction, style, os)\n-- normalize the arguments\nif not os then os = _G[\"os\"].get() end\nif (os == \"bsd\") then os = \"linux\" end\n\nlocal kind = cfg.kind\nif (cfg.language == \"C\" or cfg.language == \"C++\") then\n-- On Windows, shared libraries link against a static import library\nif (style == \"windows\" or os == \"windows\") and kind == \"SharedLib\" and direction == \"link\" then\nkind = \"StaticLib\"\nend\n\n-- Linux name conventions only apply to static libs on windows (by user request)\nif (style == \"linux\" and os == \"windows\" and kind ~= \"StaticLib\") then\nstyle = \"windows\"\nend\nelseif (cfg.language == \"C#\") then\n-- .NET always uses Windows naming conventions\nstyle = \"windows\"\nend\n\n-- Initialize the target components\nlocal field = iif(direction == \"build\", \"target\", \"implib\")\nlocal name = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal prefix = \"\"\nlocal suffix = \"\"\n\n-- If using an import library and \"NoImportLib\" flag is set, library will be in objdir\nif cfg.kind == \"SharedLib\" and kind == \"StaticLib\" and cfg.flags.NoImportLib then\ndir = cfg.objectsdir\nend\n\nif style == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\nsuffix = \".exe\"\nelseif kind == \"SharedLib\" then\nsuffix = \".dll\"\nelseif kind == \"StaticLib\" then\nsuffix = \".lib\"\nend\nelseif style == \"linux\" then\nif (kind == \"WindowedApp\" and os == \"macosx\") then\ndir = path.join(dir, name .. \".app/Contents/MacOS\")\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\nsuffix = \".so\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\nsuffix = \".a\"\nend\nend\n\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"extension\"] or cfg.targetextension or suffix\n\nlocal result = { }\nresult.basename = name\nresult.name = prefix .. name .. suffix\nresult.directory = dir\nresult.fullpath = path.join(result.directory, result.name)\nreturn result\nend\n\n\n\nlocal function walksources(prj, files, fn, group, nestlevel, finished)\nlocal grouplen = group:len()\nlocal gname = iif(group:endswith(\"/\"), group:sub(1,-2), group)\n\n-- open this new group\nif (nestlevel >= 0) then\nfn(prj, gname, \"GroupStart\", nestlevel)\nend\n\n-- scan the list of files for items which belong in this group\nfor _,fname in ipairs(files) do\nif (fname:startswith(group)) then\n\n-- is there a subgroup within this item?\nlocal _,split = fname:find(\"[^\\.]/\", grouplen + 1)\nif (split) then\nlocal subgroup = fname:sub(1, split)\nif (not finished[subgroup]) then\nfinished[subgroup] = true\nwalksources(prj, files, fn, subgroup, nestlevel + 1, finished)\nend\nend\n\nend\nend\n\n-- process all files that belong in this group\nfor _,fname in ipairs(files) do\nif (fname:startswith(group) and not fname:find(\"/\", grouplen + 1, true)) then\nfn(prj, fname, \"GroupItem\", nestlevel + 1)\nend\nend\n\n-- close the group\nif (nestlevel >= 0) then\nfn(prj, gname, \"GroupEnd\", nestlevel)\nend\nend\n\n\nfunction premake.walksources(prj, files, fn)\nwalksources(prj, files, fn, \"\", -1, {})\nend\n",
+ "--\n\n\n\n\nfunction premake.eachconfig(prj)\n-- I probably have the project root config, rather than the actual project\nif prj.project then prj = prj.project end\nlocal i = 0\nlocal t = prj.solution.configurations\nreturn function ()\ni = i + 1\nif (i <= #t) then\nreturn prj.__configs[t[i]]\nend\nend\nend\n\n\n\n\nfunction premake.eachfile(prj)\n-- project root config contains the file config list\nif not prj.project then prj = premake.getconfig(prj) end\nlocal i = 0\nlocal t = prj.files\nreturn function ()\ni = i + 1\nif (i <= #t) then\nreturn prj.__fileconfigs[t[i]]\nend\nend\nend\n\n\n\n\nfunction premake.eachproject(sln)\nlocal i = 0\nreturn function ()\ni = i + 1\nif (i <= #sln.projects) then\nlocal prj = sln.projects[i]\nlocal cfg = premake.getconfig(prj)\ncfg.name = prj.name\ncfg.blocks = prj.blocks\nreturn cfg\nend\nend\nend\n\n\n\n\nfunction premake.esc(value)\nif (type(value) == \"table\") then\nlocal result = { }\nfor _,v in ipairs(value) do\ntable.insert(result, premake.esc(v))\nend\nreturn result\nelse\nvalue = value:gsub('&', \"&amp;\")\nvalue = value:gsub('\"', \"&quot;\")\nvalue = value:gsub(\"'\", \"&apos;\")\nvalue = value:gsub('<', \"&lt;\")\nvalue = value:gsub('>', \"&gt;\")\nvalue = value:gsub('\\r', \"&#x0D;\")\nvalue = value:gsub('\\n', \"&#x0A;\")\nreturn value\nend\nend\n\n\n\n\nfunction premake.findproject(name)\nname = name:lower()\nfor _, sln in ipairs(_SOLUTIONS) do\nfor _, prj in ipairs(sln.projects) do\nif (prj.name:lower() == name) then\nreturn prj\nend\nend\nend\nend\n\n\n\n\nfunction premake.findfile(prj, extension)\nfor _, fname in ipairs(prj.files) do\nif fname:endswith(extension) then return fname end\nend\nend\n\n\n\n\nfunction premake.getconfig(prj, cfgname)\n-- might have the root configuration, rather than the actual project\nif prj.project then prj = prj.project end\nreturn prj.__configs[cfgname or \"\"]\nend\n\n\n\n\nfunction premake.getdependencies(cfg)\nlocal results = { }\nfor _, link in ipairs(cfg.links) do\nlocal prj = premake.findproject(link)\nif (prj) then\ntable.insert(results, prj)\nend\nend\nreturn results\nend\n\n\n\n\nfunction premake.getlinks(cfg, kind, part)\n-- if I'm building a list of link directories, include libdirs\nlocal result = iif (part == \"directory\" and kind == \"all\", cfg.libdirs, {})\n\n-- am I getting links for a configuration or a project?\nlocal cfgname = iif(cfg.name == cfg.project.name, \"\", cfg.name)\n\nlocal function canlink(source, target)\nif (target.kind ~= \"SharedLib\" and target.kind ~= \"StaticLib\") then return false end\nif (source.language == \"C\" or source.language == \"C++\") then\nif (target.language ~= \"C\" and target.language ~= \"C++\") then return false end\nreturn true\nelseif (source.language == \"C#\") then\nif (target.language ~= \"C#\") then return false end\nreturn true\nend\nend\n\nfor _, link in ipairs(cfg.links) do\nlocal item\n\n-- is this a sibling project?\nlocal prj = premake.findproject(link)\nif prj and kind ~= \"system\" then\n\nlocal prjcfg = premake.getconfig(prj, cfgname)\nif kind == \"dependencies\" or canlink(cfg, prjcfg) then\nif (part == \"directory\") then\nitem = path.rebase(prjcfg.linktarget.directory, prjcfg.location, cfg.location)\nelseif (part == \"basename\") then\nitem = prjcfg.linktarget.basename\nelseif (part == \"fullpath\") then\nitem = path.rebase(prjcfg.linktarget.fullpath, prjcfg.location, cfg.location)\nelseif (part == \"object\") then\nitem = prjcfg\nend\nend\n\nelseif not prj and (kind == \"system\" or kind == \"all\") then\n\nif (part == \"directory\") then\nlocal dir = path.getdirectory(link)\nif (dir ~= \".\") then\nitem = dir\nend\nelseif (part == \"fullpath\") then\nitem = link\nif premake.actions[_ACTION].targetstyle == \"windows\" then\nitem = item .. iif(cfg.language == \"C\" or cfg.language == \"C++\", \".lib\", \".dll\")\nend\nif item:find(\"/\", nil, true) then\nitem = path.getrelative(cfg.basedir, item)\nend\nelse\nitem = link\nend\n\nend\n\nif item then\nif premake.actions[_ACTION].targetstyle == \"windows\" and part ~= \"object\" then\nitem = path.translate(item, \"\\\\\")\nend\nif not table.contains(result, item) then\ntable.insert(result, item)\nend\nend\nend\n\nreturn result\nend\n\n\n\n\nfunction premake.gettarget(cfg, direction, style, os)\n-- normalize the arguments\nif not os then os = _G[\"os\"].get() end\nif (os == \"bsd\") then os = \"linux\" end\n\nlocal kind = cfg.kind\nif (cfg.language == \"C\" or cfg.language == \"C++\") then\n-- On Windows, shared libraries link against a static import library\nif (style == \"windows\" or os == \"windows\") and kind == \"SharedLib\" and direction == \"link\" then\nkind = \"StaticLib\"\nend\n\n-- Linux name conventions only apply to static libs on windows (by user request)\nif (style == \"linux\" and os == \"windows\" and kind ~= \"StaticLib\") then\nstyle = \"windows\"\nend\nelseif (cfg.language == \"C#\") then\n-- .NET always uses Windows naming conventions\nstyle = \"windows\"\nend\n\n-- Initialize the target components\nlocal field = iif(direction == \"build\", \"target\", \"implib\")\nlocal name = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal prefix = \"\"\nlocal suffix = \"\"\n\n-- If using an import library and \"NoImportLib\" flag is set, library will be in objdir\nif cfg.kind == \"SharedLib\" and kind == \"StaticLib\" and cfg.flags.NoImportLib then\ndir = cfg.objectsdir\nend\n\nif style == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\nsuffix = \".exe\"\nelseif kind == \"SharedLib\" then\nsuffix = \".dll\"\nelseif kind == \"StaticLib\" then\nsuffix = \".lib\"\nend\nelseif style == \"linux\" then\nif (kind == \"WindowedApp\" and os == \"macosx\") then\ndir = path.join(dir, name .. \".app/Contents/MacOS\")\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\nsuffix = \".so\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\nsuffix = \".a\"\nend\nend\n\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"extension\"] or cfg.targetextension or suffix\n\nlocal result = { }\nresult.basename = name\nresult.name = prefix .. name .. suffix\nresult.directory = dir\nresult.fullpath = path.join(result.directory, result.name)\nreturn result\nend\n\n\n\n\nlocal function walksources(prj, files, fn, group, nestlevel, finished)\nlocal grouplen = group:len()\nlocal gname = iif(group:endswith(\"/\"), group:sub(1, -2), group)\n\n-- open this new group\nif (nestlevel >= 0) then\nfn(prj, gname, \"GroupStart\", nestlevel)\nend\n\n-- scan the list of files for items which belong in this group\nfor _,fname in ipairs(files) do\nif (fname:startswith(group)) then\n\n-- is there a subgroup within this item?\nlocal _,split = fname:find(\"[^\\.]/\", grouplen + 1)\nif (split) then\nlocal subgroup = fname:sub(1, split)\nif (not finished[subgroup]) then\nfinished[subgroup] = true\nwalksources(prj, files, fn, subgroup, nestlevel + 1, finished)\nend\nend\n\nend\nend\n\n-- process all files that belong in this group\nfor _,fname in ipairs(files) do\nif (fname:startswith(group) and not fname:find(\"[^\\.]/\", grouplen + 1)) then\nfn(prj, fname, \"GroupItem\", nestlevel + 1)\nend\nend\n\n-- close the group\nif (nestlevel >= 0) then\nfn(prj, gname, \"GroupEnd\", nestlevel)\nend\nend\n\n\nfunction premake.walksources(prj, files, fn)\nwalksources(prj, files, fn, \"\", -1, {})\nend\n",
"--\n\n\n-- do not copy these fields into the configurations\nlocal nocopy = \n{\nblocks = true,\nkeywords = true,\nprojects = true,\n}\n\n-- leave these paths as absolute, rather than converting to project relative\nlocal nofixup =\n{\nbasedir = true,\nlocation = true,\n}\n\n\n\n\nfunction premake.getactiveterms()\nlocal terms = { _ACTION:lower(), os.get() }\n\n-- add option keys or values\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\n\nreturn terms\nend\n\n\n\n\nfunction premake.escapekeyword(keyword)\nkeyword = keyword:gsub(\"([%.%-%^%$%(%)%%])\", \"%%%1\")\nif keyword:find(\"**\", nil, true) then\nkeyword = keyword:gsub(\"%*%*\", \".*\")\nelse\nkeyword = keyword:gsub(\"%*\", \"[^/]*\")\nend\nreturn keyword:lower()\nend\n\n\n\n\nfunction premake.iskeywordmatch(keyword, terms)\n-- is it negated?\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\n\nfor _, word in ipairs(keyword:explode(\" or \")) do\nlocal pattern = \"^\" .. word .. \"$\"\nfor termkey, term in pairs(terms) do\nif term:match(pattern) then\nreturn termkey\nend\nend\nend\nend\n\n\n\n\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched then\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\n\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\n\n\n\n\nlocal function copyfields(cfg, this)\nfor field,value in pairs(this) do\nif (not nocopy[field]) then\nif (type(value) == \"table\") then\nif (not cfg[field]) then cfg[field] = { } end\ncfg[field] = table.join(cfg[field], value) \nelse\ncfg[field] = value\nend\nend\nend\nend\n\n\n\n\nlocal function buildconfig(prj, terms)\n-- fields are copied first from the solution, then the solution's configs,\n-- then from the project, then the project's configs. Each can overwrite\n-- or add to the values set previously. The objdir field gets special\n-- treatment, in order to provide a project-level default and still enable\n-- solution-level overrides\n\nlocal cfg = { }\n\ncopyfields(cfg, prj.solution)\nfor _,blk in ipairs(prj.solution.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms)) then\ncopyfields(cfg, blk)\nend\nend\n\ncopyfields(cfg, prj)\nfor _,blk in ipairs(prj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms)) then\ncopyfields(cfg, blk)\nend\nend\n\nreturn cfg\nend\n\n\n\n\nlocal function buildprojectconfig(prj, cfgname)\n-- create the base configuration, flattening the list of objects and\n-- filtering out settings which do not match the current environment\nlocal terms = premake.getactiveterms()\nterms.config = (cfgname or \"\"):lower()\n\nlocal cfg = buildconfig(prj, terms)\ncfg.name = cfgname\ncfg.project = prj\n\n-- set the project location, if not already set\ncfg.location = cfg.location or cfg.basedir\n\n-- remove excluded files from the file list\nlocal files = { }\nfor _, fname in ipairs(cfg.files) do\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (fname == exclude)\nif (excluded) then break end\nend\n\nif (not excluded) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\n\n-- fixup the data\nfor name, field in pairs(premake.fields) do\n-- convert absolute paths to project relative\nif (field.kind == \"path\" or field.kind == \"dirlist\" or field.kind == \"filelist\") and (not nofixup[name]) then\nif type(cfg[name]) == \"table\" then\nfor i,p in ipairs(cfg[name]) do cfg[name][i] = path.getrelative(prj.location, p) end\nelse\nif cfg[name] then cfg[name] = path.getrelative(prj.location, cfg[name]) end\nend\nend\n\n-- re-key flag fields for faster lookups\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\n\n-- build configuration objects for all files\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\nterms.required = fname:lower()\nlocal fcfg = buildconfig(prj, terms)\nfcfg.name = fname\n-- add indexed by name and integer\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\n\nreturn cfg\nend\n\n\n\n\nlocal function buildtargets(cfg)\n\n-- deduce and store the applicable tool for this configuration\nif cfg.language == \"C\" or cfg.language == \"C++\" then\nif _OPTIONS.cc then cfg.tool = premake[_OPTIONS.cc] end\nelseif cfg.language == \"C#\" then\nif _OPTIONS.dotnet then cfg.tool = premake[_OPTIONS.dotnet] end\nend\n\n-- deduce the target and path style from the current action/tool pairing\nlocal action = premake.actions[_ACTION]\nlocal targetstyle = action.targetstyle or \"linux\"\nif (cfg.tool) then\ntargetstyle = cfg.tool.targetstyle or targetstyle\nend\n\n-- build a unique objects directory\nlocal function getbasedir(cfg)\nreturn path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\")\nend\n\nlocal function getuniquedir(cfg)\nlocal thisbase = getbasedir(cfg)\nlocal thislocal = path.join(thisbase, cfg.name)\nlocal isbasematched = false\nfor _, sln in ipairs(_SOLUTIONS) do\nfor _, prj in ipairs(sln.projects) do\nfor _, thatcfg in pairs(prj.__configs) do\nif thatcfg ~= cfg then\nlocal thatbase = getbasedir(thatcfg)\nif thisbase == thatbase then\nisbasematched = true\nif thislocal == path.join(thatbase, thatcfg.name) then\nreturn path.join(thislocal, cfg.project.name)\nend\nend\nend\nend\nend\nend\n\nreturn iif(isbasematched, thislocal, thisbase)\nend\n\ncfg.objectsdir = path.getrelative(cfg.location, getuniquedir(cfg))\n\n-- precompute the target names and paths\ncfg.buildtarget = premake.gettarget(cfg, \"build\", targetstyle)\ncfg.linktarget = premake.gettarget(cfg, \"link\", targetstyle)\n\n-- translate the paths as appropriate\nlocal pathstyle = action.pathstyle or targetstyle\nif (pathstyle == \"windows\") then\ncfg.buildtarget.directory = path.translate(cfg.buildtarget.directory, \"\\\\\")\ncfg.buildtarget.fullpath = path.translate(cfg.buildtarget.fullpath, \"\\\\\")\ncfg.linktarget.directory = path.translate(cfg.linktarget.directory, \"\\\\\")\ncfg.linktarget.fullpath = path.translate(cfg.linktarget.fullpath, \"\\\\\")\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\n\n\n\n\nfunction premake.buildconfigs()\n-- walk the object tree once and flatten the configurations\nfor _, sln in ipairs(_SOLUTIONS) do\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = { }\nprj.__configs[\"\"] = buildprojectconfig(prj)\nfor _, name in ipairs(sln.configurations) do\nprj.__configs[name] = buildprojectconfig(prj, name)\nend\nend\nend\n\n-- walk it again and build the targets and unique directories\nfor _, sln in ipairs(_SOLUTIONS) do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nbuildtargets(cfg)\nend\nend\nend\nend\n",
"--\n\n\n\npremake.fields = \n{\nbasedir =\n{\nkind = \"path\",\nscope = \"container\",\n},\n\nbuildaction =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\n\nbuildoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\n\nconfigurations = \n{\nkind = \"list\",\nscope = \"solution\",\n},\n\ndefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\n\nexcludes =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\n\nfiles =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\n\nflags =\n{\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nallowed = {\n\"ExtraWarnings\",\n\"FatalWarnings\",\n\"Managed\",\n\"NativeWChar\",\n\"No64BitChecks\",\n\"NoEditAndContinue\",\n\"NoExceptions\",\n\"NoFramePointer\",\n\"NoImportLib\",\n\"NoManifest\",\n\"NoNativeWChar\",\n\"NoPCH\",\n\"NoRTTI\",\n\"Optimize\",\n\"OptimizeSize\",\n\"OptimizeSpeed\",\n\"SEH\",\n\"StaticRuntime\",\n\"Symbols\",\n\"Unicode\",\n\"Unsafe\",\n\"WinMain\"\n}\n},\n\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\n\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\n\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\n\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\n\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\n\nkind =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\"\n}\n},\n\nlanguage =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\n\nlibdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\n\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\n\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\n-- if library name contains a '/' then treat it as a path to a local file\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend\n\n},\n\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\n\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\n\npchheader =\n{\nkind = \"path\",\nscope = \"config\",\n},\n\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\n\npostbuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\n\nprebuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\n\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\n\nresdefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\n\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\n\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\n\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\n\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\n\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\n\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\n\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\n}\n\n\n\n\n\n\nlocal function checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\n\n\n\n\nfunction premake.getobject(t)\nlocal container\n\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\n\nif t == \"solution\" then\nif type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\n\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\n\nreturn container, msg\nend\n\n\n\n\nfunction premake.setarray(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\n\nif (not container[fieldname]) then\ncontainer[fieldname] = { }\nend\n\nlocal function doinsert(value, depth)\nif (type(value) == \"table\") then\nfor _,v in ipairs(value) do\ndoinsert(v, depth + 1)\nend\nelse\nvalue, err = checkvalue(value, allowed)\nif (not value) then\nerror(err, depth)\nend\ntable.insert(container[fieldname], value)\nend\nend\n\nif (value) then\ndoinsert(value, 5)\nend\n\nreturn container[fieldname]\nend\n\n\n\n\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\n\nfunction makeabsolute(value)\nif (type(value) == \"table\") then\nfor _,item in ipairs(value) do\nmakeabsolute(item)\nend\nelse\nif value:find(\"*\") then\nmakeabsolute(matchfunc(value))\nelse\ntable.insert(result, path.getabsolute(value))\nend\nend\nend\n\nmakeabsolute(value)\nreturn premake.setarray(ctype, fieldname, result)\nend\n\nfunction premake.setdirarray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\n\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\n\n\n\n\nfunction premake.setstring(ctype, fieldname, value, allowed)\n-- find the container for this value\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\n\n-- if a value was provided, set it\nif (value) then\nvalue, err = checkvalue(value, allowed)\nif (not value) then \nerror(err, 4)\nend\n\ncontainer[fieldname] = value\nend\n\nreturn container[fieldname]\nend\n\n\n\n\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\n\nif (kind == \"string\") then\nreturn premake.setstring(scope, name, value, allowed)\nelseif (kind == \"path\") then\nif value then value = path.getabsolute(value) end\nreturn premake.setstring(scope, name, value)\nelseif (kind == \"list\") then\nreturn premake.setarray(scope, name, value, allowed)\nelseif (kind == \"dirlist\") then\nreturn premake.setdirarray(scope, name, value)\nelseif (kind == \"filelist\") then\nreturn premake.setfilearray(scope, name, value)\nend\nend\n\n\n\n\nfor name,_ in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nend\n\n\n\n\nfunction configuration(keywords)\nif not keywords then\nreturn premake.CurrentConfiguration\nend\n\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\n\nlocal cfg = { }\ntable.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\n\n-- create a keyword list using just the indexed keyword items\ncfg.keywords = { }\nfor _, word in ipairs(table.join({}, keywords)) do\ntable.insert(cfg.keywords, premake.escapekeyword(word))\nend\n\n-- if file patterns are specified, convert them to Lua patterns and add them too\nif keywords.files then\nfor _, pattern in ipairs(table.join({}, keywords.files)) do\npattern = pattern:gsub(\"%.\", \"%%.\")\nif pattern:find(\"**\", nil, true) then\npattern = pattern:gsub(\"%*%*\", \".*\")\nelse\npattern = pattern:gsub(\"%*\", \"[^/]*\")\nend\ntable.insert(cfg.keywords, \"^\" .. pattern .. \"$\")\nend\nend\n\n-- initialize list-type fields to empty tables\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\n\nreturn cfg\nend\n\n\nfunction project(name)\nif not name then\nreturn iif(type(premake.CurrentContainer) == \"project\", premake.CurrentContainer, nil)\nend\n\n-- identify the parent solution\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\n\n-- if this is a new project, create it\npremake.CurrentContainer = sln.projects[name]\nif (not premake.CurrentContainer) then\nlocal prj = { }\npremake.CurrentContainer = prj\n\n-- add to master list keyed by both name and index\ntable.insert(sln.projects, prj)\nsln.projects[name] = prj\n\n-- attach a type\nsetmetatable(prj, {\n__type = \"project\",\n})\n\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.location = prj.basedir\nprj.uuid = os.uuid()\nprj.blocks = { }\nend\n\n-- add an empty, global configuration to the project\nconfiguration { }\n\nreturn premake.CurrentContainer\nend\n\n\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\n\npremake.CurrentContainer = _SOLUTIONS[name]\nif (not premake.CurrentContainer) then\nlocal sln = { }\npremake.CurrentContainer = sln\n\n-- add to master list keyed by both name and index\ntable.insert(_SOLUTIONS, sln)\n_SOLUTIONS[name] = sln\n\n-- attach a type\nsetmetatable(sln, { \n__type=\"solution\"\n})\n\nsln.name = name\nsln.location = os.getcwd()\nsln.projects = { }\nsln.blocks = { }\nsln.configurations = { }\nend\n\n-- add an empty, global configuration\nconfiguration { }\n\nreturn premake.CurrentContainer\nend\n\n\n",
"--\n\n\nlocal requiredactionfields =\n{\n\"description\",\n\"trigger\",\n}\n\nlocal requiredoptionfields = \n{\n\"description\",\n\"trigger\"\n}\n\n\n\nfunction newaction(a)\n-- some sanity checking\nlocal missing\nfor _, field in ipairs(requiredactionfields) do\nif (not a[field]) then\nmissing = field\nend\nend\n\nif (missing) then\nerror(\"action needs a \" .. missing, 2)\nend\n\n-- add it to the master list\npremake.actions[a.trigger] = a\nend\n\n\n\n\nfunction newoption(opt)\n-- some sanity checking\nlocal missing\nfor _, field in ipairs(requiredoptionfields) do\nif (not opt[field]) then\nmissing = field\nend\nend\n\nif (missing) then\nerror(\"action needs a \" .. missing, 2)\nend\n\n-- add it to the master list\npremake.options[opt.trigger] = opt\nend\n\n\n\n\nnewoption \n{\ntrigger = \"cc\",\nvalue = \"compiler\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC compiler (gcc/g++)\" },\n{ \"ow\", \"OpenWatcom compiler\" },\n}\n}\n\nnewoption\n{\ntrigger = \"dotnet\",\nvalue = \"value\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"ms\", \"Microsoft .NET (csc)\" },\n{ \"mono\", \"Novell Mono (mcs)\" },\n{ \"pnet\", \"Portable.NET (cscc)\" },\n}\n}\n\nnewoption\n{\ntrigger = \"file\",\nvalue = \"filename\",\ndescription = \"Process the specified Premake script file\"\n}\n\nnewoption\n{\ntrigger = \"help\",\ndescription = \"Display this information\"\n}\n\nnewoption\n{\ntrigger = \"os\",\nvalue = \"value\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\", \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\", \"Linux\" },\n{ \"macosx\", \"Apple Mac OS X\" },\n{ \"windows\", \"Microsoft Windows\" },\n}\n}\n\nnewoption\n{\ntrigger = \"scripts\",\nvalue = \"path\",\ndescription = \"Search for additional scripts on the given path\"\n}\n\nnewoption\n{\ntrigger = \"version\",\ndescription = \"Display version information\"\n}\n",