--
-- vs200x_vcproj_user.lua
-- Generate a Visual Studio 2002-2008 C/C++ project .user file
-- Copyright (c) 2011-2012 Jason Perkins and the Premake project
--
local vstudio = premake.vstudio
local vc200x = premake.vstudio.vc200x
local project = premake5.project
--
-- Generate a Visual Studio 200x C++ user file, with support for the new platforms API.
--
function vc200x.generate_user_ng(prj)
io.eol = "\r\n"
vc200x.xmldeclaration()
_p('')
_p(1,'')
for cfg in project.eachconfig(prj) do
vc200x.userconfiguration(cfg)
vc200x.debugdir_ng(cfg)
_p(2,'')
end
_p(1,'')
_p('')
end
--
-- Write out the element, describing a specific Premake
-- build configuration/platform pairing.
--
function vc200x.userconfiguration(cfg)
_p(2,'')
end
--
-- Write out the debug settings for this project.
--
function vc200x.debugdir_ng(cfg)
_p(3,' 0 then
_x(4,'CommandArguments="%s"', table.concat(cfg.debugargs, " "))
end
if #cfg.debugenvs > 0 then
_p(4,'Environment="%s"', table.concat(premake.esc(cfg.debugenvs), "
"))
if cfg.flags.DebugEnvsDontMerge then
_p(4,'EnvironmentMerge="false"')
end
end
_p(3,'/>')
end
-----------------------------------------------------------------------------
-- Everything below this point is a candidate for deprecation
-----------------------------------------------------------------------------
--
-- Generate the .vcproj.user file
--
function vc200x.generate_user(prj)
vc200x.header('VisualStudioUserFile')
_p(1,'ShowAllFiles="false"')
_p(1,'>')
_p(1,'')
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
if cfginfo.isreal then
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
_p(2,'')
vc200x.debugdir(cfg)
_p(2,'')
end
end
_p(1,'')
_p('')
end
--
-- Output the debug settings element
--
function vc200x.environmentargs(cfg)
if cfg.environmentargs and #cfg.environmentargs > 0 then
_p(4,'Environment="%s"', string.gsub(table.concat(cfg.environmentargs, "
"),'"','"'))
if cfg.flags.EnvironmentArgsDontMerge then
_p(4,'EnvironmentMerge="false"')
end
end
end
function vc200x.debugdir(cfg)
_p(3,' 0 then
_p(4,'CommandArguments="%s"', table.concat(cfg.debugargs, " "))
end
vc200x.environmentargs(cfg)
_p(3,'/>')
end