diff options
Diffstat (limited to 'xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua')
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index 575e339ae..547414307 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -416,7 +416,7 @@ function _make_common_items(vcxprojfile, vsinfo, target, vcxprojdir) 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 + if not sourcebatch.rulename and (sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as") then for _, sourcefile in ipairs(sourcebatch.sourcefiles) do -- make compiler flags @@ -485,9 +485,8 @@ function _make_source_file_forall(vcxprojfile, vsinfo, target, sourcefile, sourc end -- enter it - local nodename = ifelse(sourcekind == "as", "CustomBuild", ifelse(sourcekind == "mrc", "ResourceCompile", "ClCompile")) sourcefile = path.relative(path.absolute(sourcefile), vcxprojdir) - vcxprojfile:enter("<%s Include=\"%s\">", nodename, sourcefile) + vcxprojfile:enter("<%s Include=\"%s\">", ifelse(sourcekind == "as", "CustomBuild", "ClCompile"), sourcefile) -- for *.asm files if sourcekind == "as" then @@ -499,13 +498,6 @@ function _make_source_file_forall(vcxprojfile, vsinfo, target, sourcefile, sourc vcxprojfile:print("<Command Condition=\"\'%$(Configuration)|%$(Platform)\'==\'%s\'\">%s /nologo /c %s -Fo%s %s</Command>", info.mode .. '|' .. info.arch, ifelse(info.arch == "x64", "ml64", "ml"), os.args(info.flags), objectfile, sourcefile) end - -- for *.rc files - elseif sourcekind == "mrc" then - for _, info in ipairs(sourceinfo) do - local objectfile = path.relative(path.absolute(info.objectfile), vcxprojdir) - vcxprojfile:print("<ResourceOutputFileName Condition=\"\'%$(Configuration)|%$(Platform)\'==\'%s|%s\'\">%s</ResourceOutputFileName>",info.mode,info.arch,objectfile) - end - -- for *.c/cpp files else @@ -590,7 +582,7 @@ function _make_source_file_forall(vcxprojfile, vsinfo, target, sourcefile, sourc end -- leave it - vcxprojfile:leave("</%s>", nodename) + vcxprojfile:leave("</%s>", ifelse(sourcekind == "as", "CustomBuild", "ClCompile")) end -- make source file for specific modes @@ -601,8 +593,7 @@ function _make_source_file_forspec(vcxprojfile, vsinfo, target, sourcefile, sour for _, info in ipairs(sourceinfo) do -- enter it - local nodename = ifelse(info.sourcekind == "as", "CustomBuild", ifelse(info.sourcekind == "mrc", "ResourceCompile", "ClCompile")) - vcxprojfile:enter("<%s Condition=\"\'%$(Configuration)|%$(Platform)\'==\'%s|%s\'\" Include=\"%s\">", nodename, info.mode, info.arch, sourcefile) + vcxprojfile:enter("<%s Condition=\"\'%$(Configuration)|%$(Platform)\'==\'%s|%s\'\" Include=\"%s\">", ifelse(info.sourcekind == "as", "CustomBuild", "ClCompile"), info.mode, info.arch, sourcefile) -- for *.asm files local objectfile = path.relative(path.absolute(info.objectfile), vcxprojdir) @@ -612,10 +603,6 @@ function _make_source_file_forspec(vcxprojfile, vsinfo, target, sourcefile, sour vcxprojfile:print("<Outputs>%s</Outputs>", objectfile) vcxprojfile:print("<Command>%s /nologo /c %s -Fo%s %s</Command>", ifelse(info.arch == "x64", "ml64", "ml"), os.args(info.flags), objectfile, sourcefile) - -- for *.rc files - elseif sourcekind == "mrc" then - vcxprojfile:print("<ResourceOutputFileName Condition=\"\'%$(Configuration)|%$(Platform)\'==\'%s|%s\'\">%s</ResourceOutputFileName>",info.mode,info.arch,objectfile) - -- for *.c/cpp files else @@ -629,7 +616,7 @@ function _make_source_file_forspec(vcxprojfile, vsinfo, target, sourcefile, sour end -- leave it - vcxprojfile:leave("</%s>", nodename) + vcxprojfile:leave("</%s>", ifelse(info.sourcekind == "as", "CustomBuild", "ClCompile")) end end @@ -671,7 +658,7 @@ function _make_source_files(vcxprojfile, vsinfo, target, vcxprojdir) 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 + if not sourcebatch.rulename and (sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as") then local objectfiles = sourcebatch.objectfiles for idx, sourcefile in ipairs(sourcebatch.sourcefiles) do local objectfile = objectfiles[idx] |
