2011-04-25 19:55:17 +00:00
|
|
|
--
|
|
|
|
-- vs200x_vcproj_user.lua
|
|
|
|
-- Generate a Visual Studio 2002-2008 C/C++ project .user file
|
2012-01-12 21:59:15 +00:00
|
|
|
-- Copyright (c) 2011-2012 Jason Perkins and the Premake project
|
2011-04-25 19:55:17 +00:00
|
|
|
--
|
|
|
|
|
2012-01-12 21:59:15 +00:00
|
|
|
local vc200x = premake.vstudio.vc200x
|
2011-04-25 19:55:17 +00:00
|
|
|
|
|
|
|
--
|
2012-01-12 21:59:15 +00:00
|
|
|
-- Generate a Visual Studio 200x C++ user file, with support for the new platforms API.
|
2011-04-25 19:55:17 +00:00
|
|
|
--
|
|
|
|
|
2012-01-12 21:59:15 +00:00
|
|
|
function vc200x.generate_user_ng(prj)
|
|
|
|
print("** Warning: C++ user files have not been ported yet")
|
|
|
|
end
|
2011-04-25 19:55:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Generate the .vcproj.user file
|
|
|
|
--
|
|
|
|
|
|
|
|
function vc200x.generate_user(prj)
|
|
|
|
vc200x.header('VisualStudioUserFile')
|
|
|
|
|
|
|
|
_p(1,'ShowAllFiles="false"')
|
|
|
|
_p(1,'>')
|
|
|
|
_p(1,'<Configurations>')
|
|
|
|
|
|
|
|
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,'<Configuration')
|
|
|
|
_p(3,'Name="%s"', premake.esc(cfginfo.name))
|
|
|
|
_p(3,'>')
|
|
|
|
|
|
|
|
vc200x.debugdir(cfg)
|
|
|
|
|
|
|
|
_p(2,'</Configuration>')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
_p(1,'</Configurations>')
|
|
|
|
_p('</VisualStudioUserFile>')
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Output the debug settings element
|
|
|
|
--
|
2011-08-22 09:51:28 +00:00
|
|
|
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
|
|
|
|
|
2011-04-25 19:55:17 +00:00
|
|
|
function vc200x.debugdir(cfg)
|
|
|
|
_p(3,'<DebugSettings')
|
|
|
|
|
|
|
|
if cfg.debugdir then
|
|
|
|
_p(4,'WorkingDirectory="%s"', path.translate(cfg.debugdir, '\\'))
|
|
|
|
end
|
|
|
|
|
|
|
|
if #cfg.debugargs > 0 then
|
|
|
|
_p(4,'CommandArguments="%s"', table.concat(cfg.debugargs, " "))
|
|
|
|
end
|
2011-08-22 09:51:28 +00:00
|
|
|
|
|
|
|
vc200x.environmentargs(cfg)
|
|
|
|
|
2011-04-25 19:55:17 +00:00
|
|
|
_p(3,'/>')
|
|
|
|
end
|