summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/vstudio/impl
diff options
context:
space:
mode:
authorruki <[email protected]>2017-05-12 22:22:53 +0800
committerruki <[email protected]>2017-05-12 22:22:53 +0800
commitfd4a54717f7a25127e77c9159f1b4ffeaa69e3c8 (patch)
tree125ca8836120f2adbe820ff3149e1966b003e702 /xmake/plugins/project/vstudio/impl
parent442a015bd6c93541023a8c11e99a1f353f0a01f6 (diff)
fix phony target for vs project
Diffstat (limited to 'xmake/plugins/project/vstudio/impl')
-rw-r--r--xmake/plugins/project/vstudio/impl/vs200x.lua4
-rw-r--r--xmake/plugins/project/vstudio/impl/vs200x_solution.lua30
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x.lua26
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_solution.lua34
4 files changed, 53 insertions, 41 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs200x.lua b/xmake/plugins/project/vstudio/impl/vs200x.lua
index 2af7a4ce9..2f07f35a5 100644
--- a/xmake/plugins/project/vstudio/impl/vs200x.lua
+++ b/xmake/plugins/project/vstudio/impl/vs200x.lua
@@ -41,7 +41,9 @@ function make(outputdir, vsinfo)
-- make vsprojs
for _, target in pairs(project.targets()) do
- vs200x_vcproj.make(vsinfo, target)
+ if not target:isphony() then
+ vs200x_vcproj.make(vsinfo, target)
+ end
end
-- leave project directory
diff --git a/xmake/plugins/project/vstudio/impl/vs200x_solution.lua b/xmake/plugins/project/vstudio/impl/vs200x_solution.lua
index 85de807cc..b076d35bd 100644
--- a/xmake/plugins/project/vstudio/impl/vs200x_solution.lua
+++ b/xmake/plugins/project/vstudio/impl/vs200x_solution.lua
@@ -40,19 +40,21 @@ function _make_projects(slnfile, vsinfo)
-- make all targets
for targetname, target in pairs(project.targets()) do
+ if not target:isphony() then
- -- enter project
- slnfile:enter("Project(\"{%s}\") = \"%s\", \"%s\\%s.vcproj\", \"{%s}\"", vctool, targetname, targetname, targetname, os.uuid(targetname))
+ -- enter project
+ slnfile:enter("Project(\"{%s}\") = \"%s\", \"%s\\%s.vcproj\", \"{%s}\"", vctool, targetname, targetname, targetname, os.uuid(targetname))
- -- add dependences
- for _, dep in ipairs(target:get("deps")) do
- slnfile:enter("ProjectSection(ProjectDependencies) = postProject")
- slnfile:print("{%s} = {%s}", os.uuid(dep), os.uuid(dep))
- slnfile:leave("EndProjectSection")
- end
+ -- add dependences
+ for _, dep in ipairs(target:get("deps")) do
+ slnfile:enter("ProjectSection(ProjectDependencies) = postProject")
+ slnfile:print("{%s} = {%s}", os.uuid(dep), os.uuid(dep))
+ slnfile:leave("EndProjectSection")
+ end
- -- leave project
- slnfile:leave("EndProject")
+ -- leave project
+ slnfile:leave("EndProject")
+ end
end
end
@@ -69,9 +71,11 @@ function _make_global(slnfile, vsinfo)
-- add project configuration platforms
slnfile:enter("GlobalSection(ProjectConfigurationPlatforms) = postSolution")
- for targetname, _ in pairs(project.targets()) do
- slnfile:print("{%s}.$(mode)|Win32.ActiveCfg = $(mode)|Win32", os.uuid(targetname))
- slnfile:print("{%s}.$(mode)|Win32.Build.0 = $(mode)|Win32", os.uuid(targetname))
+ for targetname, target in pairs(project.targets()) do
+ if not target:isphony() then
+ slnfile:print("{%s}.$(mode)|Win32.ActiveCfg = $(mode)|Win32", os.uuid(targetname))
+ slnfile:print("{%s}.$(mode)|Win32.Build.0 = $(mode)|Win32", os.uuid(targetname))
+ end
end
slnfile:leave("EndGlobalSection")
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua
index c7eea9c66..29b004030 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x.lua
@@ -113,21 +113,23 @@ function make(outputdir, vsinfo)
-- save targets
for targetname, target in pairs(project.targets()) do
+ if not target:isphony() then
- -- 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 = target:scriptdir()
- _target.info = _target.info or {}
- table.insert(_target.info, _make_targetinfo(mode, arch, target))
+ -- init target info
+ _target.name = targetname
+ _target.kind = target:get("kind")
+ _target.scriptdir = target:scriptdir()
+ _target.info = _target.info or {}
+ table.insert(_target.info, _make_targetinfo(mode, arch, 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())))
+ -- 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
end
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua
index a3182d9fd..40ac3e0f5 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua
@@ -40,19 +40,21 @@ function _make_projects(slnfile, vsinfo)
-- make all targets
for targetname, target in pairs(project.targets()) do
+ if not target:isphony() then
- -- enter project
- slnfile:enter("Project(\"{%s}\") = \"%s\", \"%s\\%s.vcxproj\", \"{%s}\"", vctool, targetname, targetname, targetname, os.uuid(targetname))
+ -- enter project
+ slnfile:enter("Project(\"{%s}\") = \"%s\", \"%s\\%s.vcxproj\", \"{%s}\"", vctool, targetname, targetname, targetname, os.uuid(targetname))
- -- add dependences
- for _, dep in ipairs(target:get("deps")) do
- slnfile:enter("ProjectSection(ProjectDependencies) = postProject")
- slnfile:print("{%s} = {%s}", os.uuid(dep), os.uuid(dep))
- slnfile:leave("EndProjectSection")
- end
+ -- add dependences
+ for _, dep in ipairs(target:get("deps")) do
+ slnfile:enter("ProjectSection(ProjectDependencies) = postProject")
+ slnfile:print("{%s} = {%s}", os.uuid(dep), os.uuid(dep))
+ slnfile:leave("EndProjectSection")
+ end
- -- leave project
- slnfile:leave("EndProject")
+ -- leave project
+ slnfile:leave("EndProject")
+ end
end
end
@@ -73,11 +75,13 @@ function _make_global(slnfile, vsinfo)
-- add project configuration platforms
slnfile:enter("GlobalSection(ProjectConfigurationPlatforms) = postSolution")
- for targetname, _ in pairs(project.targets()) do
- for _, mode in ipairs(vsinfo.modes) do
- for _, arch in ipairs({"x86", "x64"}) do
- slnfile:print("{%s}.%s|%s.ActiveCfg = %s|%s", os.uuid(targetname), mode, arch, mode, arch)
- slnfile:print("{%s}.%s|%s.Build.0 = %s|%s", os.uuid(targetname), mode, arch, mode, arch)
+ for targetname, target in pairs(project.targets()) do
+ if not target:isphony() then
+ for _, mode in ipairs(vsinfo.modes) do
+ for _, arch in ipairs({"x86", "x64"}) do
+ slnfile:print("{%s}.%s|%s.ActiveCfg = %s|%s", os.uuid(targetname), mode, arch, mode, arch)
+ slnfile:print("{%s}.%s|%s.Build.0 = %s|%s", os.uuid(targetname), mode, arch, mode, arch)
+ end
end
end
end