From e810531b1cc8809b859761de3c4b747e973ea39a Mon Sep 17 00:00:00 2001 From: Patrick Mackinlay Date: Wed, 20 Nov 2024 16:38:23 +0700 Subject: [PATCH] genie: local fix for resource directory bug * pending upstream merge of https://github.com/bkaradzic/GENie/pull/572 --- .../src/actions/vstudio/vstudio_vcxproj.lua | 9 +- 3rdparty/genie/src/host/scripts.c | 86 +++++++++---------- scripts/src/main.lua | 14 --- 3 files changed, 51 insertions(+), 58 deletions(-) diff --git a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua index 87081777e5176..dd9c1c6309717 100644 --- a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua +++ b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua @@ -341,6 +341,13 @@ end end + local function include_resdirs(indent,cfg) + if #cfg.resincludedirs> 0 then + _p(indent,'%s;%%(AdditionalIncludeDirectories)' + ,premake.esc(path.translate(table.concat(cfg.resincludedirs, ";"), '\\'))) + end + end + local function using_dirs(indent,cfg) if #cfg.usingdirs > 0 then _p(indent,'%s;%%(AdditionalUsingDirectories)' @@ -351,7 +358,7 @@ local function resource_compile(cfg) _p(2,'') preprocessor(3,cfg,true) - include_dirs(3,cfg) + include_resdirs(3,cfg) _p(2,'') end diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c index 062908eb18ba2..d052a1418f49c 100644 --- a/3rdparty/genie/src/host/scripts.c +++ b/3rdparty/genie/src/host/scripts.c @@ -308,49 +308,49 @@ const char* builtin_scripts[] = { "\\\\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 vstudio.isgdkconsole(cfg) then\n_p(2, '$(Console_SdkRoot)bin;$(Console_SdkToolPath);$(ExecutablePath)')\n_p(2, '$(Console_SdkIncludeRoot)')\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_SdkLibPath)')\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\nend\nif vst" "udio.isgdkdesktop(cfg) then\n_p(2, '$(Console_SdkIncludeRoot);$(IncludePath)')\n_p(2, '$(Console_SdkLibPath);$(LibraryPath)')\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 isPreprocessorDefinitionPresent = 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;%%(Addi" - "tionalIncludeDirectories)'\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(cfg)\nif cfg.flags.CppLatest then\n_p(3, 'stdcpplatest')\n_p(3, 'true')\nelseif cfg.flags.Cpp20 then\n_p(3, 'stdcpp20')\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\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nelse\n_p(3, 'true')\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.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_buil" - "tin(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\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" the" - "n\nif cfg.flags.FloatFast then\n_p(3, 'true')\nend\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 the" - "n\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.platform == \"NX32\" or cfg.platform == \"NX64\" 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 = t" - "able.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\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" 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.N" - "oOptimizeLink 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')\n" - "else\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\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" 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\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 ,'Leve" - "l3')\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\") or\n premake.action.current() == premake.action.get(\"vs2022\") then\ncppstandard(cfg)\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\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 th" - "en\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 func" - "tion 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(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)\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.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.icontai" - "ns(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\" or cfg.platform == \"ARM64\", \"_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.ac" - "tion.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\")\nlocal links = getcfglinks(cfg)\n_p(2,'')\n_p(3,'%s', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\nif vs2017OrLater 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.p" - "latform == \"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.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\nlocal adddeps =\n iif(cfg.platform == \"Durango\", '%(XboxExtensionsDependencies)'\n, iif(vstudio.isgdkconsole(cfg), '$(Console_Libs);%(XboxExtensionsDependencies);%(AdditionalDependencies)'\n, iif(vstudio.isgdkdesktop(cfg), '$(Console_Libs);%(AdditionalDependencies)'\n, '%(AdditionalDependencies)')))\n_p(tab, '%s;" - "%s', deps, adddeps)\nelseif cfg.platform == \"Durango\" then\n_p(tab, '%%(XboxExtensionsDependencies)')\nelseif vstudio.isgdkconsole(cfg) then\n_p(tab, '$(Console_Libs);%%(XboxExtensionsDependencies);%%(AdditionalDependencies)')\nelseif vstudio.isgdkdesktop(cfg) then\n_p(tab, '$(Console_Libs);%%(AdditionalDependencies)')\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(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.ClInclud" - "e, 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\"\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.sim" - "plefilesgroup(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(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(buildT" - "askNames) 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 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 _, 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\ne" - "nd\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 _, 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,'')\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 = tab" - "le.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 = ' 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(slnrelpat" - "h, 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 premake.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", + "tionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\')))\nend\nend\nlocal function include_resdirs(indent,cfg)\nif #cfg.resincludedirs> 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(cfg.resincludedirs, \";\"), '\\\\')))\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_resdirs(3,cfg)\n_p(2,'')\nend\nlocal function cppstandard(cfg)\nif cfg.flags.CppLatest then\n_p(3, 'stdcpplatest')\n_p(3, 'true')\nelseif cfg.flags.Cpp20 then\n_p(3, " + "'stdcpp20')\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\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nelse\n_p(3, 'true')\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.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\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.FloatFast then\n_p(3, 'true')\nend\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 fun" + "ction 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.platform == \"NX32\" or cfg.platform == \"NX64\" then\nunsigned" + "Char = \"-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(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\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" 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', r" + "untime(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 == \"T" + "egraAndroid\" 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\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" 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\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\") or\n premake.action.current() == premake.action.get(\"vs2022\") then\ncppstandard(cfg)\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\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.prebui" + "ldcommands, \"\", \"\", \"\\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(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)\n_p(1,'')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"Shared" + "Lib\" 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.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\" or cfg.platform == \"ARM64\", \"_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, 't" + "rue')\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 links = getcfglinks(cfg)\n_p(2,'')\n_p(3,'%s', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\nif vs2017OrLater 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\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.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\nlocal adddeps =\n iif(cfg.platform == \"Durango\", '%(XboxExtensionsDependencies)'\n, iif(vstudio.isgdkconsole" + "(cfg), '$(Console_Libs);%(XboxExtensionsDependencies);%(AdditionalDependencies)'\n, iif(vstudio.isgdkdesktop(cfg), '$(Console_Libs);%(AdditionalDependencies)'\n, '%(AdditionalDependencies)')))\n_p(tab, '%s;%s', deps, adddeps)\nelseif cfg.platform == \"Durango\" then\n_p(tab, '%%(XboxExtensionsDependencies)')\nelseif vstudio.isgdkconsole(cfg) then\n_p(tab, '$(Console_Libs);%%(XboxExtensionsDependencies);%%(AdditionalDependencies)')\nelseif vstudio.isgdkdesktop(cfg) then\n_p(tab, '$(Console_Libs);%%(AdditionalDependencies)')\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.tran" + "slate(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(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 foundAppx" + "Manifest = 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.Deploym" + "entContent, 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(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 _, b" + "uildtask 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 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.loca" + "tion,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 = pr" + "emake.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.getfil" + "egroup(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.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;\nexistingBasenam" + "es[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.s" + "ub(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.icontai" + "ns(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 exclud" + "ed = 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 = ' 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\", 'And" + "roidDebugger'\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, 0x5" + "3, 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 vstudio.storeapp == \"10.0\" then\n_p('')\nelseif vstudi" + "o.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" diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 0192d849676cf..d5f94bb60bdac 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -220,14 +220,6 @@ end GEN_DIR .. "resource", } - configuration { "vs20*"} - -- See https://github.com/bkaradzic/GENie/issues/544 - includedirs { - MAME_DIR .. "scripts/resources/windows/" .. _target, - GEN_DIR .. "resource", - } - configuration { } - if (STANDALONE==true) then standalone(); @@ -269,12 +261,6 @@ if (STANDALONE~=true) then resincludedirs { MAME_DIR .. "scripts/resources/windows/mame", } - configuration { "vs20*"} - -- See https://github.com/bkaradzic/GENie/issues/544 - includedirs { - MAME_DIR .. "scripts/resources/windows/mame", - } - configuration { } end local mainfile = MAME_DIR .. "src/" .. _target .. "/" .. _subtarget .. ".cpp"