From 1a5ac25f6108ffb46058c68fda9f53ce97610d9a Mon Sep 17 00:00:00 2001 From: Julian Sikorski Date: Wed, 5 Feb 2020 23:21:10 +0100 Subject: Sync with GENie upstream revision ce9f3c5 (#6262) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Change makerules to take variable $(PROJECT_TYPE) instead of hardcoded 'gmake' This allows to run `make projgen PROJECT_TYPE=ninja` to generate ninja build files instead. and to build GENie using ninja by running `make release PROJECT_TYPE=ninja`. Using ninja improves build times, e.g. for macOS: 12.47s with gmake goes down to 2.05s with ninja. Signed-off-by: Julian Sikorski * Set prefer project set as solution.startproject as default target Signed-off-by: Julian Sikorski * Adding `GenerateMapFiles` flag. Causes Visual Studio's linker to generate .map files for that configuration. Signed-off-by: Julian Sikorski * Add ninja support for 'wholearchive' libraries Signed-off-by: Julian Sikorski * Fixup ninja.esc to gracefully ignore nil passed as value Signed-off-by: Julian Sikorski * Use -Wl,-force_load for wholearchive libs when building for macosx Signed-off-by: Julian Sikorski * Updated README. Signed-off-by: Julian Sikorski * Add space after filename in 'Generating' message This makes the filename 'clickable' to open in iTerm and VSCode Signed-off-by: Julian Sikorski * Print generated filenames as quoted string Signed-off-by: Julian Sikorski * Remove '...' after filename Signed-off-by: Julian Sikorski * Pop cwd after pushing to run file Signed-off-by: Julian Sikorski * Make paths in embed.lua rely on script dir Signed-off-by: Julian Sikorski * Updated README. Signed-off-by: Julian Sikorski * Fix issues caused by make-4.3 no longer adding spaces to variables in some cases The fix was found by @asavah. Signed-off-by: Julian Sikorski * Fixed release script. Signed-off-by: Julian Sikorski * Updated README. Signed-off-by: Julian Sikorski * Update scripts.c Co-authored-by: Christian Helmich Co-authored-by: Johan Sköld Co-authored-by: Бранимир Караџић --- 3rdparty/genie/README.md | 2 +- 3rdparty/genie/docs/scripting-reference.md | 11 +- 3rdparty/genie/makefile | 23 +-- 3rdparty/genie/scripts/embed.lua | 8 +- 3rdparty/genie/scripts/release.lua | 2 +- 3rdparty/genie/src/_premake_main.lua | 2 + 3rdparty/genie/src/actions/make/make_cpp.lua | 4 +- 3rdparty/genie/src/actions/ninja/ninja_base.lua | 10 +- 3rdparty/genie/src/actions/ninja/ninja_cpp.lua | 31 +++- .../genie/src/actions/ninja/ninja_solution.lua | 6 +- .../genie/src/actions/vstudio/vstudio_vcxproj.lua | 4 + 3rdparty/genie/src/base/api.lua | 1 + 3rdparty/genie/src/base/premake.lua | 4 +- 3rdparty/genie/src/host/scripts.c | 203 +++++++++++---------- 3rdparty/genie/src/tools/gcc.lua | 2 + 15 files changed, 177 insertions(+), 136 deletions(-) diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md index 224ed480dc6..526705e68d3 100644 --- a/3rdparty/genie/README.md +++ b/3rdparty/genie/README.md @@ -21,7 +21,7 @@ Download (stable) [![Build Status](https://travis-ci.org/bkaradzic/GENie.svg?branch=master)](https://travis-ci.org/bkaradzic/GENie) - version 1095 (commit f0b68ba0490458bbf0a556bb64575a22a27b7f11) + version 1115 (commit cd9b1a624810b166d11788d01c2aa4daf2ea42e6) Linux: https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie diff --git a/3rdparty/genie/docs/scripting-reference.md b/3rdparty/genie/docs/scripting-reference.md index bc4d1d3351e..35b1217e879 100644 --- a/3rdparty/genie/docs/scripting-reference.md +++ b/3rdparty/genie/docs/scripting-reference.md @@ -631,30 +631,31 @@ Specifies build flags to modify the compiling or linking process. Multiple calls _flags_ - List of flag names from list below. Names are case-insensitive and ignored if not supported on a platform. * _C7DebugInfo_ - Enables C7 compatible debug info for MSVC builds. +* _EnableMinimalRebuild_ - Enable Visual Studio's minimal rebuild feature. * _EnableSSE, EnableSSE2, EnableAVX, EnableAVX2_ - Enable SSE/AVX instruction sets * _ExtraWarnings_ - Sets compiler's max 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. * _FullSymbols_ - Use together with _Symbols_ to generate full debug symbols with Visual Studio. +* _GenerateMapFiles_ - Enable .map file outputs from the Visual Studio linker. * _LinkSupportCircularDependencies_ - Enables the linker to iterate over provided libs in order to resolve circular dependencies (make and ninja only). * _Managed_ - Enable Managed C++ (.NET). -* _MinimumWarnings_ - - Sets compiler's minimum warning level (Visual Studio only). * _MFC_ - Enable support for Microsoft Foundation Classes. +* _MinimumWarnings_ - - Sets compiler's minimum warning level (Visual Studio only). * _NativeWChar, NoNativeWChar_ - Toggle support for the wchar data type. * _No64BitChecks_ - Disable 64-bit portability warnings. * _NoBufferSecurityCheck_ - Turns off Visual Studio 'Security Check' option. Can give up to 10% performance improvement. * _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. +* _NoIncrementalLink_ - Disable support for Visual Studio's incremental linking feature. * _NoManifest_ - Prevent the generation of a manifest for Windows executables and shared libraries. * _NoMultiProcessorCompilation_ - Disables Visual Studio's and FastBuild's multiprocessor compilation. -* _NoRuntimeChecks_ - Disable Visual Studio's Basic Runtime Checks in Debug builds. -* _EnableMinimalRebuild_ - Enable Visual Studio's minimal rebuild feature. * _NoPCH_ - Disable precompiled headers. * _NoRTTI_ - Disable C++ runtime type information. +* _NoRuntimeChecks_ - Disable Visual Studio's Basic Runtime Checks in Debug builds. * _NoWinMD_ - Disables Generation of Windows Metadata. * _NoWinRT_ - Disables Windows RunTime Extension for project. * _ObjcARC_ - Enable automatic reference counting for Object-C and Objective-C++. @@ -668,10 +669,10 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign * _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. +* _UnsignedChar_ - Force `char`s to be `unsigned` by default. * _UseFullPaths_ - Enable absolute paths for `__FILE__`. * _UseLDResponseFile_ - Enable use of response file (aka @file) for linking lib dependencies (make only). * _UseObjectResponseFile_ - Enable use of response file (aka @file) for linking objects (make only). -* _UnsignedChar_ - Force `char`s to be `unsigned` by default. * _WinMain_ - Use WinMain() as the entry point for Windows applications, rather than main(). **Note:** When not set, options will default to the tool default. diff --git a/3rdparty/genie/makefile b/3rdparty/genie/makefile index 7064ec9cbc9..48f6fb84122 100644 --- a/3rdparty/genie/makefile +++ b/3rdparty/genie/makefile @@ -25,37 +25,38 @@ endif .PHONY: release GENIE=bin/$(OS)/genie +PROJECT_TYPE?=gmake SILENT?=@ $(GENIE): - $(SILENT) $(MAKE) -C build/gmake.$(OS) + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) all: $(SILENT) $(GENIE) clean: - $(SILENT) $(MAKE) -C build/gmake.$(OS) clean + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean $(SILENT) -rm -rf bin projgen: - $(SILENT) $(GENIE) --to=../build/gmake.windows --os=windows gmake - $(SILENT) $(GENIE) --to=../build/gmake.linux --os=linux gmake - $(SILENT) $(GENIE) --to=../build/gmake.darwin --os=macosx --platform=universal32 gmake - $(SILENT) $(GENIE) --to=../build/gmake.freebsd --os=bsd gmake + $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).windows --os=windows $(PROJECT_TYPE) + $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).linux --os=linux $(PROJECT_TYPE) + $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).darwin --os=macosx --platform=universal32 $(PROJECT_TYPE) + $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).freebsd --os=bsd $(PROJECT_TYPE) rebuild: - $(SILENT) $(MAKE) -C build/gmake.$(OS) clean all + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean all release-windows release-darwin: $(GENIE) $(GENIE) release - $(SILENT) $(MAKE) -C build/gmake.$(OS) clean all + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean all $(SILENT) git checkout src/host/version.h release-linux: $(GENIE) $(SILENT) $(GENIE) release - $(SILENT) $(MAKE) -C build/gmake.darwin clean all CC=x86_64-apple-darwin15-clang - $(SILENT) $(MAKE) -C build/gmake.linux clean all - $(SILENT) $(MAKE) -C build/gmake.windows clean all CC=x86_64-w64-mingw32-gcc + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).darwin clean all CC=x86_64-apple-darwin15-clang + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).linux clean all + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).windows clean all CC=x86_64-w64-mingw32-gcc $(SILENT) git checkout src/host/version.h release: release-$(OS) diff --git a/3rdparty/genie/scripts/embed.lua b/3rdparty/genie/scripts/embed.lua index 05165923c16..39703b1dd4a 100644 --- a/3rdparty/genie/scripts/embed.lua +++ b/3rdparty/genie/scripts/embed.lua @@ -5,6 +5,8 @@ -- issues in Mac OS X Universal builds. -- + local scriptdir = path.getdirectory(_SCRIPT) + local function stripfile(fname) local f = io.open(fname) local s = assert(f:read("*a")) @@ -73,13 +75,13 @@ function doembed() -- load the manifest of script files - scripts = dofile("../src/_manifest.lua") + scripts = dofile(path.join(scriptdir, "../src/_manifest.lua")) -- main script always goes at the end table.insert(scripts, "_premake_main.lua") -- open scripts.c and write the file header - local out = io.open("../src/host/scripts.c", "w+b") + local out = io.open(path.join(scriptdir, "../src/host/scripts.c"), "w+b") out:write("/* Premake's Lua scripts, as static data buffers for release mode builds */\n") out:write("/* DO NOT EDIT - this file is autogenerated - see BUILD.txt */\n") out:write("/* To regenerate this file, run: premake4 embed */ \n\n") @@ -87,7 +89,7 @@ for i,fn in ipairs(scripts) do print(fn) - local s = stripfile("../src/" .. fn) + local s = stripfile(path.join(scriptdir,"../src/" .. fn)) writefile(out, fn, s) end diff --git a/3rdparty/genie/scripts/release.lua b/3rdparty/genie/scripts/release.lua index f3200916b1e..d1173d5f9e8 100644 --- a/3rdparty/genie/scripts/release.lua +++ b/3rdparty/genie/scripts/release.lua @@ -21,7 +21,7 @@ function dorelease() f = io.popen("git log --format=format:%H -1") local sha1 = f:read("*a") f:close() - io.output("../src/host/version.h") + io.output("src/host/version.h") io.write("#define VERSION " ..rev .. "\n") io.write("#define VERSION_STR \"version " ..rev .. " (commit " .. sha1 .. ")\"\n") io.close() diff --git a/3rdparty/genie/src/_premake_main.lua b/3rdparty/genie/src/_premake_main.lua index b92e4fa6873..7872331bd55 100644 --- a/3rdparty/genie/src/_premake_main.lua +++ b/3rdparty/genie/src/_premake_main.lua @@ -84,8 +84,10 @@ else local dir, name = premake.findDefaultScript(path.getabsolute("./")) if dir ~= nil then + local cwd = os.getcwd() os.chdir(dir) dofile(name) + os.chdir(cwd) end end diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua index a4e92521bdc..880d9d35bf2 100644 --- a/3rdparty/genie/src/actions/make/make_cpp.lua +++ b/3rdparty/genie/src/actions/make/make_cpp.lua @@ -73,8 +73,8 @@ if (prj.kind == "StaticLib" and prj.options.ArchiveSplit) then _p('define max_args') _p('\t$(eval _args:=)') - _p('\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))') - _p('\t$(if $(_args),$1$(_args))') + _p('\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1 $(_args)$(EOL)$(eval _args:=)))') + _p('\t$(if $(_args),$1 $(_args))') _p('endef') _p('') _p('define EOL') diff --git a/3rdparty/genie/src/actions/ninja/ninja_base.lua b/3rdparty/genie/src/actions/ninja/ninja_base.lua index c4a174f306e..499089d6cc6 100644 --- a/3rdparty/genie/src/actions/ninja/ninja_base.lua +++ b/3rdparty/genie/src/actions/ninja/ninja_base.lua @@ -7,10 +7,12 @@ local ninja = premake.ninja function ninja.esc(value) - value = value:gsub("%$", "$$") -- TODO maybe there is better way - value = value:gsub(":", "$:") - value = value:gsub("\n", "$\n") - value = value:gsub(" ", "$ ") + if value then + value = string.gsub(value, "%$", "$$") -- TODO maybe there is better way + value = string.gsub(value, ":", "$:") + value = string.gsub(value, "\n", "$\n") + value = string.gsub(value, " ", "$ ") + end return value end diff --git a/3rdparty/genie/src/actions/ninja/ninja_cpp.lua b/3rdparty/genie/src/actions/ninja/ninja_cpp.lua index 14cbf5d0456..5db216fb453 100644 --- a/3rdparty/genie/src/actions/ninja/ninja_cpp.lua +++ b/3rdparty/genie/src/actions/ninja/ninja_cpp.lua @@ -85,7 +85,7 @@ end _p(" command = " .. wrap_ninja_cmd("$pre_link " .. link .. " -o $out @$out.rsp $all_ldflags $post_build")) _p(" description = link $out") _p(" rspfile = $out.rsp") - _p(" rspfile_content = $all_outputfiles " .. string.format("%s $libs %s", startgroup, endgroup)) + _p(" rspfile_content = $all_outputfiles $walibs" .. string.format("%s $libs %s", startgroup, endgroup)) _p("") _p("rule exec") @@ -330,15 +330,36 @@ end end function cpp.linker(prj, cfg, objfiles, tool) - local all_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions)) - local lddeps = ninja.list(premake.getlinks(cfg, "siblings", "fullpath")) - local libs = lddeps .. " " .. ninja.list(tool.getlinkflags(cfg)) - + local all_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions)) local prebuildsuffix = #cfg.prebuildcommands > 0 and "||__prebuildcommands" or "" + local libs = {} + local walibs = {} + local lddeps = {} + + if #cfg.wholearchive > 0 then + for _, linkcfg in ipairs(premake.getlinks(cfg, "siblings", "object")) do + local linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location) + table.insert(lddeps, linkpath) + + if table.icontains(cfg.wholearchive, linkcfg.project.name) then + table.insert(walibs, table.concat(tool.wholearchive(linkpath), ' ')) + else + table.insert(libs, linkpath) + end + end + else + lddeps = premake.getlinks(cfg, "siblings", "fullpath") + libs = lddeps + end + + lddeps = ninja.list(lddeps) + libs = ninja.list(libs) .. " " .. ninja.list(tool.getlinkflags(cfg)) + walibs = ninja.list(walibs) local function writevars() _p(1, "all_ldflags = " .. all_ldflags) _p(1, "libs = " .. libs) + _p(1, "walibs = " .. walibs) _p(1, "all_outputfiles = " .. table.concat(objfiles, " ")) if #cfg.prelinkcommands > 0 then _p(1, 'pre_link = echo Running pre-link commands && ' .. table.implode(cfg.prelinkcommands, "", "", " && ") .. " && ") diff --git a/3rdparty/genie/src/actions/ninja/ninja_solution.lua b/3rdparty/genie/src/actions/ninja/ninja_solution.lua index f4979c52826..3d1e400e553 100644 --- a/3rdparty/genie/src/actions/ninja/ninja_solution.lua +++ b/3rdparty/genie/src/actions/ninja/ninja_solution.lua @@ -123,6 +123,7 @@ end function generate(prjcfgs) local cfgs = {} + local cfg_start = nil local cfg_first = nil local cfg_first_lib = nil @@ -142,6 +143,9 @@ end cfgs["all"] = cfgs["all"] .. cfg:getoutputfilename() .. " " -- set first configuration name + if (cfg_start == nil) and (cfg.solution.startproject == key) then + cfg_start = key + end if (cfg_first == nil) and (cfg.kind == "ConsoleApp" or cfg.kind == "WindowedApp") then cfg_first = key end @@ -162,6 +166,6 @@ end _p("") _p("# default target") - _p("default " .. (cfg_first or cfg_first_lib)) + _p("default " .. (cfg_start or cfg_first or cfg_first_lib)) _p("") end diff --git a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua index 847a8cbb93d..678d54f364a 100644 --- a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua +++ b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua @@ -949,6 +949,10 @@ _p(3, 'Enabled') end + if cfg.flags.GenerateMapFiles then + _p(3, 'true') + end + _p(2,'') -- If any libraries are to be linked as whole archive, we need to diff --git a/3rdparty/genie/src/base/api.lua b/3rdparty/genie/src/base/api.lua index 54ca768298d..a5aa0472f7c 100644 --- a/3rdparty/genie/src/base/api.lua +++ b/3rdparty/genie/src/base/api.lua @@ -838,6 +838,7 @@ end FloatFast = 1, FloatStrict = 1, FullSymbols = 1, + GenerateMapFiles = 1, Hotpatchable = 1, LinkSupportCircularDependencies = 1, Managed = 1, diff --git a/3rdparty/genie/src/base/premake.lua b/3rdparty/genie/src/base/premake.lua index c96ef0f2a2a..a4051427935 100644 --- a/3rdparty/genie/src/base/premake.lua +++ b/3rdparty/genie/src/base/premake.lua @@ -52,7 +52,7 @@ end if delta then - printf("Generating %s...", filename) + printf("Generating %q", filename) local f, err = io.open(filename, "wb") if (not f) then error(err, 0) @@ -67,7 +67,7 @@ premake.stats.num_skipped = premake.stats.num_skipped + 1 end else - printf("Generating %s...", filename) + printf("Generating %q", filename) local f, err = io.open(filename, "wb") if (not f) then diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c index bbdebc0ef76..f93d3547332 100644 --- a/3rdparty/genie/src/host/scripts.c +++ b/3rdparty/genie/src/host/scripts.c @@ -101,18 +101,18 @@ const char* builtin_scripts[] = { "nd(_ACTION, \"vs\") ~= 1 then\nerror(\"Only available for visual studio actions\")\nend\nsln, err = premake.getobject(\"solution\")\nif not sln then\nerror(err)\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nlocal project = {}\nproject.location = location\nproject.group = group\nproject.flags = {}\ntable.insert(sln.importedprojects, project)\n end\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\nfunction enablefilelevelconfig()\npremake._filelevelconfig = true\nend\nfunction newapifield(field)\npremake.fields[field.name] = field\n_G[field.name] = function(value)\nreturn accessor(field.name, value)\nend\nif field.kind == \"list\"\nor field.kind == \"dirlist\"\nor field.kind == \"filelist\"\nor field.kind == \"absolutefilelist\"\nthen\nif field.name ~= \"removefiles\"\nand field.name ~= \"files\" then\n_G[\"remove\"..field.name] = function(value)\npremake.remove(field.name, value)\nend\nend\nend\nend\nnewapifield {\nname = \"arc" "hivesplit_size\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"basedir\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"buildaction\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n}\nnewapifield {\nname = \"buildoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_asm\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_c\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_cpp\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_objc\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_objcpp\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_vala\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"clrreferences\",\nkind = \"list\",\nscope = \"container\",\n}\nnewapifield {\nname" " = \"configurations\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"custombuildtask\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugcmd\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugargs\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugenvs\" ,\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"defines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"deploymentoptions\",\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"dependency\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"deploymode\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"excludes\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"forcenative\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield " - "{\nname = \"nopch\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"files\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"removefiles\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"flags\",\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nAntBuildDebuggable = 1,\nATL = 1,\nC7DebugInfo = 1,\nCpp11 = 1,\nCpp14 = 1,\nCpp17 = 1,\nCppLatest = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nDeploymentContent = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nEnableAVX = 1,\nEnableAVX2 = 1,\nPedanticWarnings = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nFullSymbols = 1,\nHotpatchable = 1,\nLinkSupportCircularDependencies = 1,\nManaged = 1,\nMinimumWarnings = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoBufferSecurityCheck = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoIm" - "portLib = 1,\nNoIncrementalLink = 1,\nNoJMC = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoOptimizeLink = 1,\nNoPCH = 1,\nNoRTTI = 1,\nNoRuntimeChecks = 1,\nNoWinMD = 1, -- explicitly disables Windows Metadata\nNoWinRT = 1, -- explicitly disables Windows Runtime Extension\nFastCall = 1,\nStdCall = 1,\nSingleOutputDir = 1,\nObjcARC = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nDebugRuntime = 1,\nReleaseRuntime = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnitySupport = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nUseFullPaths = 1,\nUseLDResponseFile = 1,\nUseObjectResponseFile = 1,\nWinMain = 1\n}\nlocal englishToAmericanSpelling =\n{\nnooptimiselink = 'nooptimizelink',\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nretur" - "n v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n}\nnewapifield {\nname = \"framework\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n\"4.5.1\",\n\"4.5.2\",\n\"4.6\",\n\"4.6.1\",\n\"4.6.2\",\n}\n}\nnewapifield {\nname = \"iostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"macostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"tvostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformminversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"forcedincludes\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imagepath\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imageoptions\",\nkind = \"list\"," - "\nscope = \"config\",\n}\nnewapifield {\nname = \"implibdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"includedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"systemincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"userincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"usingdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"kind\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib" - "\",\n\"SharedLib\",\n\"Bundle\",\n}\n}\nnewapifield {\nname = \"language\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\",\n\"Vala\",\n\"Swift\",\n}\n}\nnewapifield {\nname = \"libdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n}\nnewapifield {\nname = \"linkoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"links\",\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\nmergecopiestotail = true,\n}\nnewapifield {\nname = \"location\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"makesettings\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"messageskip\",\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkip" - "CleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n}\nnewapifield {\nname = \"msgarchiving\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgprecompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile_objc\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgresource\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msglinking\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"objdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"options\",\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1,\nSkipBundling = 1,\n" - "XcodeLibrarySchemes = 1,\nXcodeSchemeNoConfigs = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n}\nnewapifield {\nname = \"pchheader\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pchsource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"platforms\",\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n}\nnewapifield {\nname = \"postbuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prebuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postcompiletasks\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prelinkcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"propertysheets\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pullmappingfile\",\nkind = \"path\",\n" - "scope = \"config\",\n}\nnewapifield {\nname = \"applicationdatadir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"finalizemetasource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resdefines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"sdkreferences\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"startproject\",\nkind = \"string\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"targetdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsubdir\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetprefix\",\nki" - "nd = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"trimpaths\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"uuid\",\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}\nnewapifield {\nname = \"uses\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vapidirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vpaths\",\nkind = \"keypath\",\nscope = \"container\",\n" - "}\nnewapifield {\nname = \"vsimportreferences\",\nkind = \"filelist\",\nscope = \"container\",\n}\nnewapifield {\nname = \"dpiawareness\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"None\",\n\"High\",\n\"HighPerMonitor\",\n}\n}\nnewapifield {\nname = \"xcodeprojectopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodetargetopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodescriptphases\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodecopyresources\",\nkind = \"table\",\nscope = \"project\",\n}\nnewapifield {\nname = \"xcodecopyframeworks\",\nkind = \"filelist\",\nscope = \"project\",\n}\nnewapifield {\nname = \"wholearchive\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"swiftmodulemaps\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"linkoptions_swift\",\nkind =" - " \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidtargetapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidminapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidarch\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"armv7-a\",\n\"armv7-a-hard\",\n\"arm64-v8a\",\n\"x86\",\n\"x86_64\",\n}\n}\nnewapifield {\nname = \"androidndktoolchainversion\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidstltype\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidcppstandard\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"c++98\",\n\"c++11\",\n\"c++1y\",\n\"gnu++98\",\n\"gnu++11\",\n\"gnu++1y\",\n}\n}\nnewapifield {\nname = \"androidlinker\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"bfd\",\n\"gold\",\n}\n}\nnewapifield {\nname = \"androiddebugintentparams\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjavasourcedi" - "rs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildassetsdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postsolutioncallbacks\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"postprojectcallbacks\",\nkind = \"list\",\nscope = \"project\",\n}\n", + "{\nname = \"nopch\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"files\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"removefiles\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"flags\",\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nAntBuildDebuggable = 1,\nATL = 1,\nC7DebugInfo = 1,\nCpp11 = 1,\nCpp14 = 1,\nCpp17 = 1,\nCppLatest = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nDeploymentContent = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nEnableAVX = 1,\nEnableAVX2 = 1,\nPedanticWarnings = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nFullSymbols = 1,\nGenerateMapFiles = 1,\nHotpatchable = 1,\nLinkSupportCircularDependencies = 1,\nManaged = 1,\nMinimumWarnings = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoBufferSecurityCheck = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNo" + "FramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoJMC = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoOptimizeLink = 1,\nNoPCH = 1,\nNoRTTI = 1,\nNoRuntimeChecks = 1,\nNoWinMD = 1, -- explicitly disables Windows Metadata\nNoWinRT = 1, -- explicitly disables Windows Runtime Extension\nFastCall = 1,\nStdCall = 1,\nSingleOutputDir = 1,\nObjcARC = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nDebugRuntime = 1,\nReleaseRuntime = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnitySupport = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nUseFullPaths = 1,\nUseLDResponseFile = 1,\nUseObjectResponseFile = 1,\nWinMain = 1\n}\nlocal englishToAmericanSpelling =\n{\nnooptimiselink = 'nooptimizelink',\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() ==" + " lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n}\nnewapifield {\nname = \"framework\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n\"4.5.1\",\n\"4.5.2\",\n\"4.6\",\n\"4.6.1\",\n\"4.6.2\",\n}\n}\nnewapifield {\nname = \"iostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"macostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"tvostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformminversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"forcedincludes\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imagepath\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imageoptions" + "\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"includedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"systemincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"userincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"usingdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"kind\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"Window" + "edApp\",\n\"StaticLib\",\n\"SharedLib\",\n\"Bundle\",\n}\n}\nnewapifield {\nname = \"language\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\",\n\"Vala\",\n\"Swift\",\n}\n}\nnewapifield {\nname = \"libdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n}\nnewapifield {\nname = \"linkoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"links\",\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\nmergecopiestotail = true,\n}\nnewapifield {\nname = \"location\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"makesettings\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"messageskip\",\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuild" + "ingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n}\nnewapifield {\nname = \"msgarchiving\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgprecompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile_objc\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgresource\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msglinking\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"objdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"options\",\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1," + "\nSkipBundling = 1,\nXcodeLibrarySchemes = 1,\nXcodeSchemeNoConfigs = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n}\nnewapifield {\nname = \"pchheader\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pchsource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"platforms\",\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n}\nnewapifield {\nname = \"postbuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prebuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postcompiletasks\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prelinkcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"propertysheets\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pullmappingfile\"," + "\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"applicationdatadir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"finalizemetasource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resdefines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"sdkreferences\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"startproject\",\nkind = \"string\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"targetdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsubdir\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = " + "\"targetprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"trimpaths\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"uuid\",\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}\nnewapifield {\nname = \"uses\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vapidirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vpaths\",\nkind = \"keypath\",\nsco" + "pe = \"container\",\n}\nnewapifield {\nname = \"vsimportreferences\",\nkind = \"filelist\",\nscope = \"container\",\n}\nnewapifield {\nname = \"dpiawareness\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"None\",\n\"High\",\n\"HighPerMonitor\",\n}\n}\nnewapifield {\nname = \"xcodeprojectopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodetargetopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodescriptphases\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodecopyresources\",\nkind = \"table\",\nscope = \"project\",\n}\nnewapifield {\nname = \"xcodecopyframeworks\",\nkind = \"filelist\",\nscope = \"project\",\n}\nnewapifield {\nname = \"wholearchive\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"swiftmodulemaps\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"linkopti" + "ons_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidtargetapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidminapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidarch\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"armv7-a\",\n\"armv7-a-hard\",\n\"arm64-v8a\",\n\"x86\",\n\"x86_64\",\n}\n}\nnewapifield {\nname = \"androidndktoolchainversion\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidstltype\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidcppstandard\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"c++98\",\n\"c++11\",\n\"c++1y\",\n\"gnu++98\",\n\"gnu++11\",\n\"gnu++1y\",\n}\n}\nnewapifield {\nname = \"androidlinker\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"bfd\",\n\"gold\",\n}\n}\nnewapifield {\nname = \"androiddebugintentparams\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = " + "\"antbuildjavasourcedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildassetsdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postsolutioncallbacks\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"postprojectcallbacks\",\nkind = \"list\",\nscope = \"project\",\n}\n", /* base/cmdline.lua */ "newoption\n{\ntrigger = \"cc\",\nvalue = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\", \"OpenWatcom\" },\n{ \"ghs\", \"Green Hills Software\" },\n}\n}\nnewoption\n{\ntrigger = \"dotnet\",\nvalue = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\", \"Microsoft .NET (csc)\" },\n{ \"mono\", \"Novell Mono (mcs)\" },\n{ \"pnet\", \"Portable.NET (cscc)\" },\n}\n}\nnewoption\n{\ntrigger = \"file\",\nvalue = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger = \"help\",\ndescription = \"Display this information\"\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{ \"solaris\", \"Sola" @@ -150,9 +150,9 @@ const char* builtin_scripts[] = { "cppflags = \"-MMD -MP\",\n},\nx32 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m32\",\n},\nx64 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m64\",\n},\nUniversal = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch ppc\",\n},\nUniversal64 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD -MP\",\n},\nWiiDev = {\ncppflags = \"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",\nldflags= \"-L$(LIBOGC_LIB) $(MACHDEP)\",\ncfgsettings = [[\n ifeq ($(strip $(DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],\n},\nOrbis = {\ncc = \"orbis-clang\",\ncxx = \"orbis-clang++\",\nar = \"orbis-ar\",\ncppflag" "s = \"-MMD -MP\",\n},\nEmscripten = {\ncc = \"$(EMSCRIPTEN)/emcc\",\ncxx = \"$(EMSCRIPTEN)/em++\",\nar = \"$(EMSCRIPTEN)/emar\",\ncppflags = \"-MMD -MP\",\n}\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nif flags[1]:startswith(\"-MMD\") then\ntable.insert(flags, \"-MP\")\nend\nreturn flags\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\ntable.insert(result, \"-fPIC\")\nend\nreturn result\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getobjcflags(cfg)\nreturn table.translate(cfg.flags, objcflags)\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then" "\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"Bundle\" then\ntable.insert(result, \"-bundle\")\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-dynamiclib\")\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(result, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platform.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.insert(result, '-L\\\"' .. value .. '\\\"')\nend\nreturn result\nend\nfunction premake.gcc.islibfile(p)\nif path.getextension(p) == \".a\" then\nreturn true\nend\nreturn false\nend\nfunction premake.gcc.ge" - "tlibfiles(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\ntable.insert(result, _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\nvalue = path.rebase(value, cfg.project.location, cfg.location)\ntable.insert(result, _MAKE.esc(value))\nelseif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.insert(result, '-l' .. _MAKE.esc(path.getname(value)))\nend\nend\nreturn result\nend\nfunction premake.gcc.wholearchive(lib)\nif premake.gcc.llvm then\nreturn {\"-force_load\", lib}\nelse\nreturn {\"-Wl,--whole-archive\", lib, \"-Wl,--no-whole-archive\"}\nend\nend\nfunction premake.gcc.getarchiveflags(prj, cfg, ndx)\nlocal result = {}\nif cfg.platform:startswith(\"Universal\") then\n" - "if prj.options.ArchiveSplit then\nerror(\"gcc tool 'Universal*' platforms do not support split archives\")\nend\ntable.insert(result, '-o')\nelse\nif (not prj.options.ArchiveSplit) then\nif premake.gcc.llvm then\ntable.insert(result, 'rcs')\nelse\ntable.insert(result, '-rcs')\nend\nelse\nif premake.gcc.llvm then\nif (not ndx) then\ntable.insert(result, 'qc')\nelse\ntable.insert(result, 'cs')\nend\nelse\nif (not ndx) then\ntable.insert(result, '-qc')\nelse\ntable.insert(result, '-cs')\nend\nend\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, \"-D\" .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getquoteincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-iquote \\\"\" .. " - "dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getsystemincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-isystem \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n", + "tlibfiles(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\ntable.insert(result, _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\nvalue = path.rebase(value, cfg.project.location, cfg.location)\ntable.insert(result, _MAKE.esc(value))\nelseif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.insert(result, '-l' .. _MAKE.esc(path.getname(value)))\nend\nend\nreturn result\nend\nfunction premake.gcc.wholearchive(lib)\nif premake.gcc.llvm then\nreturn {\"-force_load\", lib}\nelseif os.get() == \"macosx\" then\nreturn {\"-Wl,-force_load\", lib}\nelse\nreturn {\"-Wl,--whole-archive\", lib, \"-Wl,--no-whole-archive\"}\nend\nend\nfunction premake.gcc.getarchiveflags(prj, cfg, nd" + "x)\nlocal result = {}\nif cfg.platform:startswith(\"Universal\") then\nif prj.options.ArchiveSplit then\nerror(\"gcc tool 'Universal*' platforms do not support split archives\")\nend\ntable.insert(result, '-o')\nelse\nif (not prj.options.ArchiveSplit) then\nif premake.gcc.llvm then\ntable.insert(result, 'rcs')\nelse\ntable.insert(result, '-rcs')\nend\nelse\nif premake.gcc.llvm then\nif (not ndx) then\ntable.insert(result, 'qc')\nelse\ntable.insert(result, 'cs')\nend\nelse\nif (not ndx) then\ntable.insert(result, '-qc')\nelse\ntable.insert(result, '-cs')\nend\nend\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, \"-D\" .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getquoteincludedirs(includedirs)\nlocal result = { }\nfor _,d" + "ir in ipairs(includedirs) do\ntable.insert(result, \"-iquote \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getsystemincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-isystem \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n", /* tools/ghs.lua */ "premake.ghs = { }\npremake.ghs.namestyle = \"PS3\"\npremake.ghs.cc = \"ccppc\"\npremake.ghs.cxx = \"cxppc\"\npremake.ghs.ar = \"cxppc\"\nlocal cflags =\n{\nFatalWarnings = \"--quit_after_warnings\",\nOptimize = \"-Ogeneral\",\nOptimizeSize = \"-Osize\",\nOptimizeSpeed = \"-Ospeed\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nNoExceptions = \"--no_exceptions\",\nNoRTTI = \"--no_rtti\",\nUnsignedChar = \"--unsigned_chars\",\n}\npremake.ghs.platforms =\n{\nNative = {\ncppflags = \"-MMD\",\n},\nPowerPC = {\ncc = \"ccppc\",\ncxx = \"cxppc\",\nar = \"cxppc\",\ncppflags = \"-MMD\",\narflags = \"-archive -o\",\n},\nARM = {\ncc = \"ccarm\",\ncxx = \"cxarm\",\nar = \"cxarm\",\ncppflags = \"-MMD\",\narflags = \"-archive -o\",\n}\n}\nlocal platforms = premake.ghs.platforms\nfunction premake.ghs.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nreturn flags\nend\nfunction premake.ghs.getcf" @@ -190,8 +190,8 @@ const char* builtin_scripts[] = { "function premake.showhelp()\nprintf(\"\")\nprintf(\"Usage: genie [options] action [arguments]\")\nprintf(\"\")\nprintf(\"OPTIONS\")\nprintf(\"\")\nfor option in premake.option.each() do\nlocal trigger = option.trigger\nlocal description = option.description\nif (option.value) then trigger = trigger .. \"=\" .. option.value end\nif (option.allowed) then description = description .. \"; one of:\" end\nprintf(\" --%-15s %s\", trigger, description)\nif (option.allowed) then\nfor _, value in ipairs(option.allowed) do\nprintf(\" %-14s %s\", value[1], value[2])\nend\nend\nprintf(\"\")\nend\nprintf(\"ACTIONS\")\nprintf(\"\")\nfor action in premake.action.each() do\nprintf(\" %-17s %s\", action.trigger, action.description)\nend\nprintf(\"\")\nprintf(\"For additional information, see https://github.com/bkaradzic/genie\")\nend\n", /* base/premake.lua */ - "premake._filelevelconfig = false\npremake._checkgenerate = true\nfunction premake.generate(obj, filename, callback)\nlocal prev = io.capture()\nlocal abort = (callback(obj) == false)\nlocal new = io.endcapture(prev)\nif abort then\npremake.stats.num_skipped = premake.stats.num_skipped + 1\nreturn\nend\nfilename = premake.project.getfilename(obj, filename)\nif (premake._checkgenerate) then\nlocal delta = false\nlocal f, err = io.open(filename, \"rb\")\nif (not f) then\nif string.find(err, \"No such file or directory\") then\ndelta = true\nelse\nerror(err, 0)\nend\nelse\nlocal existing = f:read(\"*all\")\nif existing ~= new then\ndelta = true\nend\nf:close()\nend\nif delta then\nprintf(\"Generating %s...\", filename)\nlocal f, err = io.open(filename, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write(new)\nf:close()\npremake.stats.num_generated = premake.stats.num_generated + 1\nelse\npremake.stats.num_skipped = premake.stats.num_skipped + 1\nend\nelse\nprintf(\"Generating %s...\", filename)\nlocal f, err " - "= io.open(filename, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write(new)\nf:close()\npremake.stats.num_generated = premake.stats.num_generated + 1\nend\nend\nfunction premake.findDefaultScript(dir, search_upwards)\nsearch_upwards = search_upwards or true\nlocal last = \"\"\nwhile dir ~= last do\nfor _, name in ipairs({ \"genie.lua\", \"solution.lua\", \"premake4.lua\" }) do\nlocal script0 = dir .. \"/\" .. name\nif (os.isfile(script0)) then\nreturn dir, name\nend\nlocal script1 = dir .. \"/scripts/\" .. name\nif (os.isfile(script1)) then\nreturn dir .. \"/scripts/\", name\nend\nend\nlast = dir\ndir = path.getabsolute(dir .. \"/..\")\nif dir == \".\" or not search_upwards then break end\nend\nreturn nil, nil\nend\n", + "premake._filelevelconfig = false\npremake._checkgenerate = true\nfunction premake.generate(obj, filename, callback)\nlocal prev = io.capture()\nlocal abort = (callback(obj) == false)\nlocal new = io.endcapture(prev)\nif abort then\npremake.stats.num_skipped = premake.stats.num_skipped + 1\nreturn\nend\nfilename = premake.project.getfilename(obj, filename)\nif (premake._checkgenerate) then\nlocal delta = false\nlocal f, err = io.open(filename, \"rb\")\nif (not f) then\nif string.find(err, \"No such file or directory\") then\ndelta = true\nelse\nerror(err, 0)\nend\nelse\nlocal existing = f:read(\"*all\")\nif existing ~= new then\ndelta = true\nend\nf:close()\nend\nif delta then\nprintf(\"Generating %q\", filename)\nlocal f, err = io.open(filename, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write(new)\nf:close()\npremake.stats.num_generated = premake.stats.num_generated + 1\nelse\npremake.stats.num_skipped = premake.stats.num_skipped + 1\nend\nelse\nprintf(\"Generating %q\", filename)\nlocal f, err = io.o" + "pen(filename, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write(new)\nf:close()\npremake.stats.num_generated = premake.stats.num_generated + 1\nend\nend\nfunction premake.findDefaultScript(dir, search_upwards)\nsearch_upwards = search_upwards or true\nlocal last = \"\"\nwhile dir ~= last do\nfor _, name in ipairs({ \"genie.lua\", \"solution.lua\", \"premake4.lua\" }) do\nlocal script0 = dir .. \"/\" .. name\nif (os.isfile(script0)) then\nreturn dir, name\nend\nlocal script1 = dir .. \"/scripts/\" .. name\nif (os.isfile(script1)) then\nreturn dir .. \"/scripts/\", name\nend\nend\nlast = dir\ndir = path.getabsolute(dir .. \"/..\")\nif dir == \".\" or not search_upwards then break end\nend\nreturn nil, nil\nend\n", /* base/iter.lua */ "iter = {}\nfunction iter.sortByKeys(arr, f)\nlocal a = table.keys(arr)\ntable.sort(a, f)\nlocal i = 0\nreturn function()\ni = i + 1\nif a[i] ~= nil then \nreturn a[i], arr[a[i]]\nend\nend\nend\n", @@ -229,22 +229,22 @@ const char* builtin_scripts[] = { /* actions/make/make_cpp.lua */ "-- --\npremake.make.cpp = { }\npremake.make.override = { }\npremake.make.makefile_ignore = false\nlocal cpp = premake.make.cpp\nlocal make = premake.make\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\nlocal action = premake.action.current()\npremake.gmake_cpp_header(prj, cc, platforms)\npremake.gmake_cpp_configs(prj, cc, platforms)\ntable.sort(prj.allfiles)\nlocal objdirs = {}\nlocal additionalobjdirs = {}\nfor _, file in ipairs(prj.allfiles) do\nif path.issourcefile(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nadditionalobjdirs[_MAKE.esc(path.getdirectory(path.getrelative(prj.location,buildtask[2])))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in iter.sortByKeys(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\nfor dir, _" - " in iter.sortByKeys(additionalobjdirs) do\n_p('\\t%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.allfiles) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" and not prj.options.SkipBundling then\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LIBDEPS) $(EXTERNAL_LIBS) $(RESOUR" - "CES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then\nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('\\t$(SILENT) $(LINKCMD) $(LINKOBJS)' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(LINKOBJS))' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\n_p('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)" - "')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" and not prj.options.SkipBundling then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PRE" - "BUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj, cc)\ncpp.dependencyRules(prj)\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal deps = string.format(\"%s \",path.getrelative(prj.location,buildtask[1]))\nfor _, depdata in ipairs(buildtask[3] or {}) do\ndeps = deps .. string.format(\"%s \",path.getrelative(prj.location,depdata))\nend\n_p('%s: %s | $(TARGETDIR) $(OBJDIRS)'\n,path.getrelative(prj.location,buildtask[2])\n, deps\n)\nfor _, cmdline in ipairs(buildtask[4] or {}) do\nlocal cmd = cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", \"$<\")\ncmd = string.gsub(cmd, \"%$%(@%)\", \"$@\")\n_p('\\t$(SILENT) %s',cmd)\nend\n_p('')\nend\nend\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(" - "PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p(' -include $(OBJDIR)/$(notdir $(PCH))_objc.d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || ex" - "it 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = %s', cc.rc or 'windres')\n_p(' endif')\n_p('endif')\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_cpp_configs(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config" - "),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(_MAKE.escquote(cc.getdefines(cfg.defines))))\nlocal id = make.list(cc.getincludedirs(cfg.includedirs));\nlocal uid = make.list(cc.getquoteincludedirs(cfg.userincludedirs))\nlocal sid = make.list(cc.getsystemincludedirs(cfg.systemincludedirs))\nif id ~= \"\" then\n_p(' INCLUDES +=%s', id)\nend\nif uid ~= \"\" then\n_p(' INCLUDES +=%s', uid)\nend\nif sid ~=" - " \"\" then\n_p(' INCLUDES +=%s', sid)\nend\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\ntable.sort(cfg.files)\nif cfg.flags.UseObjectResponseFile then\n_p(' OBJRESP = $(OBJDIR)/%s_objects', prj.name)\nelse\n_p(' OBJRESP =')\nend\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build" - " commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\n_p(' FORCE_INCLUDE_OBJC += -include $(OBJDIR)/$(notdir $(PCH))_objc')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,_MAKE.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg" - ".buildoptions, cfg.buildoptions_asm)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\nlocal libdeps\nloc" - "al lddeps\nif #cfg.wholearchive > 0 then\nlibdeps = {}\nlddeps = {}\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\nlddeps = table.join(lddeps, cc.wholearchive(linkpath))\nelse\ntable.insert(lddeps, linkpath)\nend\ntable.insert(libdeps, linkpath)\nend\nlibdeps = make.list(_MAKE.esc(libdeps))\nlddeps = make.list(_MAKE.esc(lddeps))\nelse\nlibdeps = make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nlddeps = libdeps\nend\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LIBDEPS +=%s', libdeps)\n_p(' LDDEPS +=%s', lddeps)\nif cfg.flags.UseLDResponseFile then\n_p(' LDRESP = $(OBJDIR)/%s_libs', prj.name)\n_p(' LIBS += @$(LDRESP)%s', make.list(cc.getlinkflags(cfg)))\nelse\n" - "_p(' LDRESP =')\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nend\n_p(' EXTERNAL_LIBS +=%s', make.list(cc.getlibfiles(cfg)))\n_p(' LINKOBJS = %s', (cfg.flags.UseObjectResponseFile and \"@$(OBJRESP)\" or \"$(OBJECTS)\"))\nif cfg.kind == \"StaticLib\" then\nif (not prj.options.ArchiveSplit) then\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\nelse\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\n_p(' LINKCMD_NDX = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, true)))\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group '\nendgroup = ' -Wl,--end-group'\nend\n_p(' LINKCMD = $(%s) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup, e" - "ndgroup)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\n_p(' GCH_OBJC = $(OBJDIR)/$(notdir $(PCH))_objc.gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_CFLAGS) -x c-header\", \"$(CXX) $(ALL_CXXFLAGS) -x c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('')\n_p('$(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)')" - "\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_OBJCFLAGS) -x objective-c-header\", \"$(CXX) $(ALL_OBJCPPFLAGS) -x objective-c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj, cc)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n_p('ifneq (,$(OBJRESP))')\n_p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\n_p('ifneq (,$(LDRESP))')\n_p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) then\nif (path.isobjcfile(file)) then\n_p('$(OBJDIR)/%s.o: %s $(GCH_OBJC) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path." - "removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nend\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\nif (path.iscfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCPPFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nend\nelseif (path.isasmfile(file)) then\n_p('\\t$(SILENT) $(CC) $(ALL_ASMFLAGS) -o \"$@\" -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\ne" - "lseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -c \"$<\"', flags, objext)\nend\n", + " in iter.sortByKeys(additionalobjdirs) do\n_p('\\t%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.allfiles) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" and not prj.options.SkipBundling then\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1 $(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1 $(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LIBDEPS) $(EXTERNAL_LIBS) $(RESO" + "URCES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then\nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('\\t$(SILENT) $(LINKCMD) $(LINKOBJS)' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(LINKOBJS))' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\n_p('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCM" + "D)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" and not prj.options.SkipBundling then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(P" + "REBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj, cc)\ncpp.dependencyRules(prj)\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal deps = string.format(\"%s \",path.getrelative(prj.location,buildtask[1]))\nfor _, depdata in ipairs(buildtask[3] or {}) do\ndeps = deps .. string.format(\"%s \",path.getrelative(prj.location,depdata))\nend\n_p('%s: %s | $(TARGETDIR) $(OBJDIRS)'\n,path.getrelative(prj.location,buildtask[2])\n, deps\n)\nfor _, cmdline in ipairs(buildtask[4] or {}) do\nlocal cmd = cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", \"$<\")\ncmd = string.gsub(cmd, \"%$%(@%)\", \"$@\")\n_p('\\t$(SILENT) %s',cmd)\nend\n_p('')\nend\nend\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (," + "$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p(' -include $(OBJDIR)/$(notdir $(PCH))_objc.d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || " + "exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = %s', cc.rc or 'windres')\n_p(' endif')\n_p('endif')\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_cpp_configs(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(conf" + "ig),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(_MAKE.escquote(cc.getdefines(cfg.defines))))\nlocal id = make.list(cc.getincludedirs(cfg.includedirs));\nlocal uid = make.list(cc.getquoteincludedirs(cfg.userincludedirs))\nlocal sid = make.list(cc.getsystemincludedirs(cfg.systemincludedirs))\nif id ~= \"\" then\n_p(' INCLUDES +=%s', id)\nend\nif uid ~= \"\" then\n_p(' INCLUDES +=%s', uid)\nend\nif sid " + "~= \"\" then\n_p(' INCLUDES +=%s', sid)\nend\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\ntable.sort(cfg.files)\nif cfg.flags.UseObjectResponseFile then\n_p(' OBJRESP = $(OBJDIR)/%s_objects', prj.name)\nelse\n_p(' OBJRESP =')\nend\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-bui" + "ld commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\n_p(' FORCE_INCLUDE_OBJC += -include $(OBJDIR)/$(notdir $(PCH))_objc')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,_MAKE.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), c" + "fg.buildoptions, cfg.buildoptions_asm)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\nlocal libdeps\nl" + "ocal lddeps\nif #cfg.wholearchive > 0 then\nlibdeps = {}\nlddeps = {}\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\nlddeps = table.join(lddeps, cc.wholearchive(linkpath))\nelse\ntable.insert(lddeps, linkpath)\nend\ntable.insert(libdeps, linkpath)\nend\nlibdeps = make.list(_MAKE.esc(libdeps))\nlddeps = make.list(_MAKE.esc(lddeps))\nelse\nlibdeps = make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nlddeps = libdeps\nend\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LIBDEPS +=%s', libdeps)\n_p(' LDDEPS +=%s', lddeps)\nif cfg.flags.UseLDResponseFile then\n_p(' LDRESP = $(OBJDIR)/%s_libs', prj.name)\n_p(' LIBS += @$(LDRESP)%s', make.list(cc.getlinkflags(cfg)))\nelse" + "\n_p(' LDRESP =')\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nend\n_p(' EXTERNAL_LIBS +=%s', make.list(cc.getlibfiles(cfg)))\n_p(' LINKOBJS = %s', (cfg.flags.UseObjectResponseFile and \"@$(OBJRESP)\" or \"$(OBJECTS)\"))\nif cfg.kind == \"StaticLib\" then\nif (not prj.options.ArchiveSplit) then\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\nelse\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\n_p(' LINKCMD_NDX = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, true)))\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group '\nendgroup = ' -Wl,--end-group'\nend\n_p(' LINKCMD = $(%s) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup," + " endgroup)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\n_p(' GCH_OBJC = $(OBJDIR)/$(notdir $(PCH))_objc.gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_CFLAGS) -x c-header\", \"$(CXX) $(ALL_CXXFLAGS) -x c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('')\n_p('$(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)'" + ")\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_OBJCFLAGS) -x objective-c-header\", \"$(CXX) $(ALL_OBJCPPFLAGS) -x objective-c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj, cc)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n_p('ifneq (,$(OBJRESP))')\n_p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\n_p('ifneq (,$(LDRESP))')\n_p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) then\nif (path.isobjcfile(file)) then\n_p('$(OBJDIR)/%s.o: %s $(GCH_OBJC) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path" + ".removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nend\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\nif (path.iscfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCPPFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nend\nelseif (path.isasmfile(file)) then\n_p('\\t$(SILENT) $(CC) $(ALL_ASMFLAGS) -o \"$@\" -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\n" + "elseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -c \"$<\"', flags, objext)\nend\n", /* actions/make/make_csharp.lua */ "local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\nlocal name = cfg.buildtarget.basename .. \".\"\nlocal dir = path.getdirectory(fname)\nif dir ~= \".\" then\nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Compile\" then" @@ -287,56 +287,56 @@ const char* builtin_scripts[] = { /* actions/vstudio/vstudio_vcxproj.lua */ "premake.vstudio.vc2010 = { }\nlocal vc2010 = premake.vstudio.vc2010\nlocal vstudio = premake.vstudio\nlocal function vs2010_config(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nif cfginfo.src_platform == \"TegraAndroid\" then\n_p(1,'')\n_p(2,'11')\n_p(1,'')\nbreak\nend\nend\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'', premake.esc(cfginfo.name))\n_p(3,'%s',cfginfo.buildcfg)\n_p(3,'%s',cfginfo.platform)\n_p(2,'')\nend\n_p(1,'')\nend\nlocal function vs2010_globals(prj)\nlocal action = premake.action.current()\n_p(1,'')\n_p(2, '{%s}',prj.uuid)\n_p(2, '%s',prj.name)\nif vstudio.store" "app ~= \"durango\" then\nlocal windowsTargetPlatformVersion = prj.windowstargetplatformversion or action.vstudio.windowsTargetPlatformVersion\nif windowsTargetPlatformVersion ~= nil then\n_p(2,'%s',windowsTargetPlatformVersion)\nif windowsTargetPlatformVersion and string.startswith(windowsTargetPlatformVersion, \"10.\") then\n_p(2,'%s', prj.windowstargetplatformminversion or \"10.0.10240.0\")\nend\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal frameworkVersion = prj.framework or \"4.0\"\n_p(2, 'v%s', frameworkVersion)\n_p(2, 'ManagedCProj')\nelseif vstudio.iswinrt() then\n_p(2, 'en-US')\nif vstudio.storeapp == \"durango\" then\n_p(2, 'Win32Proj')\n_p(2, 'title')\n_p(2, '14.0')\n_p(2, 'Native')\nelse\n_p(2, 'true')\n_p(2, '12.0')\n_p(2, 'Windows Store')\n_p(2, '%s', vstudio.storeapp)\nend\nelse\n_p(2, 'Win32Proj')\nend\nif _ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\" then\n_p(2,'x64')\nend\nif (_ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\")\nand os.isdir(path.join(os.getenv(\"VSINSTALLDIR\"), \"VC/Tools/MSVC/14.14.26428\")) then\n_p(2,'14.14.26428')\nend\nif not vstudio.xpwarning then\n_p(2, 'false')\nend\n_p(1,'')\nend\nfunction vc2010.config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"S" - "taticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nfunction vc2010.configurationPropertyGroup(cfg, cfginfo)\n_p(1, ''\n, premake.esc(cfginfo.name))\nlocal is2019 = premake.action.current() == premake.action.get(\"vs2019\")\nif is2019 then\n _p(2, '%s', action.vstudio.toolsVersion)\nif cfg.flags.UnitySupport then\n _p(2, 'true')\nend\nend\n_p(2, '%s', vc2010.config_type(cfg))\n_p(2, '%s', iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\n_p(2, '%s', premake.vstudio.toolset)\nif os.is64bit() then\n_p(2, 'x64')\nend\nif cfg.flags.MFC then\n_p(2,'%s', iif(cfg.flags.StaticRuntime, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.ATL or cfg.flags.StaticATL then\n_p(2,'%s', iif(cfg.flags.StaticATL, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.Unicode then\n_p(2,'Unicode')\nend\nif cfg.flags.Managed then\n_p(2,'true')\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidtargetapi then\n_p(2,'android-%s', cfg.androidtargetapi)\nend\nif cfg.androidminapi then\n_p(2,'android-%s', cfg.androidminapi)\nend\nif cfg.androidarch then\n_p(2,'%s', cfg.androidarch)\nend\nif cfg.androidndktoolchainversion then\n_p(2,'%s', cfg.androidndktoolchainversion)\nend\nif cfg.androidstltype then\n_p(2,'%s', cfg.androidstltype)\nend\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\n_p(2,'$(NINTENDO_SDK_ROOT)\\\\')\n_p(2,'NX')\nif premake.config.isdebugbuild(cfg) then\n_p(2,'Debug')\nelse\n_p(2,'Release')\nend\nend\nif cfg.flags.Symbols and (premake.action.current() == premake.action.get(\"vs2017\") or is2019) then\n_p(2, 'true')\nend\n_p(1,'')\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\n_p(2,'')\nif #cfg.propertysheets > 0 then\nlocal dirs = cfg.propertysheets\nfor _, dir in ipairs(dirs) do\n_p(2,'', path.translate(dir))\nend\nend\n_p(1,'')\nend\nend\nlocal function add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nfunction vc2010.outputProperties(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nlocal target = cfg.buildtarget\nlocal outdir = add_trailing_backslash(target.directory)\nlocal intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute\n, path.translate(\n path.join(prj.solution.location, cfg.objectsdir)\n, '\\\\')" - "\n, cfg.objectsdir\n))\n_p(1,'', premake.esc(cfginfo.name))\n_p(2,'%s', iif(outdir:len() > 0, premake.esc(outdir), \".\\\\\"))\nif cfg.platform == \"Xbox360\" then\n_p(2,'$(OutDir)%s', premake.esc(target.name))\nend\n_p(2,'%s', premake.esc(intdir))\n_p(2,'%s', premake.esc(path.getbasename(target.name)))\n_p(2,'%s', premake.esc(path.getextension(target.name)))\nif cfg.kind == \"SharedLib\" then\nlocal ignore = (cfg.flags.NoImportLib ~= nil)\n_p(2,'%s', tostring(ignore))\nend\nif cfg.platform == \"Durango\" then\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_SdkLibPath)')\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_SdkIncludeRoot)'" - ")\n_p(2, '$(Console_SdkRoot)bin;$(VCInstallDir)bin\\\\x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7\\\\Tools\\\\bin;$(VSInstallDir)Common7\\\\tools;$(VSInstallDir)Common7\\\\ide;$(ProgramFiles)\\\\HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);')\nif cfg.imagepath then\n_p(2, '%s', cfg.imagepath)\nelse\n_p(2, '%s', prj.name)\nend\nif cfg.pullmappingfile ~= nil then\n_p(2,'%s', premake.esc(cfg.pullmappingfile))\nend\n_p(2, '*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb')\n_p(2, 'true')\nend\nif cfg.kind ~= \"StaticLib\" then\n_p(2,'%s', tostring(premake.config.isincrementallink(cfg)))\nend\nif cfg.applicationdatadir ~= nil then\n_p(2,'%s', premake.esc(cf" - "g.applicationdatadir))\nend\nif cfg.flags.NoManifest then\n_p(2,'false')\nend\n_p(1,'')\nend\nend\nlocal function runtime(cfg)\nlocal runtime\nlocal flags = cfg.flags\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'Use')\n_p(3,'%s', cfg.pchheader)\nelse\n_p(3,'')\nend\nend\nlocal function preprocessor(indent,cfg,escape)\nif #cfg.defines > 0 then\nlocal defines = table.concat(cfg.defines, \";\")\nif escape then\ndefines = defines:gsub('\"', '\\\\\"')\nend\nlocal isPreprocessorDefinitionPresent = string.find(d" - "efines, \"%%%(PreprocessorDefinitions%)\")\nif isPreprocessorDefinitionPresent then\n_p(indent,'%s'\n,premake.esc(defines))\nelse\n_p(indent,'%s;%%(PreprocessorDefinitions)'\n,premake.esc(defines))\nend\nelse\n_p(indent,'')\nend\nend\nlocal function include_dirs(indent,cfg)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs> 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\')))\nend\nend\nlocal function using_dirs(indent,cfg)\nif #cfg.usingdirs > 0 then\n_p(indent,'%s;%%(AdditionalUsingDirectories)'\n,premake.esc(path.translate(table.concat(cfg.usingdirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compi" - "le(cfg)\n_p(2,'')\npreprocessor(3,cfg,true)\ninclude_dirs(3,cfg)\n_p(2,'')\nend\nlocal function cppstandard_vs2017_or_2019(cfg)\nif cfg.flags.CppLatest then\n_p(3, 'stdcpplatest')\n_p(3, 'true')\nelseif cfg.flags.Cpp17 then\n_p(3, 'stdcpp17')\nelseif cfg.flags.Cpp14 then\n_p(3, 'stdcpp14')\nend\nend\nlocal function exceptions(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nend\nelse\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nelseif cfg.flags.SEH then\n_p(3, 'Async')\nend\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI and not cfg.fla" - "gs.Managed then\n_p(3,'false')\nend\nend\nlocal function calling_convention(cfg)\nif cfg.flags.FastCall then\n_p(3,'FastCall')\nelseif cfg.flags.StdCall then\n_p(3,'StdCall')\nend\nend\nlocal function wchar_t_builtin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'true')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'false')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3, 'StreamingSIMDExtensions')\nelseif cfg.flags.EnableSSE2 then\n_p(3, 'StreamingSIMDExtensions2')\nelseif cfg.flags.EnableAVX then\n_p(3, 'AdvancedVectorExtensions')\nelseif cfg.flags.EnableAVX2 then\n_p(3, 'AdvancedVectorExtensions2')\nend\nend\nlocal function floating_point(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.FloatFast then\n_p(3,'true')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nelse\nif cfg.flags.FloatFast then\n_p(3,'Fast')\nelseif cfg.flags.FloatStrict and not cfg.flags.Managed then\n_p(3,'Strict')\nend\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif cfg.flags.C7DebugInfo then\ndebug_info = \"OldStyle\"\nelseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \"x64\")\nor not premake.config.iseditandcontinue(cfg)\nthen\ndebug_info = \"ProgramDatabase\"\nelse\ndebug_info = \"EditAndContinue\"\nend\nend\n_p(3,'%s',debug_info)\nend\nlocal function minimal_build(cfg)\nif premake.config.isdebugbuild(cfg) and cfg.flags.EnableMinimal" - "Rebuild then\n_p(3,'true')\nelse\n_p(3,'false')\nend\nend\nlocal function compile_language(cfg)\nif cfg.options.ForceCPP then\n_p(3,'CompileAsCpp')\nelse\nif cfg.language == \"C\" then\n_p(3,'CompileAsC')\nend\nend\nend\nlocal function forcedinclude_files(indent,cfg)\nif #cfg.forcedincludes > 0 then\n_p(indent,'%s'\n,premake.esc(path.translate(table.concat(cfg.forcedincludes, \";\"), '\\\\')))\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'')\nlocal unsignedChar = \"/J \"\nlocal buildoptions = cfg.buildoptions\nif cfg.platform == \"Orbis\" then\nunsignedChar = \"-funsigned-char \";\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.language == \"C\" and not cfg.options.ForceCPP then\nbuildoptions = table.join(buildoptions, cfg.buildoptions_c)\nelse\nbuildoptions = table.join(buildo" - "ptions, cfg.buildoptions_cpp)\nend\n_p(3,'%s %s%%(AdditionalOptions)'\n, table.concat(premake.esc(buildoptions), \" \")\n, iif(cfg.flags.UnsignedChar and cfg.platform ~= \"TegraAndroid\", unsignedChar, \" \")\n)\nif cfg.platform == \"TegraAndroid\" then\n_p(3,'%s', tostring(cfg.flags.UnsignedChar == nil))\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nif cfg.androidcppstandard then\n_p(3,'%s', cfg.androidcppstandard)\nend\nend\nif cfg.platform == \"Orbis\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'Level0')\nelseif opt == \"MinSpace\" then\n_p(3,'Levelz') -- Oz is more aggressive than Os\nelseif opt == \"MaxSpeed\" then\n_p(3,'Level3')\nelse\n_p(3,'Level2')\nend\nelseif" - " cfg.platform == \"TegraAndroid\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'O0')\nelseif opt == \"MinSpace\" then\n_p(3,'Os')\nelseif opt == \"MaxSpeed\" then\n_p(3,'O3')\nelse\n_p(3,'O2')\nend\nelse\n_p(3,'%s', optimisation(cfg))\nend\ninclude_dirs(3, cfg)\nusing_dirs(3, cfg)\npreprocessor(3, cfg)\nminimal_build(cfg)\nif premake.config.isoptimizedbuild(cfg.flags) then\nif cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then\n_p(3, 'false')\n_p(3, 'false')\nelse\n_p(3, 'true')\n_p(3, 'true')\nend\nelse\n_p(3, 'true')\nif cfg.flags.NoRuntimeChecks then\n_p(3, 'Default')\nelseif not cfg.flags.Managed then\n_p(3, 'EnableFastChecks')\nend\nif cfg.flags.ExtraWarnings then\nend\nend\nif cfg.platform == \"Durango\" or cfg.flags.NoWinRT then\n_p(3, 'false')\nend\n_p(3, '%s', runtime(cfg))\nif cfg.flags.NoBufferSecurityCheck then\n_p(3, 'false')\nend\nif not cfg.flags.NoMultiProcessorCompilation and not cfg.flags.EnableMinimalRebuild then\n_p(3, 'true')\nelse\n_p(3, 'false')\nend\nprecompiled_header(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.PedanticWarnings then\n_p(3, 'MoreWarnings')\n_p(3, 'true')\nelseif cfg.flags.ExtraWarnings then\n_p(3, 'NormalWarnings')\n_p(3, 'true')\nelseif cfg.flags.MinimumWa" - "rnings then\n_p(3, 'WarningsOff')\n_p(3, 'false')\nelse\n_p(3, 'NormalWarnings')\n_p(3, 'false')\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\n_p(3, 'AllWarnings')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'DisableAllWarnings')\nelse\n_p(3, 'NormalWarnings')\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nelse\nif cfg.flags.PedanticWarnings then\n_p(3, 'EnableAllWarnings')\nelseif cfg.flags.ExtraWarnings then\n_p(3, 'Level4')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'Level1')\nelse\n_p(3 ,'Level3')\nend\nend\nif cfg.flag" - "s.FatalWarnings then\n_p(3, 'true')\nend\nif premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\") then\ncppstandard_vs2017_or_2019(cfg)\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif _ACTION:sub(3) == \"llvm\" then\n_p(3,'false')\nend\nif cfg.flags.Symbols then\nif cfg.kind == \"StaticLib\" then\n_p(3, '$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nelse\n_p(3, '$(IntDir)%s.compile.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, 'true')\nend\nif cfg.flags.NoFramePointer then\n_p(3, 'true')\nend\nif cfg.flags.UseFullPaths " - "then\n_p(3, 'true')\nend\nif cfg.flags.NoJMC then\n_p(3,'false' )\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\nif vstudio.diagformat then\n_p(3, '%s', vstudio.diagformat)\nelse\n_p(3, 'Caret')\nend\n_p(2,'')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nlocal fu" - "nction additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'%s', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(prj, cfg)\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\nif _ACTION:sub(3) == \"llvm\" and prj.name == \"portaudio\" then -- MSVC-LLVM needs special help\n_p(2,'ksuser.lib;%%(AdditionalDependencies)')\nend\n_p(1,'')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function hasmasmfiles(prj)\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nreturn #files > 0\nend\nlocal function ismanagedprj(prj, cfgname, pltname)\nlocal cfg = premake.getconfig(prj, cfgname, pltname)\nreturn cfg.flags.Managed == true\nend\nlocal function getcfglinks(cfg)\nlocal haswholearchive = #cfg.wholearchive > 0\nlocal msvcnaming = premake.getnamestyle(cfg) == \"windows\"\nlocal iscppprj = premake.iscppproject(cfg)\nlocal isnetprj = premake.isdotnetproject(cfg)\nlocal linkobjs = {}\nlocal links = iif(haswholearchive\n, premake.getlinks(cfg, \"all\", \"object\")\n, premake.getlinks(cfg, \"system\", \"fullpath\")\n)\nfor _, link in ipairs(links) do\nlocal name = nil\nlocal directory = nil\nlocal whole = nil\nif type(link) == \"table\" then\nif not ismanagedprj(link.project, cfg.name, cfg.platform) then\nname = link.linktarget.basen" - "ame\ndirectory = path.rebase(link.linktarget.directory, link.location, cfg.location)\nwhole = table.icontains(cfg.wholearchive, link.project.name)\nend\nelse\nname = link\nwhole = table.icontains(cfg.wholearchive, link)\nend\nif name then\nif haswholearchive and msvcnaming then\nif iscppprj then\nname = name .. \".lib\"\nelseif isnetprj then\nname = name .. \".dll\"\nend\nend\ntable.insert(linkobjs, {name=name, directory=directory, wholearchive=whole})\nend\nend\nreturn linkobjs\nend\nlocal function vs10_masm(prj, cfg)\nif hasmasmfiles(prj) then\n_p(2, '')\n_p(3,'%s %%(AdditionalOptions)'\n, table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \")\n)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs > 0 then\n_p(3, '%s;%%(IncludePaths)'\n, premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\'))\n)\nend\nlocal defines = table" - ".join(cfg.defines)\ntable.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \"_DEBUG\", {}))\ntable.insert(defines, iif(cfg.platform == \"x64\", \"_WIN64\", \"_WIN32\"))\ntable.insert(defines, iif(prj.kind == \"SharedLib\", \"_EXPORT=EXPORT\", \"_EXPORT=\"))\n_p(3, '%s;%%(PreprocessorDefinitions)'\n, premake.esc(table.concat(defines, \";\"))\n)\nif cfg.flags.FatalWarnings then\n_p(3,'true')\nend\nif cfg.flags.MinimumWarnings then\n_p(3,'0')\nelse\n_p(3,'3')\nend\n_p(2, '')\nend\nend\nlocal function additional_manifest(cfg)\nif(cfg.dpiawareness ~= nil) then\n_p(2,'')\nif(cfg.dpiawareness == \"None\") then\n_p(3, 'false')\nend\nif(cfg.dpiawareness == \"High\") then\n_p(3, 'true')\nend\nif(cfg.dpiawareness == \"HighPerMonitor\") then\n_p(3, 'PerMonitorHighDPIAware')\nend\n_p(2,'')\nend\nend\nfunction vc2010.link(cfg)\nlocal vs2017OrLater = premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\")\nlocal vsllvm = premake.action.current() == premake.action.get(\"vsllvm\")\nlocal links = getcfglinks(cfg)\n_p(2,'')\n_p(3,'%s', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\nif (vs2017OrLater or vsllvm) and cfg.flags.FullSymbols then\n_p(3,'DebugFull')\nelse\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.flags.Symbols then\n_p(3, '$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nif premake.config.islinkeroptimizedbuild(cfg.flags) then\nif cfg.platform == \"Orbis\" then\n_p(3,'StripFuncsAndData')\n" - "_p(3,'true')\nelse\n_p(3,'true')\n_p(3,'true')\nend\nelseif cfg.platform == \"Orbis\" and premake.config.iseditandcontinue(cfg) then\n_p(3,'true')\nend\nif cfg.finalizemetasource ~= nil then\n_p(3,'%s', premake.esc(cfg.finalizemetasource))\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(3, cfg, links)\nvc2010.additionalLibraryDirectories(3, cfg, links)\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'wmainCRTStartup')\nelse\n_p(3,'mainCRTStartup')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\n_p(3,'" - "%s', deffile)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nif cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n_p(3,'false' )\nend\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidlinker then\n_p(3,'%s',cfg.androidlinker)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, 'Enabled')\nend\n_p(2,'')\nif #cfg.wholearchive > 0 then\n_p(2, '')\n_p(3, 'false')\n_p(2, '')\nend\nend\nfunction vc2010.additionalLibraryDirectories(tab, cfg, links)\nlocal dirs = cfg.libdirs\nfor _, link in ipairs(links) do\nif link.directory and not table.icontains(dirs, link.directory) then\ntable.insert(dirs, link.directory)\nend\nend\n_p(tab, '%s;%%(AdditionalLibraryDirectories)'\n," - " premake.esc(path.translate(table.concat(dirs, ';'), '\\\\'))\n)\nend\nfunction vc2010.additionalDependencies(tab, cfg, links)\nif #links > 0 then\nlocal deps = \"\"\nif cfg.platform == \"Orbis\" then\nlocal iswhole = false\nfor _, link in ipairs(links) do\nif link.wholearchive and not iswhole then\ndeps = deps .. \"--whole-archive;\"\niswhole = true\nelseif not link.wholearchive and iswhole then\ndeps = deps .. \"--no-whole-archive;\"\niswhole = false\nend\ndeps = deps .. \"-l\" .. link.name .. \";\"\nend\nelse\nfor _, link in ipairs(links) do\nif link.wholearchive then\ndeps = deps .. \"/WHOLEARCHIVE:\" .. link.name .. \";\"\nelse\ndeps = deps .. link.name .. \";\"\nend\nend\nend\nif cfg.platform == \"TegraAndroid\" then\ndeps = \"-Wl,--start-group;\" .. deps .. \";-Wl,--end-group\"\nend\n_p(tab, '%s;%s'\n, deps\n, iif(cfg.platform == \"Durango\"\n, '%(XboxExtensionsDependencies)'\n, '%(AdditionalDependencies)'\n)\n)\nelseif cfg.platform == \"Durango\" then\n_" - "p(tab, '%%(XboxExtensionsDependencies)')\nend\nend\nfunction ant_build(prj, cfg)\nif cfg.platform == \"TegraAndroid\" then\nlocal files = vc2010.getfilegroup(prj, \"AndroidBuild\")\n_p(2,'')\nif #files > 0 then\n_p(3,'%s',path.translate(files[1].name))\nend\nlocal isdebugbuild = premake.config.isdebugbuild(cfg)\n_p(3,'%s',iif(isdebugbuild, 'Debug','Release'))\n_p(3,'%s',tostring(cfg.flags.AntBuildDebuggable ~= nil))\nif #cfg.antbuildjavasourcedirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjavasourcedirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildjardirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjardirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildjardependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildjardependencies,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildnativelibdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildnativelibdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdependencies,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildassetsdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildassetsdirs,\";\")\n_p(3,'%s',dirs)\nend\n_p(2,'')\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(prj, cfg)\nvc2010.link(cfg)\nant_build(prj, cfg)\nevent_hooks(cfg)\nvs10_masm(prj, cfg)\nadditional_manifest(cfg)\n_p(1,'')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nMASM = {},\nObject = {},\nNone = {},\nResourceCompile = {},\nAppxManifest = {},\nAndroidBuild = {},\nNatvis = {},\nImage = {},\nDeploymentContent = {}\n}\nlocal foundAppxManifest = false\nfor file in premake.project.eachfile(prj, true) do\nif path.issourcefilevs(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not table.icontains(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isobjectfile(file.name) then\ntable.insert(sortedfiles.Object, file)\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelseif path.isimagefile(file.name) then\ntable.insert(sortedfiles.Image, file)\nelseif path.isappxmanifest(file.name) then\nfoundAppxManifest = true\ntable.insert(sortedfiles.AppxManifest, file)\nelseif path.is" - "androidbuildfile(file.name) then\ntable.insert(sortedfiles.AndroidBuild, file)\nelseif path.isnatvis(file.name) then\ntable.insert(sortedfiles.Natvis, file)\nelseif path.isasmfile(file.name) then\ntable.insert(sortedfiles.MASM, file)\nelseif file.flags and table.icontains(file.flags, \"DeploymentContent\") then\ntable.insert(sortedfiles.DeploymentContent, file)\nelse\ntable.insert(sortedfiles.None, file)\nend\nend\nif vstudio.iswinrt() and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \"/Package.appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nlocal logo = {}\nlogo.name = prj.name .. \"/Logo.png\"\nlogo.vpath = logo.name\ntable.insert(sortedfiles.Image, logo)\nlocal smallLogo = {}\nsmallLogo.name = prj.name .. \"/SmallLogo.png\"\nsmallLogo.vpath = smallLogo.name\ntable.insert(sortedfiles.Image, smallLogo)\nlocal storeLogo = {}\nstoreLogo.name = prj.name " - ".. \"/StoreLogo.png\"\nstoreLogo.vpath = storeLogo.name\ntable.insert(sortedfiles.Image, storeLogo)\nlocal splashScreen = {}\nsplashScreen.name = prj.name .. \"/SplashScreen.png\"\nsplashScreen.vpath = splashScreen.name\ntable.insert(sortedfiles.Image, splashScreen)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"Object\")\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.customtaskgroup(prj)\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\nvc2010.simplefilesgroup(prj, \"AppxManifest\")\nvc2010.simplefilesgroup(prj, \"AndroidBuild\")\nvc2010.simplefilesgroup(prj, \"Natvis\")\nvc2010.deploymentcontentgroup(prj, \"Image\")\nvc2010.deploymentcontentgroup(prj, \"DeploymentContent\", \"None\")\nend\nfunction vc2010.customtaskgroup(prj)\nlocal files = { }\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(cus" - "tombuildtask or {}) do\nlocal fcfg = { }\nfcfg.name = path.getrelative(prj.location,buildtask[1])\nfcfg.vpath = path.trimdots(fcfg.name)\ntable.insert(files, fcfg)\nend\nend\nif #files > 0 then\n_p(1,'')\nlocal groupedBuildTasks = {}\nlocal buildTaskNames = {}\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nif (groupedBuildTasks[buildtask[1]] == nil) then\ngroupedBuildTasks[buildtask[1]] = {}\ntable.insert(buildTaskNames, buildtask[1])\nend\ntable.insert(groupedBuildTasks[buildtask[1]], buildtask)\nend\nend\nfor _, name in ipairs(buildTaskNames) do\ncustombuildtask = groupedBuildTasks[name]\n_p(2,'', path.translate(path.getrelative(prj.location,name), \"\\\\\"))\n_p(3,'Text')\nlocal cmd = \"\"\nlocal outputs = \"\"\nfor _, buildtask in ipairs(custombuildtask or {}) do\nfor _, cmdline in ipairs(buildtask[4] or {}) do\ncmd = cmd .. cmdline\nlocal num = 1\nfor _, depdata in ipair" - "s(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[1])))\ncmd = string.gsub(cmd, \"%$%(@%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[2])))\ncmd = cmd .. \"\\r\\n\"\nend\noutputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \";\"\nend\n_p(3,'%s',cmd)\n_p(3,'%s%%(Outputs)',outputs)\n_p(3,'Designer')\n_p(3,'')\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader" - " and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'')\nfor _, file in ipairs(files) do\nlocal prjexcluded = table.icontains(prj.excludes, file.name)\nlocal excludedcfgs = {}\nif not prjexcluded then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif not fileincfg or cfgexcluded then\ntable.insert(excludedcfgs, vsconfig.name)\nend\nend\nend\nif subtype or prjexcluded or #excludedcfgs > 0 then\n_p(2, '<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\nif prjexcluded then\n_p(3, 'true')\nelse\nfor _, cfgname in ipairs(excludedcfgs) do\n_p(3, 'true'\n, premake.esc(cfgname)\n)\nend\nend\nif subtype t" - "hen\n_p(3, '%s', subtype)\nend\n_p(2,'', section)\nelse\n_p(2, '<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'')\nend\nend\nfunction vc2010.deploymentcontentgroup(prj, section, filetype)\nif filetype == nil then\nfiletype = section\nend\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'')\nfor _, file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\">', filetype, path.translate(file.name, \"\\\\\"))\n_p(3,'true')\n_p(3,'%s', path.translate(file.vpath, \"\\\\\"))\n_p(2,'', filetype)\nend\n_p(1,'')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheade" - "r and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'')\nlocal existingBasenames = {};\nfor _, file in ipairs(files) do\nlocal filename = string.lower(path.getbasename(file.name))\nlocal disambiguation = existingBasenames[filename] or 0;\nexistingBasenames[filename] = disambiguation + 1\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal namestyle = premake.getnamestyle(cfg)\nif namestyle == \"TegraAndroid\" or namestyle == \"NX\" then\n_p(3, '$(IntDir)%s.o', premake.esc(vsconfig.name), premake.esc(path.translate(path.trimdots(path.removeext(file.name)))) )\nelse\nif disambiguation > 0 then\n_p(3, '$(IntDir)%s\\\\', premake.esc(vsconfig.name), tostring(disambiguation))\nend\nend\nend\nif path.iscxfile(file.name) then\n_p(3, 'true')\n_p(3, 'true')\n_p(3, 'NotUsing')\nend\nif vstudio.iswinrt() and string.len(file.name) > 2 and string.sub(file.name, -2) == \".c\" then\n_p(3,'FALSE')\nend\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'Create', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nlocal nopch = table.icontains(prj.nopch, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif nopch or table.icontains(cfg.nopch, file.name) then\n_p(3,'NotUsing', premake.esc(vsconfig.name))\nend\nend\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, 'true'\n, premake.esc(vsconfig.name)\n)\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal prjforcenative = table.icontains(prj.forcenative, file.name)\nfor _,vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif prjforcenative or table.icontains(cfg.forcenative, file.name) then\n_p(3, 'false', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.masmfiles(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nif #files > 0 then\n_p(1, '')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, 'true'\n, premake.esc(vsconfig.name)\n)\nend\nend\n_p(2, '')\nend\n_p(1, '')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('')\nlocal t = \"\"\nif targets then\nt = ' DefaultTar" - "gets=\"' .. targets .. '\"'\nend\n_p('', t, action.vstudio.toolsVersion)\nend\nfunction premake.vs2010_vcxproj(prj)\nlocal usemasm = hasmasmfiles(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'')\n_p(1,'')\nif usemasm then\n_p(2, '')\nend\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.clrReferences(prj)" - "\nvc2010.projectReferences(prj)\nvc2010.sdkReferences(prj)\nvc2010.masmfiles(prj)\n_p(1,'')\n_p(1,'')\nif usemasm then\n_p(2, '')\nend\n_p(1,'')\n_p('')\nend\nfunction vc2010.clrReferences(prj)\nif #prj.clrreferences == 0 then\nreturn\nend\n_p(1,'')\nfor _, ref in ipairs(prj.clrreferences) do\nif os.isfile(ref) then\nlocal assembly = path.getbasename(ref)\n_p(2,'', assembly)\n_p(3,'%s', path.getrelative(prj.location, ref))\n_p(2,'')\nelse\n_p(2,'', ref)\nend\nend\n_p(1,'')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps == 0 and #prj.vsimportreferences == 0 then\nreturn\nend\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps" - ", compareuuid)\ntable.sort(table.join(prj.vsimportreferences), compareuuid)\n_p(1,'')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'', path.translate(deppath, \"\\\\\"))\n_p(3,'{%s}', dep.uuid)\nif vstudio.iswinrt() then\n_p(3,'false')\nend\n_p(2,'')\nend\nfor _, ref in ipairs(prj.vsimportreferences) do\nlocal slnrelpath = path.rebase(ref, prj.location, sln.location)\nlocal iprj = premake.vstudio.getimportprj(slnrelpath, prj.solution)\n_p(2,'', ref)\n_p(3,'{%s}', iprj.uuid)\n_p(2,'')\nend\n_p(1,'')\nend\nfunction vc2010.sdkReferences(prj)\nlocal refs = prj.sdkreferences\nif #refs > 0 then\n_p(1,'')\nfor _, ref in ipairs(refs) do\n_p(2,'', ref)\nend\n_p(1,'')\nend\nend" - "\nfunction vc2010.debugdir(cfg)\nlocal isnx = (cfg.platform == \"NX32\" or cfg.platform == \"NX64\")\nlocal debuggerFlavor =\n iif(isnx, 'OasisNXDebugger'\n, iif(cfg.platform == \"Orbis\", 'ORBISDebugger'\n, iif(cfg.platform == \"Durango\", 'XboxOneVCppDebugger'\n, iif(cfg.platform == \"TegraAndroid\", 'AndroidDebugger'\n, iif(vstudio.iswinrt(), 'AppHostLocalDebugger'\n, 'WindowsLocalDebugger'\n)))))\n_p(2, '%s', debuggerFlavor)\nif cfg.debugdir and not vstudio.iswinrt() then\n_p(2, '%s'\n, path.translate(cfg.debugdir, '\\\\')\n)\nend\nif cfg.debugcmd then\n_p(2, '%s', cfg.debugcmd)\nend\nif cfg.debugargs then\n_p(2, '%s'\n, table.concat(cfg.debugargs, \" \")\n)\nend\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2, '%s%s'\n, table.concat(cfg.debugenvs, \"\\n\")\n, iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)', '')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2, 'false')\nend\nend\nif cfg.deploymode then\n_p(2, '%s', cfg.deploymode)\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androiddebugintentparams then\n_p(2, '%s'\n, table.concat(cfg.androiddebugintentparams, \" \")\n)\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' ', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\n_p(' ')\nend\n_p('')\nend\nlocal png1x1data = {\n0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0" - "x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR\n0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V\n0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- .....PLTE....z=.\n0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f...\n0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`.......\n0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`.\n}\nfunction png1x1(obj, filename)\nfilename = premake.project.getfilename(obj, filename)\nlocal f, err = io.open(filename, \"wb\")\nif f then\nfor _, byte in ipairs(png1x1data) do\nf:write(string.char(byte))\nend\nf:close()\nend\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('')\nif v" - "studio.storeapp == \"10.0\" then\n_p('')\nelseif vstudio.storeapp == \"durango\" then\n_p('')\nend\n_p(1, '')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '')\nend\n_p(1, '')\n_p(2, '' .. prj.name .. '')\n_p(2, 'PublisherDisplayName')\n_" - "p(2, '' .. prj.name .. '\\\\StoreLogo.png')\npng1x1(prj, \"%%/StoreLogo.png\")\n_p(2, '' .. prj.name .. '')\n_p(1,'')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '')\n_p(2, '')\n_p(1, '')\nelseif vstudio.storeapp == \"durango\" then\n_p(1, '')\n_p(2, '6.2')\n_p(2, '6.2')\n_p(1, '')\nend\n_p(1, '')\n_p(2, '')\n_p(1, '')\n_p(1, '')\n_p(2, '')\nif vstudio.storeapp == \"10.0\" then\n_p(3, '')\n_p(4, '')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '')\nelseif vstudio.storeapp == \"durango\" then\n_p(3, '')\n_p(5, '')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p" - "(3, '')\n_p(3, '')\n_p(4, '')\n_p(4, '')\n_p(4, '')\n_p(3, '')\nend\n_p(2, '')\n_p(1, '')\n_p('')\nend\n", + "nimumVisualStudioVersion>')\n_p(2, 'Native')\nelse\n_p(2, 'true')\n_p(2, '12.0')\n_p(2, 'Windows Store')\n_p(2, '%s', vstudio.storeapp)\nend\nelse\n_p(2, 'Win32Proj')\nend\nif _ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"2019\" or _ACTION:sub(3) == \"llvm\" then\n_p(2,'x64')\nend\nif (_ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\")\nand os.isdir(path.join(os.getenv(\"VSINSTALLDIR\"), \"VC/Tools/MSVC/14.14.26428\")) then\n_p(2,'14.14.26428')\nend\nif not vstudio.xpwarning then\n_p(2, 'false')\nend\n_p(1,'')\nend\nfunction vc2010.config_type(config)\nlocal t =\n{\nSharedLib = \"Dyna" + "micLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nfunction vc2010.configurationPropertyGroup(cfg, cfginfo)\n_p(1, ''\n, premake.esc(cfginfo.name))\nlocal is2019 = premake.action.current() == premake.action.get(\"vs2019\")\nif is2019 then\n _p(2, '%s', action.vstudio.toolsVersion)\nif cfg.flags.UnitySupport then\n _p(2, 'true')\nend\nend\n_p(2, '%s', vc2010.config_type(cfg))\n_p(2, '%s', iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\n_p(2, '%s', premake.vstudio.toolset)\nif os.is64bit() then\n_p(2, 'x64')\nend\nif cfg.flags.MFC then\n_p(2,'%s', iif(cfg.flags.StaticRuntime, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.ATL or cfg.flags.StaticATL then\n_p(2,'%s', iif(cfg.flags.StaticATL, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.Unicode then\n_p(2,'Unicode')\nend\nif cfg.flags.Managed then\n_p(2,'true')\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidtargetapi then\n_p(2,'android-%s', cfg.androidtargetapi)\nend\nif cfg.androidminapi then\n_p(2,'android-%s', cfg.androidminapi)\nend\nif cfg.androidarch " + "then\n_p(2,'%s', cfg.androidarch)\nend\nif cfg.androidndktoolchainversion then\n_p(2,'%s', cfg.androidndktoolchainversion)\nend\nif cfg.androidstltype then\n_p(2,'%s', cfg.androidstltype)\nend\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\n_p(2,'$(NINTENDO_SDK_ROOT)\\\\')\n_p(2,'NX')\nif premake.config.isdebugbuild(cfg) then\n_p(2,'Debug')\nelse\n_p(2,'Release')\nend\nend\nif cfg.flags.Symbols and (premake.action.current() == premake.action.get(\"vs2017\") or is2019) then\n_p(2, 'true')\nend\n_p(1,'')\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\n_p(2,'')\nif #cfg.propertysheets > 0 then\nlocal dirs = cfg.propertysheets\nfor _, dir in ipairs(dirs) do\n_p(2,'', path.translate(dir))\nend\nend\n_p(1,'')\nend\nend\nlocal function add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nfunction vc2010.outputProperties(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nlocal target = cfg.buildtarget\nlocal outdir = add_trailing_backslash(target.directory)\nlocal intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute\n, path.translate(\n path.join(prj.solution.locati" + "on, cfg.objectsdir)\n, '\\\\')\n, cfg.objectsdir\n))\n_p(1,'', premake.esc(cfginfo.name))\n_p(2,'%s', iif(outdir:len() > 0, premake.esc(outdir), \".\\\\\"))\nif cfg.platform == \"Xbox360\" then\n_p(2,'$(OutDir)%s', premake.esc(target.name))\nend\n_p(2,'%s', premake.esc(intdir))\n_p(2,'%s', premake.esc(path.getbasename(target.name)))\n_p(2,'%s', premake.esc(path.getextension(target.name)))\nif cfg.kind == \"SharedLib\" then\nlocal ignore = (cfg.flags.NoImportLib ~= nil)\n_p(2,'%s', tostring(ignore))\nend\nif cfg.platform == \"Durango\" then\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_SdkLibPath)')\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_" + "SdkIncludeRoot)')\n_p(2, '$(Console_SdkRoot)bin;$(VCInstallDir)bin\\\\x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7\\\\Tools\\\\bin;$(VSInstallDir)Common7\\\\tools;$(VSInstallDir)Common7\\\\ide;$(ProgramFiles)\\\\HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);')\nif cfg.imagepath then\n_p(2, '%s', cfg.imagepath)\nelse\n_p(2, '%s', prj.name)\nend\nif cfg.pullmappingfile ~= nil then\n_p(2,'%s', premake.esc(cfg.pullmappingfile))\nend\n_p(2, '*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb')\n_p(2, 'true')\nend\nif cfg.kind ~= \"StaticLib\" then\n_p(2,'%s', tostring(premake.config.isincrementallink(cfg)))\nend\nif cfg.applicationdatadir ~= nil then\n_p(2,'%s', premake.esc(cfg.applicationdatadir))\nend\nif cfg.flags.NoManifest then\n_p(2,'false')\nend\n_p(1,'')\nend\nend\nlocal function runtime(cfg)\nlocal runtime\nlocal flags = cfg.flags\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'Use')\n_p(3,'%s', cfg.pchheader)\nelse\n_p(3,'')\nend\nend\nlocal function preprocessor(indent,cfg,escape)\nif #cfg.defines > 0 then\nlocal defines = table.concat(cfg.defines, \";\")\nif escape then\ndefines = defines:gsub('\"', '\\\\\"')\nend\nlocal isPreprocessorDef" + "initionPresent = string.find(defines, \"%%%(PreprocessorDefinitions%)\")\nif isPreprocessorDefinitionPresent then\n_p(indent,'%s'\n,premake.esc(defines))\nelse\n_p(indent,'%s;%%(PreprocessorDefinitions)'\n,premake.esc(defines))\nend\nelse\n_p(indent,'')\nend\nend\nlocal function include_dirs(indent,cfg)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs> 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\')))\nend\nend\nlocal function using_dirs(indent,cfg)\nif #cfg.usingdirs > 0 then\n_p(indent,'%s;%%(AdditionalUsingDirectories)'\n,premake.esc(path.translate(table.concat(cfg.usingdirs, \";\"), '\\\\')))\nend\nend" + "\nlocal function resource_compile(cfg)\n_p(2,'')\npreprocessor(3,cfg,true)\ninclude_dirs(3,cfg)\n_p(2,'')\nend\nlocal function cppstandard_vs2017_or_2019(cfg)\nif cfg.flags.CppLatest then\n_p(3, 'stdcpplatest')\n_p(3, 'true')\nelseif cfg.flags.Cpp17 then\n_p(3, 'stdcpp17')\nelseif cfg.flags.Cpp14 then\n_p(3, 'stdcpp14')\nend\nend\nlocal function exceptions(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nend\nelse\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nelseif cfg.flags.SEH then\n_p(3, 'Async')\nend\nend\nend\nlocal function rtti(cfg)\nif c" + "fg.flags.NoRTTI and not cfg.flags.Managed then\n_p(3,'false')\nend\nend\nlocal function calling_convention(cfg)\nif cfg.flags.FastCall then\n_p(3,'FastCall')\nelseif cfg.flags.StdCall then\n_p(3,'StdCall')\nend\nend\nlocal function wchar_t_builtin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'true')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'false')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3, 'StreamingSIMDExtensions')\nelseif cfg.flags.EnableSSE2 then\n_p(3, 'StreamingSIMDExtensions2')\nelseif cfg.flags.EnableAVX then\n_p(3, 'AdvancedVectorExtensions')\nelseif cfg.flags.EnableAVX2 then" + "\n_p(3, 'AdvancedVectorExtensions2')\nend\nend\nlocal function floating_point(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.FloatFast then\n_p(3,'true')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nelse\nif cfg.flags.FloatFast then\n_p(3,'Fast')\nelseif cfg.flags.FloatStrict and not cfg.flags.Managed then\n_p(3,'Strict')\nend\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif cfg.flags.C7DebugInfo then\ndebug_info = \"OldStyle\"\nelseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \"x64\")\nor not premake.config.iseditandcontinue(cfg)\nthen\ndebug_info = \"ProgramDatabase\"\nelse\ndebug_info = \"EditAndContinue\"\nend\nend\n_p(3,'%s',debug_info)\nend\nlocal function minimal_build(cfg)\nif premake.config.isdebugbuild(" + "cfg) and cfg.flags.EnableMinimalRebuild then\n_p(3,'true')\nelse\n_p(3,'false')\nend\nend\nlocal function compile_language(cfg)\nif cfg.options.ForceCPP then\n_p(3,'CompileAsCpp')\nelse\nif cfg.language == \"C\" then\n_p(3,'CompileAsC')\nend\nend\nend\nlocal function forcedinclude_files(indent,cfg)\nif #cfg.forcedincludes > 0 then\n_p(indent,'%s'\n,premake.esc(path.translate(table.concat(cfg.forcedincludes, \";\"), '\\\\')))\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'')\nlocal unsignedChar = \"/J \"\nlocal buildoptions = cfg.buildoptions\nif cfg.platform == \"Orbis\" then\nunsignedChar = \"-funsigned-char \";\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.language == \"C\" and not cfg.options.ForceCPP then\nbuildoptions = table.join(buildoptions, cfg.buildoptions_c)\nelse\n" + "buildoptions = table.join(buildoptions, cfg.buildoptions_cpp)\nend\n_p(3,'%s %s%%(AdditionalOptions)'\n, table.concat(premake.esc(buildoptions), \" \")\n, iif(cfg.flags.UnsignedChar and cfg.platform ~= \"TegraAndroid\", unsignedChar, \" \")\n)\nif cfg.platform == \"TegraAndroid\" then\n_p(3,'%s', tostring(cfg.flags.UnsignedChar == nil))\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nif cfg.androidcppstandard then\n_p(3,'%s', cfg.androidcppstandard)\nend\nend\nif cfg.platform == \"Orbis\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'Level0')\nelseif opt == \"MinSpace\" then\n_p(3,'Levelz') -- Oz is more aggressive than Os\nelseif opt == \"MaxSpeed\" then\n_p(3,'Level3')\nelse\n_p(3,'Level2')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'O0')\nelseif opt == \"MinSpace\" then\n_p(3,'Os')\nelseif opt == \"MaxSpeed\" then\n_p(3,'O3')\nelse\n_p(3,'O2')\nend\nelse\n_p(3,'%s', optimisation(cfg))\nend\ninclude_dirs(3, cfg)\nusing_dirs(3, cfg)\npreprocessor(3, cfg)\nminimal_build(cfg)\nif premake.config.isoptimizedbuild(cfg.flags) then\nif cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then\n_p(3, 'false')\n_p(3, 'false')\nelse\n_p(3, 'true')\n_p(3, 'true')\nend\nelse\n_p(3, 'true')\nif cfg.flags.NoRuntimeChecks then\n_p(3, 'Default')\nelseif not cfg.flags.Managed then\n_p(3, 'EnableFastChecks')\nend\nif cfg.flags.ExtraWarnings then\nend\nend\nif cfg.platform == \"Durango\" or cfg.flags.NoWinRT then\n_p(3, 'false')\nend\n_p(3, '%s', runtime(cfg))\nif cfg.flags.NoBufferSecurityCheck then\n_p(3, 'false')\nend\nif not cfg.flags.NoMultiProcessorCompilation and not cfg.flags.EnableMinimalRebuild then\n_p(3, 'true')\nelse\n_p(3, 'false')\nend\nprecompiled_header(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.PedanticWarnings then\n_p(3, 'MoreWarnings')\n_p(3, 'true')\nelseif cfg.flags.ExtraWarnings then\n_p(3, 'NormalWarnings')\n_p(3, 'true')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'WarningsOff')\n_p(3, 'false')\nelse\n_p(3, 'NormalWarnings')\n_p(3, 'false')\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\n_p(3, 'AllWarnings')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'DisableAllWarnings')\nelse\n_p(3, 'NormalWarnings')\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nelse\nif cfg.flags.PedanticWarnings then\n_p(3, 'EnableAllWarnings')\nelseif cfg.flags.ExtraWarnings then\n_p(3, 'Level4')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'Level1')\nelse\n_p(3 ,'Level3')\nend\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nif premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\") then\ncppstandard_vs2017_or_2019(cfg)\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif _ACTION:sub(3) == \"llvm\" then\n_p(3,'false')\nend\nif cfg.flags.Symbols then\nif cfg.kind == \"StaticLib\" then\n_p(3, '$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nelse\n_p(3, '$(IntDir)%s.compile.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, 'true')\nend\nif cfg.flags.NoFramePointer then\n_p(3, 'true')" + "\nend\nif cfg.flags.UseFullPaths then\n_p(3, 'true')\nend\nif cfg.flags.NoJMC then\n_p(3,'false' )\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\nif vstudio.diagformat then\n_p(3, '%s', vstudio.diagformat)\nelse\n_p(3, 'Caret')\nend\n_p(2,'')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'%s', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(prj, cfg)\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\nif _ACTION:sub(3) == \"llvm\" and prj.name == \"portaudio\" then -- MSVC-LLVM needs special help\n_p(2,'ksuser.lib;%%(AdditionalDependencies)')\nend\n_p(1,'')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linkt" + "arget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function hasmasmfiles(prj)\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nreturn #files > 0\nend\nlocal function ismanagedprj(prj, cfgname, pltname)\nlocal cfg = premake.getconfig(prj, cfgname, pltname)\nreturn cfg.flags.Managed == true\nend\nlocal function getcfglinks(cfg)\nlocal haswholearchive = #cfg.wholearchive > 0\nlocal msvcnaming = premake.getnamestyle(cfg) == \"windows\"\nlocal iscppprj = premake.iscppproject(cfg)\nlocal isnetprj = premake.isdotnetproject(cfg)\nlocal linkobjs = {}\nlocal links = iif(haswholearchive\n, premake.getlinks(cfg, \"all\", \"object\")\n, premake.getlinks(cfg, \"system\", \"fullpath\")\n)\nfor _, link in ipairs(links) do\nlocal name = nil\nlocal directory = nil\nlocal whole = nil\nif type(link) == \"table\" then\nif not ismanagedprj(link.project, cfg.name, cfg.platform) then\n" + "name = link.linktarget.basename\ndirectory = path.rebase(link.linktarget.directory, link.location, cfg.location)\nwhole = table.icontains(cfg.wholearchive, link.project.name)\nend\nelse\nname = link\nwhole = table.icontains(cfg.wholearchive, link)\nend\nif name then\nif haswholearchive and msvcnaming then\nif iscppprj then\nname = name .. \".lib\"\nelseif isnetprj then\nname = name .. \".dll\"\nend\nend\ntable.insert(linkobjs, {name=name, directory=directory, wholearchive=whole})\nend\nend\nreturn linkobjs\nend\nlocal function vs10_masm(prj, cfg)\nif hasmasmfiles(prj) then\n_p(2, '')\n_p(3,'%s %%(AdditionalOptions)'\n, table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \")\n)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs > 0 then\n_p(3, '%s;%%(IncludePaths)'\n, premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\'" + "))\n)\nend\nlocal defines = table.join(cfg.defines)\ntable.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \"_DEBUG\", {}))\ntable.insert(defines, iif(cfg.platform == \"x64\", \"_WIN64\", \"_WIN32\"))\ntable.insert(defines, iif(prj.kind == \"SharedLib\", \"_EXPORT=EXPORT\", \"_EXPORT=\"))\n_p(3, '%s;%%(PreprocessorDefinitions)'\n, premake.esc(table.concat(defines, \";\"))\n)\nif cfg.flags.FatalWarnings then\n_p(3,'true')\nend\nif cfg.flags.MinimumWarnings then\n_p(3,'0')\nelse\n_p(3,'3')\nend\n_p(2, '')\nend\nend\nlocal function additional_manifest(cfg)\nif(cfg.dpiawareness ~= nil) then\n_p(2,'')\nif(cfg.dpiawareness == \"None\") then\n_p(3, 'false')\nend\nif(cfg.dpiawareness == \"High\") then\n_p(3, 'true')\nend\nif(cfg.dpiawareness == \"HighPerMoni" + "tor\") then\n_p(3, 'PerMonitorHighDPIAware')\nend\n_p(2,'')\nend\nend\nfunction vc2010.link(cfg)\nlocal vs2017OrLater = premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\")\nlocal vsllvm = premake.action.current() == premake.action.get(\"vsllvm\")\nlocal links = getcfglinks(cfg)\n_p(2,'')\n_p(3,'%s', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\nif (vs2017OrLater or vsllvm) and cfg.flags.FullSymbols then\n_p(3,'DebugFull')\nelse\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.flags.Symbols then\n_p(3, '$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nif premake.config.islinkeroptimizedbuild(cfg.flags) then\nif cfg.platform == \"Orbis\" then\n_p(3,'Stri" + "pFuncsAndData')\n_p(3,'true')\nelse\n_p(3,'true')\n_p(3,'true')\nend\nelseif cfg.platform == \"Orbis\" and premake.config.iseditandcontinue(cfg) then\n_p(3,'true')\nend\nif cfg.finalizemetasource ~= nil then\n_p(3,'%s', premake.esc(cfg.finalizemetasource))\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(3, cfg, links)\nvc2010.additionalLibraryDirectories(3, cfg, links)\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'wmainCRTStartup')\nelse\n_p(3,'mainCRTStartup')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile t" + "hen\n_p(3,'%s', deffile)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nif cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n_p(3,'false' )\nend\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidlinker then\n_p(3,'%s',cfg.androidlinker)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, 'Enabled')\nend\nif cfg.flags.GenerateMapFiles then\n_p(3, 'true')\nend\n_p(2,'')\nif #cfg.wholearchive > 0 then\n_p(2, '')\n_p(3, 'false')\n_p(2, '')\nend\nend\nfunction vc2010.additionalLibraryDirectories(tab, cfg, links)\nlocal dirs = cfg.libdirs\nfor _, link in ipairs(links) do\nif link.directory and not table.icontains(dirs, link.directory) then\ntable.insert(dirs, link.directo" + "ry)\nend\nend\n_p(tab, '%s;%%(AdditionalLibraryDirectories)'\n, premake.esc(path.translate(table.concat(dirs, ';'), '\\\\'))\n)\nend\nfunction vc2010.additionalDependencies(tab, cfg, links)\nif #links > 0 then\nlocal deps = \"\"\nif cfg.platform == \"Orbis\" then\nlocal iswhole = false\nfor _, link in ipairs(links) do\nif link.wholearchive and not iswhole then\ndeps = deps .. \"--whole-archive;\"\niswhole = true\nelseif not link.wholearchive and iswhole then\ndeps = deps .. \"--no-whole-archive;\"\niswhole = false\nend\ndeps = deps .. \"-l\" .. link.name .. \";\"\nend\nelse\nfor _, link in ipairs(links) do\nif link.wholearchive then\ndeps = deps .. \"/WHOLEARCHIVE:\" .. link.name .. \";\"\nelse\ndeps = deps .. link.name .. \";\"\nend\nend\nend\nif cfg.platform == \"TegraAndroid\" then\ndeps = \"-Wl,--start-group;\" .. deps .. \";-Wl,--end-group\"\nend\n_p(tab, '%s;%s'\n, deps\n, iif(cfg.platform == \"D" + "urango\"\n, '%(XboxExtensionsDependencies)'\n, '%(AdditionalDependencies)'\n)\n)\nelseif cfg.platform == \"Durango\" then\n_p(tab, '%%(XboxExtensionsDependencies)')\nend\nend\nfunction ant_build(prj, cfg)\nif cfg.platform == \"TegraAndroid\" then\nlocal files = vc2010.getfilegroup(prj, \"AndroidBuild\")\n_p(2,'')\nif #files > 0 then\n_p(3,'%s',path.translate(files[1].name))\nend\nlocal isdebugbuild = premake.config.isdebugbuild(cfg)\n_p(3,'%s',iif(isdebugbuild, 'Debug','Release'))\n_p(3,'%s',tostring(cfg.flags.AntBuildDebuggable ~= nil))\nif #cfg.antbuildjavasourcedirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjavasourcedirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildjardirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjardirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildja" + "rdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildjardependencies,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildnativelibdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildnativelibdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdependencies,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildassetsdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildassetsdirs,\";\")\n_p(3,'%s',dirs)\nend\n_p(2,'')\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(prj, cfg)\nvc2010." + "link(cfg)\nant_build(prj, cfg)\nevent_hooks(cfg)\nvs10_masm(prj, cfg)\nadditional_manifest(cfg)\n_p(1,'')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nMASM = {},\nObject = {},\nNone = {},\nResourceCompile = {},\nAppxManifest = {},\nAndroidBuild = {},\nNatvis = {},\nImage = {},\nDeploymentContent = {}\n}\nlocal foundAppxManifest = false\nfor file in premake.project.eachfile(prj, true) do\nif path.issourcefilevs(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not table.icontains(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isobjectfile(file.name) then\ntable.insert(sortedfiles.Object, file)\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelseif path.isimagefile(file.name) then\ntable.insert(sortedfiles.Image, file)\nelseif" + " path.isappxmanifest(file.name) then\nfoundAppxManifest = true\ntable.insert(sortedfiles.AppxManifest, file)\nelseif path.isandroidbuildfile(file.name) then\ntable.insert(sortedfiles.AndroidBuild, file)\nelseif path.isnatvis(file.name) then\ntable.insert(sortedfiles.Natvis, file)\nelseif path.isasmfile(file.name) then\ntable.insert(sortedfiles.MASM, file)\nelseif file.flags and table.icontains(file.flags, \"DeploymentContent\") then\ntable.insert(sortedfiles.DeploymentContent, file)\nelse\ntable.insert(sortedfiles.None, file)\nend\nend\nif vstudio.iswinrt() and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \"/Package.appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nlocal logo = {}\nlogo.name = prj.name .. \"/Logo.png\"\nlogo.vpath = logo.name\ntable.insert(sortedfiles.Image, logo)\nlocal smallLogo = {}\nsmallLogo.name = prj.name .. \"/SmallLogo.png\"\nsma" + "llLogo.vpath = smallLogo.name\ntable.insert(sortedfiles.Image, smallLogo)\nlocal storeLogo = {}\nstoreLogo.name = prj.name .. \"/StoreLogo.png\"\nstoreLogo.vpath = storeLogo.name\ntable.insert(sortedfiles.Image, storeLogo)\nlocal splashScreen = {}\nsplashScreen.name = prj.name .. \"/SplashScreen.png\"\nsplashScreen.vpath = splashScreen.name\ntable.insert(sortedfiles.Image, splashScreen)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"Object\")\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.customtaskgroup(prj)\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\nvc2010.simplefilesgroup(prj, \"AppxManifest\")\nvc2010.simplefilesgroup(prj, \"AndroidBuild\")\nvc2010.simplefilesgroup(prj, \"Natvis\")\nvc2010.deploymentcontentgroup(prj, \"Image\")\nvc2010.deploymentcontentgroup(prj, \"DeploymentContent\", \"None\")\nend\nfunction vc2010.customtaskg" + "roup(prj)\nlocal files = { }\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal fcfg = { }\nfcfg.name = path.getrelative(prj.location,buildtask[1])\nfcfg.vpath = path.trimdots(fcfg.name)\ntable.insert(files, fcfg)\nend\nend\nif #files > 0 then\n_p(1,'')\nlocal groupedBuildTasks = {}\nlocal buildTaskNames = {}\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nif (groupedBuildTasks[buildtask[1]] == nil) then\ngroupedBuildTasks[buildtask[1]] = {}\ntable.insert(buildTaskNames, buildtask[1])\nend\ntable.insert(groupedBuildTasks[buildtask[1]], buildtask)\nend\nend\nfor _, name in ipairs(buildTaskNames) do\ncustombuildtask = groupedBuildTasks[name]\n_p(2,'', path.translate(path.getrelative(prj.location,name), \"\\\\\"))\n_p(3,'Text')\nlocal cmd = \"\"\nlocal outputs = \"\"\nfor _, buildtask in ipairs(custombuildt" + "ask or {}) do\nfor _, cmdline in ipairs(buildtask[4] or {}) do\ncmd = cmd .. cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[1])))\ncmd = string.gsub(cmd, \"%$%(@%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[2])))\ncmd = cmd .. \"\\r\\n\"\nend\noutputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \";\"\nend\n_p(3,'%s',cmd)\n_p(3,'%s%%(Outputs)',outputs)\n_p(3,'Designer')\n_p(3,'')\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfg" + "info in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'')\nfor _, file in ipairs(files) do\nlocal prjexcluded = table.icontains(prj.excludes, file.name)\nlocal excludedcfgs = {}\nif not prjexcluded then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif not fileincfg or cfgexcluded then\ntable.insert(excludedcfgs, vsconfig.name)\nend\nend\nend\nif subtype or prjexcluded or #excludedcfgs > 0 then\n_p(2, '<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\nif prjexcluded then\n_p(3, 'true')\nelse\nfor _, cfgname in ipairs(excludedcfgs) do\n_p(3, 'true'\n, premake.esc(cfgname)\n)\nend\nend\nif subtype then\n_p(3, '%s', subtype)\nend\n_p(2,'', section)\nelse\n_p(2, '<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'')\nend\nend\nfunction vc2010.deploymentcontentgroup(prj, section, filetype)\nif filetype == nil then\nfiletype = section\nend\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'')\nfor _, file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\">', filetype, path.translate(file.name, \"\\\\\"))\n_p(3,'true')\n_p(3,'%s', path.translate(file.vpath, \"\\\\\"))\n_p(2,'', filetype)\nend\n_p(1,'')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cf" + "ginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'')\nlocal existingBasenames = {};\nfor _, file in ipairs(files) do\nlocal filename = string.lower(path.getbasename(file.name))\nlocal disambiguation = existingBasenames[filename] or 0;\nexistingBasenames[filename] = disambiguation + 1\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal namestyle = premake.getnamestyle(cfg)\nif namestyle == \"TegraAndroid\" or namestyle == \"NX\" then\n_p(3, '$(IntDir)%s.o', premake.esc(vsconfig.name), premake.esc(path.translate(path.trimdots(path.removeext(f" + "ile.name)))) )\nelse\nif disambiguation > 0 then\n_p(3, '$(IntDir)%s\\\\', premake.esc(vsconfig.name), tostring(disambiguation))\nend\nend\nend\nif path.iscxfile(file.name) then\n_p(3, 'true')\n_p(3, 'true')\n_p(3, 'NotUsing')\nend\nif vstudio.iswinrt() and string.len(file.name) > 2 and string.sub(file.name, -2) == \".c\" then\n_p(3,'FALSE')\nend\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'Create', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nlocal nopch = table.icontains(prj.nopch, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig." + "src_platform)\nif nopch or table.icontains(cfg.nopch, file.name) then\n_p(3,'NotUsing', premake.esc(vsconfig.name))\nend\nend\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, 'true'\n, premake.esc(vsconfig.name)\n)\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal prjforcenative = table.icontains(prj.forcenative, file.name)\nfor _,vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif prjforcenative or table.icontains(cfg.forcenative, file.name) then\n_p(3, 'false', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.masmfiles(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nif #files > 0 then\n_p(1, '')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, 'true'\n, premake.esc(vsconfig.name)\n)\nend\nend\n_p(2, '')\nend\n_p(1, '')\nend\nend\nfunction vc2010.header(target" + "s)\nio.eol = \"\\r\\n\"\n_p('')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('', t, action.vstudio.toolsVersion)\nend\nfunction premake.vs2010_vcxproj(prj)\nlocal usemasm = hasmasmfiles(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'')\n_p(1,'')\nif usemasm then\n_p(2, '')\nend\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.clrReferences(prj)\nvc2010.projectReferences(prj)\nvc2010.sdkReferences(prj)\nvc2010.masmfiles(prj)\n_p(1,'')\n_p(1,'')\nif usemasm then\n_p(2, '')\nend\n_p(1,'')\n_p('')\nend\nfunction vc2010.clrReferences(prj)\nif #prj.clrreferences == 0 then\nreturn\nend\n_p(1,'')\nfor _, ref in ipairs(prj.clrreferences) do\nif os.isfile(ref) then\nlocal assembly = path.getbasename(ref)\n_p(2,'', assembly)\n_p(3,'%s', path.getrelative(prj.location, ref))\n_p(2,'')\nelse\n_p(2,'', ref)\nend\nend\n_p(1,'')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps == 0 and " + "#prj.vsimportreferences == 0 then\nreturn\nend\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\ntable.sort(table.join(prj.vsimportreferences), compareuuid)\n_p(1,'')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'', path.translate(deppath, \"\\\\\"))\n_p(3,'{%s}', dep.uuid)\nif vstudio.iswinrt() then\n_p(3,'false')\nend\n_p(2,'')\nend\nfor _, ref in ipairs(prj.vsimportreferences) do\nlocal slnrelpath = path.rebase(ref, prj.location, sln.location)\nlocal iprj = premake.vstudio.getimportprj(slnrelpath, prj.solution)\n_p(2,'', ref)\n_p(3,'{%s}', iprj.uuid)\n_p(2,'')\nend\n_p(1,'')\nend\nfunction vc2010.sdkReferences(prj)\nlocal refs = prj.sdkreferences\nif #refs > 0 then\n_p(1,'')\nfor _, ref in ipairs(refs) do\n_p(2,'', ref)\nend\n_p(1,'')\nend\nend\nfunction vc2010.debugdir(cfg)\nlocal isnx = (cfg.platform == \"NX32\" or cfg.platform == \"NX64\")\nlocal debuggerFlavor =\n iif(isnx, 'OasisNXDebugger'\n, iif(cfg.platform == \"Orbis\", 'ORBISDebugger'\n, iif(cfg.platform == \"Durango\", 'XboxOneVCppDebugger'\n, iif(cfg.platform == \"TegraAndroid\", 'AndroidDebugger'\n, iif(vstudio.iswinrt(), 'AppHostLocalDebugger'\n, 'WindowsLocalDebugger'\n)))))\n_p(2, '%s', debuggerFlavor)\nif cfg.debugdir and not vstudio.iswinrt() then\n_p(2, '%s'\n, path.translate(cfg.debugdir, '\\\\')\n)\nend\nif cfg.debugcmd then\n_p(2, '%s', cfg.debugcmd)\nend\nif cfg.debugargs then\n_p(2, '%s'\n, table.concat(cfg.debugargs, \" \")\n)\nend\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2, '%s%s'\n, table.concat(cfg.debugenvs, \"\\n\")\n, iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)', '')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2, 'false')\nend\nend\nif cfg.deploymode then\n_p(2, '%s', cfg.deploymode)\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androiddebugintentparams then\n_p(2, '%s'\n, table.concat(cfg.androiddebugintentparams, \" \")\n)\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' ', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\n_p" + "(' ')\nend\n_p('')\nend\nlocal png1x1data = {\n0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR\n0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V\n0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- .....PLTE....z=.\n0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f...\n0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`.......\n0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`.\n}\nfunction png1x1(obj, filename)\nfilename = premake.project.getfilename(obj, filename)\nlocal f, err = io.open(filename, \"wb\")\nif f then\nfor _, byte in ipairs(png1x1data) do\nf:write(string.char(byte))\nend\nf:close()\nend\nend\nfunction premak" + "e.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('')\nif vstudio.storeapp == \"10.0\" then\n_p('')\nelseif vstudio.storeapp == \"durango\" then\n_p('')\nend\n_p(1, '')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '')\nend\n_p(1, '')\n_p(2, '' .. prj.name .. '')\n_p(2, 'PublisherDisplayName')\n_p(2, '' .. prj.name .. '\\\\StoreLogo.png')\npng1x1(prj, \"%%/StoreLogo.png\")\n_p(2, '' .. prj.name .. '')\n_p(1,'')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '')\n_p(2, '')\n_p(1, '')\nelseif vstudio.storeapp == \"durango\" then\n_p(1, '')\n_p(2, '6.2')\n_p(2, '6.2')\n_p(1, '')\nend\n_p(1, '')\n_p(2, '')\n_p(1, '')\n_p(1, '')\n_p(2, '')\nif vstudio.storeapp == \"10.0\" then\n_p(3, '')\n_p(4, '')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '')\nelseif vstudio.storeapp == \"durango\" then\n_p(3, '')\n_p(5, '')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '')\n_p(3, '')\n_p(4, '')\n_p(4, '')\n_p(4, '')\n_p(3, '')\nend\n_p(2, '')\n_p(1, '')\n_p('')\nend\n", /* actions/vstudio/vstudio_vcxproj_filters.lua */ "local vc2010 = premake.vstudio.vc2010\nlocal project = premake.project\nfunction vc2010.filteridgroup(prj)\nlocal filters = { }\nlocal filterfound = false\nfor file in premake.project.eachfile(prj, true) do\nlocal folders = string.explode(file.vpath, \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilters[path] = true\n_p(2, '', path)\n_p(3, '{%s}', os.uuid(path))\n_p(2, '')\nend\npath = path .. \"\\\\\"\nend\nend\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal folders = string.explode(path.trimdots(path.getrelative(prj.location,buildtask[1])), \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilt" @@ -474,30 +474,31 @@ const char* builtin_scripts[] = { "premake.ninja = { }\nlocal p = premake\nnewaction\n{\ntrigger = \"ninja\",\nshortname = \"ninja\",\ndescription = \"Generate Ninja build files\",\nmodule = \"ninja\",\nvalid_kinds = {\"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\"},\nvalid_languages = {\"C\", \"C++\", \"Swift\"},\nvalid_tools = {\ncc = { \"gcc\" },\nswift = { \"swift\" },\n},\nonsolution = function(sln)\nio.eol = \"\\r\\n\"\nio.indent = \"\\t\"\nio.escaper(p.ninja.esc)\np.generate(sln, \"Makefile\", p.ninja.generate_solution)\nio.indent = \" \"\np.ninja.generate_ninja_builds(sln)\nend,\nonproject = function(prj)\nio.eol = \"\\r\\n\"\nio.indent = \" \"\nio.escaper(p.ninja.esc)\np.ninja.generate_project(prj)\nend,\noncleansolution = function(sln)\nfor _,name in ipairs(sln.configurations) do\npremake.clean.file(sln, p.ninja.get_solution_name(sln, name))\nend\nend,\noncleanproject = function(prj)\nend,\noncleantarget = function(prj)\nend,\n}\n", /* actions/ninja/ninja_base.lua */ - "local ninja = premake.ninja\nfunction ninja.esc(value)\nvalue = value:gsub(\"%$\", \"$$\") -- TODO maybe there is better way\nvalue = value:gsub(\":\", \"$:\")\nvalue = value:gsub(\"\\n\", \"$\\n\")\nvalue = value:gsub(\" \", \"$ \")\nreturn value\nend\nfunction ninja.shesc(value)\nif type(value) == \"table\" then\nlocal result = {}\nlocal n = #value\nfor i = 1, n do\ntable.insert(result, ninja.shesc(value[i]))\nend\nreturn result\nend\nif value:find(\" \") then\nreturn \"\\\"\" .. value .. \"\\\"\"\nend\nreturn value\nend\nfunction ninja.list(value)\nif #value > 0 then\nreturn \" \" .. table.concat(value, \" \")\nelse\nreturn \"\"\nend\nend\nfunction ninja.arglist(arg, value)\nif #value > 0 then\nlocal args = {}\nfor _, val in ipairs(value) do\ntable.insert(args, string.format(\"%s %s\", arg, val))\nend\nreturn table.concat(args, \" \")\nelse\nreturn \"\"\nend\nend\nfunction ninja.generate_project(prj)\nif prj.language == \"Swift\" then\nninja.generate_swift(prj)\nelse\nninja.generate_cpp(prj)\nend\nend\nloca" - "l function innerget(self, key)\nreturn rawget(getmetatable(self), key) or self.__inner[key]\nend\nlocal prj_proxy = { __index = innerget }\nlocal cfg_proxy = { __index = innerget }\nfunction new_prj_proxy(prj)\nprj = prj.project or prj\nlocal v = { __inner = prj }\nlocal __configs = {}\nfor key, cfg in pairs(prj.__configs) do\nif key ~= \"\" then\n__configs[key] = ninja.get_proxy(\"cfg\", cfg)\nelse\n__configs[key] = cfg\nend\nend\nv.__configs = __configs\nreturn setmetatable(v, prj_proxy)\nend\nlocal function rebasekeys(t, keys, old, new)\nfor _,key in ipairs(keys) do\nt[key] = path.rebase(t[key], old, new)\nend\nreturn t\nend\nlocal function rebasearray(t, old, new)\nlocal res = { }\nfor _,f in ipairs(t) do\ntable.insert(res, path.rebase(f, old, new))\nend\nreturn res\nend\nfunction new_cfg_proxy(cfg)\nlocal keys = { \"directory\", \"fullpath\", \"bundlepath\" }\nlocal old = cfg.location\nlocal new = path.join(cfg.location, cfg.shortname)\nlocal v = {\n__inner = cfg,\nlocation = new,\nobjectsdir = pa" - "th.rebase(cfg.objectsdir, old, new),\nbuildtarget = rebasekeys(table.deepcopy(cfg.buildtarget), keys, old, new),\nlinktarget = rebasekeys(table.deepcopy(cfg.linktarget), keys, old, new),\n}\nv.files = rebasearray(cfg.files, old, new)\nv.includedirs = rebasearray(cfg.includedirs, old, new)\nv.libdirs = rebasearray(cfg.libdirs, old, new)\nv.userincludedirs = rebasearray(cfg.userincludedirs, old, new)\nv.systemincludedirs = rebasearray(cfg.systemincludedirs, old, new)\nv.swiftmodulemaps = rebasearray(cfg.swiftmodulemaps, old, new)\nreturn setmetatable(v, cfg_proxy)\nend\nfunction cfg_proxy:getprojectfilename(fullpath)\nlocal name = self.project.name .. \".ninja\"\nif fullpath ~= nil then\nreturn path.join(self.location, name)\nend\nreturn name\nend\nfunction cfg_proxy:getoutputfilename()\nreturn path.join(self.buildtarget.directory, self.buildtarget.name)\nend\nlocal proxy_cache = { \nprj = { new = new_prj_proxy }, \ncfg = { new = new_cfg_proxy },\n}\nfunction get_proxy(cache, obj)\ni" - "f not cache[obj] then\ncache[obj] = cache.new(obj)\nend\nreturn cache[obj]\nend\nfunction ninja.get_proxy(typ, obj)\nif not proxy_cache[typ] then\nerror(\"invalid proxy type\")\nend\nreturn get_proxy(proxy_cache[typ], obj)\nend\n", + "local ninja = premake.ninja\nfunction ninja.esc(value)\nif value then\nvalue = string.gsub(value, \"%$\", \"$$\") -- TODO maybe there is better way\nvalue = string.gsub(value, \":\", \"$:\")\nvalue = string.gsub(value, \"\\n\", \"$\\n\")\nvalue = string.gsub(value, \" \", \"$ \")\nend\nreturn value\nend\nfunction ninja.shesc(value)\nif type(value) == \"table\" then\nlocal result = {}\nlocal n = #value\nfor i = 1, n do\ntable.insert(result, ninja.shesc(value[i]))\nend\nreturn result\nend\nif value:find(\" \") then\nreturn \"\\\"\" .. value .. \"\\\"\"\nend\nreturn value\nend\nfunction ninja.list(value)\nif #value > 0 then\nreturn \" \" .. table.concat(value, \" \")\nelse\nreturn \"\"\nend\nend\nfunction ninja.arglist(arg, value)\nif #value > 0 then\nlocal args = {}\nfor _, val in ipairs(value) do\ntable.insert(args, string.format(\"%s %s\", arg, val))\nend\nreturn table.concat(args, \" \")\nelse\nreturn \"\"\nend\nend\nfunction ninja.generate_project(prj)\nif prj.language == \"Swift\" then\nninja.generate_swift" + "(prj)\nelse\nninja.generate_cpp(prj)\nend\nend\nlocal function innerget(self, key)\nreturn rawget(getmetatable(self), key) or self.__inner[key]\nend\nlocal prj_proxy = { __index = innerget }\nlocal cfg_proxy = { __index = innerget }\nfunction new_prj_proxy(prj)\nprj = prj.project or prj\nlocal v = { __inner = prj }\nlocal __configs = {}\nfor key, cfg in pairs(prj.__configs) do\nif key ~= \"\" then\n__configs[key] = ninja.get_proxy(\"cfg\", cfg)\nelse\n__configs[key] = cfg\nend\nend\nv.__configs = __configs\nreturn setmetatable(v, prj_proxy)\nend\nlocal function rebasekeys(t, keys, old, new)\nfor _,key in ipairs(keys) do\nt[key] = path.rebase(t[key], old, new)\nend\nreturn t\nend\nlocal function rebasearray(t, old, new)\nlocal res = { }\nfor _,f in ipairs(t) do\ntable.insert(res, path.rebase(f, old, new))\nend\nreturn res\nend\nfunction new_cfg_proxy(cfg)\nlocal keys = { \"directory\", \"fullpath\", \"bundlepath\" }\nlocal old = cfg.location\nlocal new = path.join(cfg.location, cfg.shortname)\nlocal v = {\n__in" + "ner = cfg,\nlocation = new,\nobjectsdir = path.rebase(cfg.objectsdir, old, new),\nbuildtarget = rebasekeys(table.deepcopy(cfg.buildtarget), keys, old, new),\nlinktarget = rebasekeys(table.deepcopy(cfg.linktarget), keys, old, new),\n}\nv.files = rebasearray(cfg.files, old, new)\nv.includedirs = rebasearray(cfg.includedirs, old, new)\nv.libdirs = rebasearray(cfg.libdirs, old, new)\nv.userincludedirs = rebasearray(cfg.userincludedirs, old, new)\nv.systemincludedirs = rebasearray(cfg.systemincludedirs, old, new)\nv.swiftmodulemaps = rebasearray(cfg.swiftmodulemaps, old, new)\nreturn setmetatable(v, cfg_proxy)\nend\nfunction cfg_proxy:getprojectfilename(fullpath)\nlocal name = self.project.name .. \".ninja\"\nif fullpath ~= nil then\nreturn path.join(self.location, name)\nend\nreturn name\nend\nfunction cfg_proxy:getoutputfilename()\nreturn path.join(self.buildtarget.directory, self.buildtarget.name)\nend\nlocal proxy_cache = { \nprj = { new = new_prj_proxy }, \ncfg = { new = ne" + "w_cfg_proxy },\n}\nfunction get_proxy(cache, obj)\nif not cache[obj] then\ncache[obj] = cache.new(obj)\nend\nreturn cache[obj]\nend\nfunction ninja.get_proxy(typ, obj)\nif not proxy_cache[typ] then\nerror(\"invalid proxy type\")\nend\nreturn get_proxy(proxy_cache[typ], obj)\nend\n", /* actions/ninja/ninja_solution.lua */ "local ninja = premake.ninja\nlocal p = premake\nlocal solution = p.solution\nfunction ninja.generate_solution(sln)\nlocal cc = premake[_OPTIONS.cc]\nlocal platforms = premake.filterplatforms(sln, cc.platforms, \"Native\")\n_p('# %s solution makefile autogenerated by GENie', premake.action.current().shortname)\n_p('# Type \"make help\" for usage help')\n_p('')\n_p('NINJA=ninja')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(sln.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\nlocal projects = table.extract(sln.projects, \"name\")\ntable.sort(projects)\n_p('')\n_p('.PHONY: all clean help $(PROJECTS)')\n_p('')\n_p('all:')\nif (not sln.messageskip) or (not table.contains(sln.messageskip, \"SkipBuildingMessage\")) then\n_p(1, '@echo \"==== Building all ($(config)) ====\"')\nend\n_p(1, '@${NINJA} -C ${config} all')\n_p('')\nfor _, prj in ipairs(sln.projects) do\nlocal prjx = ninja.get_proxy(\"prj\", prj)\n_p('%s:', _MAKE.esc(prj.name))\nif (not sln.messageskip) or (not table.c" "ontains(sln.messageskip, \"SkipBuildingMessage\")) then\n_p(1, '@echo \"==== Building %s ($(config)) ====\"', prj.name)\nend\n_p(1, '@${NINJA} -C ${config} %s', prj.name)\n_p('')\nend\n_p('clean:')\n_p(1, '@${NINJA} -C ${config} -t clean')\n_p('')\n_p('help:')\n_p(1,'@echo \"Usage: make [config=name] [target]\"')\n_p(1,'@echo \"\"')\n_p(1,'@echo \"CONFIGURATIONS:\"')\nlocal cfgpairs = { }\nfor _, platform in ipairs(platforms) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p(1,'@echo \" %s\"', premake.getconfigname(cfgname, platform, true))\nend\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"TARGETS:\"')\n_p(1,'@echo \" all (default)\"')\n_p(1,'@echo \" clean\"')\nfor _, prj in ipairs(sln.projects) do\n_p(1,'@echo \" %s\"', prj.name)\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"For more information, see https://github.com/bkaradzic/genie\"')\nend\nlocal generate\nlocal function getconfigs(sln, name, plat)\nlocal cfgs = {}\nfor prj in solution.eachproject(sln) do\nprj = ninja.get_proxy(\"prj\", prj)\nfor cfg " - "in p.eachconfig(prj, plat) do\nif cfg.name == name then\ntable.insert(cfgs, cfg)\nend\nend\nend\nreturn cfgs\nend\nfunction ninja.generate_ninja_builds(sln)\nlocal cc = premake[_OPTIONS.cc]\nsln.getlocation = function(cfg, plat)\nreturn path.join(sln.location, premake.getconfigname(cfg, plat, true))\nend\nlocal platforms = premake.filterplatforms(sln, cc.platforms, \"Native\")\nfor _,plat in ipairs(platforms) do\nfor _,name in ipairs(sln.configurations) do\np.generate(sln, ninja.get_solution_name(sln, name, plat), function(sln)\ngenerate(getconfigs(sln, name, plat))\nend)\nend\nend\nend\nfunction ninja.get_solution_name(sln, cfg, plat)\nreturn path.join(sln.getlocation(cfg, plat), \"build.ninja\")\nend\nfunction generate(prjcfgs)\nlocal cfgs = {}\nlocal cfg_first = nil\nlocal cfg_first_lib = nil\n_p(\"# solution build file\")\n_p(\"# generated with GENie ninja\")\n_p(\"\")\n_p(\"# build projects\")\nfor _,cfg in ipairs(prjcfgs) do\nlocal key = cfg.project.name\nif not cfgs[key] then cfgs[key] = " - "\"\" end\ncfgs[key] = cfg:getoutputfilename() .. \" \"\nif not cfgs[\"all\"] then cfgs[\"all\"] = \"\" end\ncfgs[\"all\"] = cfgs[\"all\"] .. cfg:getoutputfilename() .. \" \"\nif (cfg_first == nil) and (cfg.kind == \"ConsoleApp\" or cfg.kind == \"WindowedApp\") then\ncfg_first = key\nend\nif (cfg_first_lib == nil) and (cfg.kind == \"StaticLib\" or cfg.kind == \"SharedLib\") then\ncfg_first_lib = key\nend\n_p(\"subninja \" .. cfg:getprojectfilename())\nend\n_p(\"\")\n_p(\"# targets\")\nfor cfg, outputs in iter.sortByKeys(cfgs) do\n_p(\"build \" .. cfg .. \": phony \" .. outputs)\nend\n_p(\"\")\n_p(\"# default target\")\n_p(\"default \" .. (cfg_first or cfg_first_lib))\n_p(\"\")\nend\n", + "in p.eachconfig(prj, plat) do\nif cfg.name == name then\ntable.insert(cfgs, cfg)\nend\nend\nend\nreturn cfgs\nend\nfunction ninja.generate_ninja_builds(sln)\nlocal cc = premake[_OPTIONS.cc]\nsln.getlocation = function(cfg, plat)\nreturn path.join(sln.location, premake.getconfigname(cfg, plat, true))\nend\nlocal platforms = premake.filterplatforms(sln, cc.platforms, \"Native\")\nfor _,plat in ipairs(platforms) do\nfor _,name in ipairs(sln.configurations) do\np.generate(sln, ninja.get_solution_name(sln, name, plat), function(sln)\ngenerate(getconfigs(sln, name, plat))\nend)\nend\nend\nend\nfunction ninja.get_solution_name(sln, cfg, plat)\nreturn path.join(sln.getlocation(cfg, plat), \"build.ninja\")\nend\nfunction generate(prjcfgs)\nlocal cfgs = {}\nlocal cfg_start = nil\nlocal cfg_first = nil\nlocal cfg_first_lib = nil\n_p(\"# solution build file\")\n_p(\"# generated with GENie ninja\")\n_p(\"\")\n_p(\"# build projects\")\nfor _,cfg in ipairs(prjcfgs) do\nlocal key = cfg.project.name\nif not c" + "fgs[key] then cfgs[key] = \"\" end\ncfgs[key] = cfg:getoutputfilename() .. \" \"\nif not cfgs[\"all\"] then cfgs[\"all\"] = \"\" end\ncfgs[\"all\"] = cfgs[\"all\"] .. cfg:getoutputfilename() .. \" \"\nif (cfg_start == nil) and (cfg.solution.startproject == key) then\ncfg_start = key\nend\nif (cfg_first == nil) and (cfg.kind == \"ConsoleApp\" or cfg.kind == \"WindowedApp\") then\ncfg_first = key\nend\nif (cfg_first_lib == nil) and (cfg.kind == \"StaticLib\" or cfg.kind == \"SharedLib\") then\ncfg_first_lib = key\nend\n_p(\"subninja \" .. cfg:getprojectfilename())\nend\n_p(\"\")\n_p(\"# targets\")\nfor cfg, outputs in iter.sortByKeys(cfgs) do\n_p(\"build \" .. cfg .. \": phony \" .. outputs)\nend\n_p(\"\")\n_p(\"# default target\")\n_p(\"default \" .. (cfg_start or cfg_first or cfg_first_lib))\n_p(\"\")\nend\n", /* actions/ninja/ninja_cpp.lua */ "premake.ninja.cpp = { }\nlocal ninja = premake.ninja\nlocal cpp = premake.ninja.cpp\nlocal p = premake\nlocal function wrap_ninja_cmd(c)\nif os.is(\"windows\") then\nreturn 'cmd /c \"' .. c .. '\"'\nelse\nreturn c\nend\nend\nfunction ninja.generate_cpp(prj)\nlocal pxy = ninja.get_proxy(\"prj\", prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in p.eachconfig(pxy, platform) do\np.generate(cfg, cfg:getprojectfilename(), function() cpp.generate_config(prj, cfg) end)\nend\nend\nend\nfunction cpp.generate_config(prj, cfg)\nlocal tool = premake.gettool(prj)\n_p('# Ninja build project file autogenerated by GENie')\n_p('# https://github.com/bkaradzic/GENie')\n_p(\"\")\n_p(\"ninja_required_version = 1.7\")\n_p(\"\")\nlocal flags = {\ndefines = ninja.list(tool.getdefines(cfg.defines)),\nincludes = ninja.list(table.join(tool.getincludedirs(cfg.includedirs), tool.getquoteincludedirs(cfg.us" "erincludedirs), tool.getsystemincludedirs(cfg.systemincludedirs))),\ncppflags = ninja.list(tool.getcppflags(cfg)),\nasmflags = ninja.list(table.join(tool.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_asm)),\ncflags = ninja.list(table.join(tool.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)),\ncxxflags = ninja.list(table.join(tool.getcflags(cfg), tool.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)),\nobjcflags = ninja.list(table.join(tool.getcflags(cfg), tool.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)),\n}\n_p(\"\")\n_p(\"# core rules for \" .. cfg.name)\n_p(\"rule cc\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.cc .. \" $defines $includes $flags -MMD -MF $out.d -c -o $out $in\"))\n_p(\" description = cc $out\")\n_p(\" depfile = $out.d\")\n_p(\" deps = gcc\")\n_p(\"\")\n_p(\"rule cxx\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.cxx .. \" $defines $includes $flags -MMD -MF $out.d -c -o $out $in\"))\n_p(\" description = cxx $out\")\n_p(\" de" - "pfile = $out.d\")\n_p(\" deps = gcc\")\n_p(\"\")\n_p(\"rule ar\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.ar .. \" $flags $out @$out.rsp \" .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\")))\n_p(\" description = ar $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = $in $libs\")\n_p(\"\")\nlocal link = iif(cfg.language == \"C\", tool.cc, tool.cxx)\n_p(\"rule link\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group'\nendgroup = '-Wl,--end-group'\nend\n_p(\" command = \" .. wrap_ninja_cmd(\"$pre_link \" .. link .. \" -o $out @$out.rsp $all_ldflags $post_build\"))\n_p(\" description = link $out\")\n_p(\" rspfile = $out.rsp\")\n _p(\" rspfile_content = $all_outputfiles \" .. string.format(\"%s $libs %s\", startgroup, endgroup))\n_p(\"\")\n_p(\"rule exec\")\n_p(\" command = \" .. wrap_ninja_cmd(\"$command\"))\n_p(\"" - " description = Run $type commands\")\n_p(\"\")\nif #cfg.prebuildcommands > 0 then\n_p(\"build __prebuildcommands_\" .. premake.esc(prj.name) .. \": exec\")\n_p(1, \"command = \" .. wrap_ninja_cmd(\"echo Running pre-build commands && \" .. table.implode(cfg.prebuildcommands, \"\", \"\", \" && \")))\n_p(1, \"type = pre-build\")\n_p(\"\")\nend\ncfg.pchheader_full = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, cfg.shortname, incdir))\nlocal testname = path.join(abspath, cfg.pchheader_full)\nif os.isfile(testname) then\ncfg.pchheader_full = path.getrelative(cfg.location, testname)\nbreak\nend\nend\ncpp.custombuildtask(prj, cfg)\ncpp.dependencyRules(prj, cfg)\ncpp.file_rules(prj, cfg, flags)\nlocal objfiles = {}\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\ntable.insert(objfiles, cpp.objectname(cfg, file))\nend\nend\n_p('')\ncpp.linker(prj, cfg, objfiles, tool, flags)\n_p(\"\")\nend\nfunction cpp.custombuildt" - "ask(prj, cfg)\nlocal cmd_index = 1\nlocal seen_commands = {}\nlocal command_by_name = {}\nlocal command_files = {}\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands_\" .. premake.esc(prj.name) or \"\"\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nfor _, cmd in ipairs(buildtask[4] or {}) do\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \", path.getrelative(cfg.location, depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, '%$%(<%)', '$in')\ncmd = string.gsub(cmd, '%$%(@%)', '$out')\nlocal cmd_name -- shortened command name\nif seen_commands[cmd] == nil then\nlocal _, _, name = string.find(cmd, '([.%w]+)%s')\nname = 'cmd' .. cmd_index .. '_' .. string.gsub(name, '[^%w]', '_')\nseen_commands[cmd] = {\nname = name,\nindex = cmd_index,\n}\ncmd_index = cmd_index + 1\ncmd_name = name\nelse\ncmd_name = seen_commands[cmd].name\nend\nl" - "ocal index = seen_commands[cmd].index\nif command_files[index] == nil then\ncommand_files[index] = {}\nend\nlocal cmd_set = command_files[index]\ntable.insert(cmd_set, {\nbuildtask[1],\nbuildtask[2],\nbuildtask[3],\nseen_commands[cmd].name,\n})\ncommand_files[index] = cmd_set\ncommand_by_name[cmd_name] = cmd\nend\nend\nend\n_p(\"# custom build rules\")\nfor command, details in pairs(seen_commands) do\n_p(\"rule \" .. details.name)\n_p(1, \"command = \" .. wrap_ninja_cmd(command))\nend\nfor cmd_index, cmdsets in ipairs(command_files) do\nfor _, cmdset in ipairs(cmdsets) do\nlocal file_in = path.getrelative(cfg.location, cmdset[1])\nlocal file_out = path.getrelative(cfg.location, cmdset[2])\nlocal deps = ''\nfor i, dep in ipairs(cmdset[3]) do\ndeps = deps .. path.getrelative(cfg.location, dep) .. ' '\nend\n_p(\"build \" .. file_out .. ': ' .. cmdset[4] .. ' ' .. file_in .. ' | ' .. deps .. prebuildsuffix)\n_p(\"\")\nend\nend\nend\nfunction cpp.dependencyRules(prj, cfg)\nlocal extra_deps = {}\nlocal order_deps = " - "{}\nlocal extra_flags = {}\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nlocal objfilename = cpp.objectname(cfg, path.getrelative(prj.location, dep[1]))\nlocal dependency = path.getrelative(cfg.location, dep[2])\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], dependency)\nend\nend\nlocal pchfilename = cfg.pchheader_full and cpp.pchname(cfg, cfg.pchheader_full) or ''\nfor _, file in ipairs(cfg.files) do\nlocal objfilename = file == cfg.pchheader and cpp.pchname(cfg, file) or cpp.objectname(cfg, file)\nif path.issourcefile(file) or file == cfg.pchheader then\nif #cfg.prebuildcommands > 0 then\nif order_deps[objfilename] == nil then\norder_deps[objfilename] = {}\nend\ntable.insert(order_deps[objfilename], '__prebuildcommands_' .. premake.esc(prj.name))\nend\nend\nif path.issourcefile(file) then\nif cfg.pchheader_full and not cfg.flags.NoPCH then\nlocal nopch = table.icontains(prj.nopch, file)\nif " - "not nopch then\nlocal suffix = path.isobjcfile(file) and '_objc' or ''\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], pchfilename .. suffix .. \".gch\")\nif extra_flags[objfilename] == nil then\nextra_flags[objfilename] = {}\nend\ntable.insert(extra_flags[objfilename], '-include ' .. pchfilename .. suffix)\nend\nend\nend\nend\ncfg.extra_deps = extra_deps\ncfg.order_deps = order_deps\ncfg.extra_flags = extra_flags\nend\nfunction cpp.objectname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(path.removeext(file)) .. \".o\")\nend\nfunction cpp.pchname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(file))\nend\nfunction cpp.file_rules(prj,cfg, flags)\n_p(\"# build files\")\nfor _, file in ipairs(cfg.files) do\n_p(\"# FILE: \" .. file)\nif cfg.pchheader_full == file then\nlocal pchfilename = cpp.pchname(cfg, file)\nlocal extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[pchfilename] or {}, ' ') or ''\nlocal " - "order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[pchfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[pchfilename] or {}, ' ') or ''\n_p(\"build \" .. pchfilename .. \".gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['cxxflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x c-header\", \"-x c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\n_p(\"build \" .. pchfilename .. \"_objc.gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['objcflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x objective-c-header\", \"-x objective-c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.issourcefile(file) then\nlocal objfilename = cpp.objectname(cfg, file)\nlocal extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[objfilename] or {}, ' ') or ''\nlocal o" - "rder_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[objfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[objfilename] or {}, ' ') or ''\nlocal cflags = \"cflags\"\nif path.isobjcfile(file) then\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"objcflags\"\nelseif path.isasmfile(file) then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\ncflags = \"asmflags\"\nelseif path.iscfile(file) and not cfg.options.ForceCPP then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\nelse\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"cxxflags\"\nend\n_p(1, \"flags = \" .. flags[cflags] .. extra_flags)\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.isresourcefile(file) then\nend\nend\n_p(\"\")\nend\nfunction cpp.linker(prj, cfg, objfiles, tool)\nlocal all" - "_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions))\nlocal lddeps = ninja.list(premake.getlinks(cfg, \"siblings\", \"fullpath\"))\nlocal libs = lddeps .. \" \" .. ninja.list(tool.getlinkflags(cfg))\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands\" or \"\"\nlocal function writevars()\n_p(1, \"all_ldflags = \" .. all_ldflags)\n_p(1, \"libs = \" .. libs)\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nif #cfg.prelinkcommands > 0 then\n_p(1, 'pre_link = echo Running pre-link commands && ' .. table.implode(cfg.prelinkcommands, \"\", \"\", \" && \") .. \" && \")\nend\nif #cfg.postbuildcommands > 0 then\n_p(1, 'post_build = && echo Running post-build commands && ' .. table.implode(cfg.postbuildcommands, \"\", \"\", \" && \"))\nend\nend\nif cfg.kind == \"StaticLib\" then\nlocal ar_flags = ninja.list(tool.getarchiveflags(cfg, cfg, false))\n_p(\"# link static lib\")\n_p(\"build \" .. cfg:ge" - "toutputfilename() .. \": ar \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\n_p(1, \"flags = \" .. ninja.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nelseif cfg.kind == \"SharedLib\" or cfg.kind == \"Bundle\" then\nlocal output = cfg:getoutputfilename()\n_p(\"# link shared lib\")\n_p(\"build \" .. output .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelseif (cfg.kind == \"ConsoleApp\") or (cfg.kind == \"WindowedApp\") then\n_p(\"# link executable\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelse\np.error(\"ninja action doesn't support this kind of target \" .. cfg.kind)\nend\nend\n", + "pfile = $out.d\")\n_p(\" deps = gcc\")\n_p(\"\")\n_p(\"rule ar\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.ar .. \" $flags $out @$out.rsp \" .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\")))\n_p(\" description = ar $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = $in $libs\")\n_p(\"\")\nlocal link = iif(cfg.language == \"C\", tool.cc, tool.cxx)\n_p(\"rule link\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group'\nendgroup = '-Wl,--end-group'\nend\n_p(\" command = \" .. wrap_ninja_cmd(\"$pre_link \" .. link .. \" -o $out @$out.rsp $all_ldflags $post_build\"))\n_p(\" description = link $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = $all_outputfiles $walibs\" .. string.format(\"%s $libs %s\", startgroup, endgroup))\n_p(\"\")\n_p(\"rule exec\")\n_p(\" command = \" .. wrap_ninja_cmd(\"$command\"))\n" + "_p(\" description = Run $type commands\")\n_p(\"\")\nif #cfg.prebuildcommands > 0 then\n_p(\"build __prebuildcommands_\" .. premake.esc(prj.name) .. \": exec\")\n_p(1, \"command = \" .. wrap_ninja_cmd(\"echo Running pre-build commands && \" .. table.implode(cfg.prebuildcommands, \"\", \"\", \" && \")))\n_p(1, \"type = pre-build\")\n_p(\"\")\nend\ncfg.pchheader_full = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, cfg.shortname, incdir))\nlocal testname = path.join(abspath, cfg.pchheader_full)\nif os.isfile(testname) then\ncfg.pchheader_full = path.getrelative(cfg.location, testname)\nbreak\nend\nend\ncpp.custombuildtask(prj, cfg)\ncpp.dependencyRules(prj, cfg)\ncpp.file_rules(prj, cfg, flags)\nlocal objfiles = {}\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\ntable.insert(objfiles, cpp.objectname(cfg, file))\nend\nend\n_p('')\ncpp.linker(prj, cfg, objfiles, tool, flags)\n_p(\"\")\nend\nfunction cpp.customb" + "uildtask(prj, cfg)\nlocal cmd_index = 1\nlocal seen_commands = {}\nlocal command_by_name = {}\nlocal command_files = {}\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands_\" .. premake.esc(prj.name) or \"\"\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nfor _, cmd in ipairs(buildtask[4] or {}) do\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \", path.getrelative(cfg.location, depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, '%$%(<%)', '$in')\ncmd = string.gsub(cmd, '%$%(@%)', '$out')\nlocal cmd_name -- shortened command name\nif seen_commands[cmd] == nil then\nlocal _, _, name = string.find(cmd, '([.%w]+)%s')\nname = 'cmd' .. cmd_index .. '_' .. string.gsub(name, '[^%w]', '_')\nseen_commands[cmd] = {\nname = name,\nindex = cmd_index,\n}\ncmd_index = cmd_index + 1\ncmd_name = name\nelse\ncmd_name = seen_commands[cmd].name\ne" + "nd\nlocal index = seen_commands[cmd].index\nif command_files[index] == nil then\ncommand_files[index] = {}\nend\nlocal cmd_set = command_files[index]\ntable.insert(cmd_set, {\nbuildtask[1],\nbuildtask[2],\nbuildtask[3],\nseen_commands[cmd].name,\n})\ncommand_files[index] = cmd_set\ncommand_by_name[cmd_name] = cmd\nend\nend\nend\n_p(\"# custom build rules\")\nfor command, details in pairs(seen_commands) do\n_p(\"rule \" .. details.name)\n_p(1, \"command = \" .. wrap_ninja_cmd(command))\nend\nfor cmd_index, cmdsets in ipairs(command_files) do\nfor _, cmdset in ipairs(cmdsets) do\nlocal file_in = path.getrelative(cfg.location, cmdset[1])\nlocal file_out = path.getrelative(cfg.location, cmdset[2])\nlocal deps = ''\nfor i, dep in ipairs(cmdset[3]) do\ndeps = deps .. path.getrelative(cfg.location, dep) .. ' '\nend\n_p(\"build \" .. file_out .. ': ' .. cmdset[4] .. ' ' .. file_in .. ' | ' .. deps .. prebuildsuffix)\n_p(\"\")\nend\nend\nend\nfunction cpp.dependencyRules(prj, cfg)\nlocal extra_deps = {}\nlocal order_de" + "ps = {}\nlocal extra_flags = {}\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nlocal objfilename = cpp.objectname(cfg, path.getrelative(prj.location, dep[1]))\nlocal dependency = path.getrelative(cfg.location, dep[2])\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], dependency)\nend\nend\nlocal pchfilename = cfg.pchheader_full and cpp.pchname(cfg, cfg.pchheader_full) or ''\nfor _, file in ipairs(cfg.files) do\nlocal objfilename = file == cfg.pchheader and cpp.pchname(cfg, file) or cpp.objectname(cfg, file)\nif path.issourcefile(file) or file == cfg.pchheader then\nif #cfg.prebuildcommands > 0 then\nif order_deps[objfilename] == nil then\norder_deps[objfilename] = {}\nend\ntable.insert(order_deps[objfilename], '__prebuildcommands_' .. premake.esc(prj.name))\nend\nend\nif path.issourcefile(file) then\nif cfg.pchheader_full and not cfg.flags.NoPCH then\nlocal nopch = table.icontains(prj.nopch, file)" + "\nif not nopch then\nlocal suffix = path.isobjcfile(file) and '_objc' or ''\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], pchfilename .. suffix .. \".gch\")\nif extra_flags[objfilename] == nil then\nextra_flags[objfilename] = {}\nend\ntable.insert(extra_flags[objfilename], '-include ' .. pchfilename .. suffix)\nend\nend\nend\nend\ncfg.extra_deps = extra_deps\ncfg.order_deps = order_deps\ncfg.extra_flags = extra_flags\nend\nfunction cpp.objectname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(path.removeext(file)) .. \".o\")\nend\nfunction cpp.pchname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(file))\nend\nfunction cpp.file_rules(prj,cfg, flags)\n_p(\"# build files\")\nfor _, file in ipairs(cfg.files) do\n_p(\"# FILE: \" .. file)\nif cfg.pchheader_full == file then\nlocal pchfilename = cpp.pchname(cfg, file)\nlocal extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[pchfilename] or {}, ' ') or ''\nl" + "ocal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[pchfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[pchfilename] or {}, ' ') or ''\n_p(\"build \" .. pchfilename .. \".gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['cxxflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x c-header\", \"-x c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\n_p(\"build \" .. pchfilename .. \"_objc.gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['objcflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x objective-c-header\", \"-x objective-c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.issourcefile(file) then\nlocal objfilename = cpp.objectname(cfg, file)\nlocal extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[objfilename] or {}, ' ') or ''\nlo" + "cal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[objfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[objfilename] or {}, ' ') or ''\nlocal cflags = \"cflags\"\nif path.isobjcfile(file) then\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"objcflags\"\nelseif path.isasmfile(file) then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\ncflags = \"asmflags\"\nelseif path.iscfile(file) and not cfg.options.ForceCPP then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\nelse\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"cxxflags\"\nend\n_p(1, \"flags = \" .. flags[cflags] .. extra_flags)\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.isresourcefile(file) then\nend\nend\n_p(\"\")\nend\nfunction cpp.linker(prj, cfg, objfiles, tool)\nloca" + "l all_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions))\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands\" or \"\"\nlocal libs = {}\nlocal walibs = {}\nlocal lddeps = {}\nif #cfg.wholearchive > 0 then\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\ntable.insert(lddeps, linkpath)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\ntable.insert(walibs, table.concat(tool.wholearchive(linkpath), ' '))\nelse\ntable.insert(libs, linkpath)\nend\nend\nelse\nlddeps = premake.getlinks(cfg, \"siblings\", \"fullpath\")\nlibs = lddeps\nend\nlddeps = ninja.list(lddeps)\nlibs = ninja.list(libs) .. \" \" .. ninja.list(tool.getlinkflags(cfg))\nwalibs = ninja.list(walibs)\nlocal function writevars()\n_p(1, \"all_ldflags = \" .. all_ldflags)\n" + "_p(1, \"libs = \" .. libs)\n_p(1, \"walibs = \" .. walibs)\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nif #cfg.prelinkcommands > 0 then\n_p(1, 'pre_link = echo Running pre-link commands && ' .. table.implode(cfg.prelinkcommands, \"\", \"\", \" && \") .. \" && \")\nend\nif #cfg.postbuildcommands > 0 then\n_p(1, 'post_build = && echo Running post-build commands && ' .. table.implode(cfg.postbuildcommands, \"\", \"\", \" && \"))\nend\nend\nif cfg.kind == \"StaticLib\" then\nlocal ar_flags = ninja.list(tool.getarchiveflags(cfg, cfg, false))\n_p(\"# link static lib\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": ar \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\n_p(1, \"flags = \" .. ninja.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nelseif cfg.kind == \"SharedLib\" or cfg.kind == \"Bundle\" then\nlocal output = cfg:getoutputfilename()\n_p(\"# link shared lib\")\n_p(" + "\"build \" .. output .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelseif (cfg.kind == \"ConsoleApp\") or (cfg.kind == \"WindowedApp\") then\n_p(\"# link executable\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelse\np.error(\"ninja action doesn't support this kind of target \" .. cfg.kind)\nend\nend\n", /* actions/ninja/ninja_swift.lua */ "local ninja = premake.ninja\nlocal swift = {}\nlocal p = premake\nfunction ninja.generate_swift(prj)\nlocal pxy = ninja.get_proxy(\"prj\", prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in p.eachconfig(pxy, platform) do\np.generate(cfg, cfg:getprojectfilename(), function() swift.generate_config(prj, cfg) end)\nend\nend\nend\nfunction swift.generate_config(prj, cfg)\nlocal tool = premake.gettool(prj)\nlocal flags = {\nswiftcflags = ninja.list(tool.getswiftcflags(cfg)),\nswiftlinkflags = ninja.list(tool.getswiftlinkflags(cfg)),\n}\n_p(\"# Swift project build file\")\n_p(\"# generated with GENie ninja\")\n_p(\"\")\n_p(\"ninja_required_version = 1.7\")\n_p(\"\")\n_p(\"out_dir = %s\", cfg.buildtarget.directory)\n_p(\"obj_dir = %s\", path.join(cfg.objectsdir, prj.name .. \".build\"))\n_p(\"target = $out_dir/%s\", cfg.buildtarget.name)\n_p(\"module_name = %s\", prj.name)\n_p(\"module_" @@ -542,8 +543,8 @@ const char* builtin_scripts[] = { /* _premake_main.lua */ "_WORKING_DIR = os.getcwd()\nlocal function injectplatform(platform)\nif not platform then return true end\nplatform = premake.checkvalue(platform, premake.fields.platforms.allowed)\nfor sln in premake.solution.each() do\nlocal platforms = sln.platforms or { }\nif #platforms == 0 then\ntable.insert(platforms, \"Native\")\nend\nif not table.contains(platforms, \"Native\") then\nreturn false, sln.name .. \" does not target native platform\\nNative platform settings are required for the --platform feature.\"\nend\nif not table.contains(platforms, platform) then\ntable.insert(platforms, platform)\nend\nsln.platforms = platforms\nend\nreturn true\nend\nfunction _premake_main(scriptpath)\nif (scriptpath) then\nlocal scripts = dofile(scriptpath .. \"/_manifest.lua\")\nfor _,v in ipairs(scripts) do\ndofile(scriptpath .. \"/\" .. v)\nend\nend\nlocal profiler = newProfiler()\nif (nil ~= _OPTIONS[\"debug-profiler\"]) then\nprofiler:start()\nend\n_PREMAKE_COMMAND = path.getabsolute(_PREMAKE_COMMAND)\npremake.action" - ".set(_ACTION)\nmath.randomseed(os.time())\nif (nil ~= _OPTIONS[\"file\"]) then\nlocal fname = _OPTIONS[\"file\"]\nif (os.isfile(fname)) then\ndofile(fname)\nelse\nerror(\"No genie script '\" .. fname .. \"' found!\", 2)\nend\nelse\nlocal dir, name = premake.findDefaultScript(path.getabsolute(\"./\"))\nif dir ~= nil then\nos.chdir(dir)\ndofile(name)\nend\nend\nif (_OPTIONS[\"version\"] or _OPTIONS[\"help\"] or not _ACTION) then\nprintf(\"GENie - Project generator tool %s\", _GENIE_VERSION_STR)\nprintf(\"https://github.com/bkaradzic/GENie\")\nif (not _OPTIONS[\"version\"]) then\npremake.showhelp()\nend\nreturn 1\nend\naction = premake.action.current()\nif (not action) then\nerror(\"Error: no such action '\" .. _ACTION .. \"'\", 0)\nend\nok, err = premake.option.validate(_OPTIONS)\nif (not ok) then error(\"Error: \" .. err, 0) end\nok, err = premake.checktools()\nif (not ok) then error(\"Error: \" .. err, 0) end\nok, err = injectplatform(_OPTIONS[\"platform\"])\nif (not ok) then error(\"Error: \" .. err, 0) end\n" - "print(\"Building configurations...\")\npremake.bake.buildconfigs()\nok, err = premake.checkprojects()\nif (not ok) then error(\"Error: \" .. err, 0) end\npremake.stats = { }\npremake.stats.num_generated = 0\npremake.stats.num_skipped = 0\nprintf(\"Running action '%s'...\", action.trigger)\npremake.action.call(action.trigger)\nif (nil ~= _OPTIONS[\"debug-profiler\"]) then\nprofiler:stop()\nlocal filePath = path.getabsolute(\"GENie-profile.txt\")\nprint(\"Writing debug-profile report to ''\" .. filePath .. \"'.\")\nlocal outfile = io.open(filePath, \"w+\")\nprofiler:report(outfile, true)\noutfile:close()\nend\nprintf(\"Done. Generated %d/%d projects.\"\n, premake.stats.num_generated\n, premake.stats.num_generated+premake.stats.num_skipped\n)\nreturn 0\nend\n", + ".set(_ACTION)\nmath.randomseed(os.time())\nif (nil ~= _OPTIONS[\"file\"]) then\nlocal fname = _OPTIONS[\"file\"]\nif (os.isfile(fname)) then\ndofile(fname)\nelse\nerror(\"No genie script '\" .. fname .. \"' found!\", 2)\nend\nelse\nlocal dir, name = premake.findDefaultScript(path.getabsolute(\"./\"))\nif dir ~= nil then\nlocal cwd = os.getcwd()\nos.chdir(dir)\ndofile(name)\nos.chdir(cwd)\nend\nend\nif (_OPTIONS[\"version\"] or _OPTIONS[\"help\"] or not _ACTION) then\nprintf(\"GENie - Project generator tool %s\", _GENIE_VERSION_STR)\nprintf(\"https://github.com/bkaradzic/GENie\")\nif (not _OPTIONS[\"version\"]) then\npremake.showhelp()\nend\nreturn 1\nend\naction = premake.action.current()\nif (not action) then\nerror(\"Error: no such action '\" .. _ACTION .. \"'\", 0)\nend\nok, err = premake.option.validate(_OPTIONS)\nif (not ok) then error(\"Error: \" .. err, 0) end\nok, err = premake.checktools()\nif (not ok) then error(\"Error: \" .. err, 0) end\nok, err = injectplatform(_OPTIONS[\"platform\"])\nif (not ok)" + " then error(\"Error: \" .. err, 0) end\nprint(\"Building configurations...\")\npremake.bake.buildconfigs()\nok, err = premake.checkprojects()\nif (not ok) then error(\"Error: \" .. err, 0) end\npremake.stats = { }\npremake.stats.num_generated = 0\npremake.stats.num_skipped = 0\nprintf(\"Running action '%s'...\", action.trigger)\npremake.action.call(action.trigger)\nif (nil ~= _OPTIONS[\"debug-profiler\"]) then\nprofiler:stop()\nlocal filePath = path.getabsolute(\"GENie-profile.txt\")\nprint(\"Writing debug-profile report to ''\" .. filePath .. \"'.\")\nlocal outfile = io.open(filePath, \"w+\")\nprofiler:report(outfile, true)\noutfile:close()\nend\nprintf(\"Done. Generated %d/%d projects.\"\n, premake.stats.num_generated\n, premake.stats.num_generated+premake.stats.num_skipped\n)\nreturn 0\nend\n", 0 }; diff --git a/3rdparty/genie/src/tools/gcc.lua b/3rdparty/genie/src/tools/gcc.lua index 44b2edb2a0f..3c87aa2074a 100644 --- a/3rdparty/genie/src/tools/gcc.lua +++ b/3rdparty/genie/src/tools/gcc.lua @@ -278,6 +278,8 @@ function premake.gcc.wholearchive(lib) if premake.gcc.llvm then return {"-force_load", lib} + elseif os.get() == "macosx" then + return {"-Wl,-force_load", lib} else return {"-Wl,--whole-archive", lib, "-Wl,--no-whole-archive"} end -- cgit v1.2.3