diff options
| author | ruki <[email protected]> | 2018-01-03 00:45:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-01-02 22:30:37 +0800 |
| commit | 37dfc1033f906883a3e7815a879be9286286d5b3 (patch) | |
| tree | 3b062d03c4e46cd6066518a9410098112d56cfe9 /xmake/plugins | |
| parent | 827f07629755347bed82cb51bc1735b2984e284c (diff) | |
fix includedir for vs201x plugin
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index b14e55f46..967c52cb7 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -30,7 +30,7 @@ import("vsfile") -- make compiling flags function _make_compflags(sourcefile, targetinfo, vcxprojdir) - -- translate path for -Idir or /Idir, -Fdsymbol.pdb or /Fdsymbol.pdb + -- translate path for -Idir or /Idir local flags = {} for _, flag in ipairs(targetinfo.compflags[sourcefile]) do @@ -276,6 +276,17 @@ function _make_source_options(vcxprojfile, flags, condition) vcxprojfile:print("<RuntimeLibrary%s>MultiThreaded</RuntimeLibrary>", condition) end + -- make AdditionalIncludeDirectories + if flagstr:find("[%-|/]I") then + local dirs = {} + for _, flag in ipairs(flags) do + flag:gsub("[%-|/]I(.*)", function (dir) table.insert(dirs, dir) end) + end + if #dirs > 0 then + vcxprojfile:print("<AdditionalIncludeDirectories%s>%s</AdditionalIncludeDirectories>", condition, table.concat(dirs, ";")) + end + end + -- complie as c++ if exists flag: /TP if flagstr:find("[%-|/]TP") then vcxprojfile:print("<CompileAs%s>CompileAsCpp</CompileAs>", condition) @@ -283,7 +294,7 @@ function _make_source_options(vcxprojfile, flags, condition) -- make AdditionalOptions local additional_flags = {} - local excludes = {"Os", "O0", "O1", "O2", "Ot", "Ox", "W0", "W1", "W2", "W3", "WX", "Wall", "Zi", "ZI", "Z7", "MT", "MTd", "MD", "MDd", "TP", "Fd", "fp"} + local excludes = {"Os", "O0", "O1", "O2", "Ot", "Ox", "W0", "W1", "W2", "W3", "WX", "Wall", "Zi", "ZI", "Z7", "MT", "MTd", "MD", "MDd", "TP", "Fd", "fp", "I"} for _, flag in ipairs(flags) do local excluded = false for _, exclude in ipairs(excludes) do |
