summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/vstudio/impl
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-31 22:11:00 +0800
committerruki <[email protected]>2019-08-31 22:11:00 +0800
commit9b62ca9a3bdccb9a37f80a6dd943dfd13a502a32 (patch)
tree34f3b6fc417b0ec5cc73c722244527290f3a13d3 /xmake/plugins/project/vstudio/impl
parente7ab648aa0bb953391204c6f081519421118e1d0 (diff)
fix all codes about sourcebatches
Diffstat (limited to 'xmake/plugins/project/vstudio/impl')
-rw-r--r--xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua11
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x.lua5
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua10
3 files changed, 16 insertions, 10 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua b/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua
index 106b97709..149330276 100644
--- a/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua
+++ b/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua
@@ -251,8 +251,9 @@ function _make_configurations(vcprojfile, vsinfo, target, vcprojdir)
-- save compiler flags
local compflags=nil
- for sourcekind, sourcebatch in pairs(target:sourcebatches()) do
- if not sourcebatch.rulename then
+ for _, sourcebatch in pairs(target:sourcebatches()) do
+ local sourcekind = sourcebatch.sourcekind
+ if sourcekind then
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
local flags = compiler.compflags(sourcefile, {target = target})
if sourcekind == "cc" or sourcekind == "cxx" then
@@ -526,7 +527,8 @@ function _make_files(vcprojfile, vsinfo, target, vcprojdir)
local sourcebatches = target:sourcebatches()
-- c/cxx files
vcprojfile:enter("<Filter Name=\"Source Files\">")
- for sourcekind, sourcebatch in pairs(sourcebatches) do
+ for _, sourcebatch in pairs(sourcebatches) do
+ local sourcekind = sourcebatch.sourcekind
if sourcekind ~= "mrc" then
local objectfiles = sourcebatch.objectfiles
for idx, sourcefile in ipairs(sourcebatch.sourcefiles) do
@@ -540,7 +542,8 @@ function _make_files(vcprojfile, vsinfo, target, vcprojdir)
-- *.rc files
vcprojfile:enter("<Filter Name=\"Resource Files\">")
- for sourcekind, sourcebatch in pairs(sourcebatches) do
+ for _, sourcebatch in pairs(sourcebatches) do
+ local sourcekind = sourcebatch.sourcekind
if sourcekind == "mrc" then
local objectfiles = sourcebatch.objectfiles
for idx, sourcefile in ipairs(sourcebatch.sourcefiles) do
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua
index af0a18d0c..4d68019bb 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x.lua
@@ -74,8 +74,9 @@ function _make_targetinfo(mode, arch, target)
local firstcompflags = nil
targetinfo.compflags = {}
targetinfo.compargvs = {}
- for sourcekind, sourcebatch in pairs(target:sourcebatches()) do
- if not sourcebatch.rulename then
+ for _, sourcebatch in pairs(target:sourcebatches()) do
+ local sourcekind = sourcebatch.sourcekind
+ if sourcekind then
for idx, sourcefile in ipairs(sourcebatch.sourcefiles) do
local compflags = compiler.compflags(sourcefile, {target = target})
if not firstcompflags and (sourcekind == "cc" or sourcekind == "cxx") then
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
index 8f6549281..65a6bad0a 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
@@ -457,8 +457,9 @@ function _make_common_items(vcxprojfile, vsinfo, target, vcxprojdir)
local files_count = 0
local first_flags = nil
targetinfo.sourceflags = {}
- for sourcekind, sourcebatch in pairs(targetinfo.sourcebatches) do
- if not sourcebatch.rulename and (sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as" or sourcekind == "mrc") then
+ for _, sourcebatch in pairs(targetinfo.sourcebatches) do
+ local sourcekind = sourcebatch.sourcekind
+ if (sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as" or sourcekind == "mrc") then
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
-- make compiler flags
@@ -715,8 +716,9 @@ function _make_source_files(vcxprojfile, vsinfo, target, vcxprojdir)
-- make source file infos
local sourceinfos = {}
for _, targetinfo in ipairs(target.info) do
- for sourcekind, sourcebatch in pairs(targetinfo.sourcebatches) do
- if not sourcebatch.rulename and (sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as" or sourcekind == "mrc") then
+ for _, sourcebatch in pairs(targetinfo.sourcebatches) do
+ local sourcekind = sourcebatch.sourcekind
+ if (sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as" or sourcekind == "mrc") then
local objectfiles = sourcebatch.objectfiles
for idx, sourcefile in ipairs(sourcebatch.sourcefiles) do
local objectfile = objectfiles[idx]