diff options
| author | ruki <[email protected]> | 2017-03-17 11:02:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-03-17 11:02:22 +0800 |
| commit | 3e6132e5fee64b0ca38796494922a6bbe8648de1 (patch) | |
| tree | 2c46d365f897fe4285fbb2671c9f2555765b77c0 /xmake/plugins/project/vstudio/impl/vs201x.lua | |
| parent | 831509cea9c280d0274b1d309f82b370be2c9a23 (diff) | |
fix option checking and support multi-modes vs201x project
Diffstat (limited to 'xmake/plugins/project/vstudio/impl/vs201x.lua')
| -rwxr-xr-x | xmake/plugins/project/vstudio/impl/vs201x.lua | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index 389152f01..ce20ae182 100755 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -58,6 +58,7 @@ function make(outputdir, vsinfo) local targets = {} for _, mode in ipairs(vsinfo.modes) do for _, arch in ipairs({"x86", "x64"}) do + -- reload config, project and platform if mode ~= config.mode() or arch ~= config.arch() then @@ -65,39 +66,36 @@ function make(outputdir, vsinfo) config.set("mode", mode) config.set("arch", arch) - -- recheck configure - config.check() - -- recheck project options - project.check() + project.check(true) -- reload platform platform.load(config.plat()) -- reload project project.load() + end - -- ensure to enter project directory - os.cd(project.directory()) + -- ensure to enter project directory + os.cd(project.directory()) - -- save targets - for targetname, target in pairs(project.targets()) do + -- save targets + for targetname, target in pairs(project.targets()) do - -- make target with the given mode and arch - targets[targetname] = targets[targetname] or {} - local _target = targets[targetname] + -- make target with the given mode and arch + targets[targetname] = targets[targetname] or {} + local _target = targets[targetname] - -- init target info - _target.name = targetname - _target.kind = target:get("kind") - _target.scriptdir = scriptdir - _target.info = _target.info or {} - table.insert(_target.info, { mode = mode, arch = arch, target = target }) + -- init target info + _target.name = targetname + _target.kind = target:get("kind") + _target.scriptdir = scriptdir + _target.info = _target.info or {} + table.insert(_target.info, { mode = mode, arch = arch, target = target }) - -- save all sourcefiles and headerfiles - _target.sourcefiles = table.unique(table.join(_target.sourcefiles or {}, (target:sourcefiles()))) - _target.headerfiles = table.unique(table.join(_target.headerfiles or {}, (target:headerfiles()))) - end + -- save all sourcefiles and headerfiles + _target.sourcefiles = table.unique(table.join(_target.sourcefiles or {}, (target:sourcefiles()))) + _target.headerfiles = table.unique(table.join(_target.headerfiles or {}, (target:headerfiles()))) end end end |
