From 54efc65b6ed2dfc86c28ba7cc3f40a6084785026 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 22:41:01 +0800 Subject: ... --- tests/projects/c++/modules/hello/xmake.lua | 2 +- xmake/core/base/interpreter.lua | 8 ++++++-- xmake/core/base/scopeinfo.lua | 8 ++++++-- xmake/core/base/table.lua | 18 ++++++++++++++++++ xmake/core/tool/builder.lua | 6 ++++++ xmake/rules/c++/modules/build_modules/msvc.lua | 6 +++--- 6 files changed, 40 insertions(+), 8 deletions(-) diff --git a/tests/projects/c++/modules/hello/xmake.lua b/tests/projects/c++/modules/hello/xmake.lua index 2315cf287..6a69ce121 100644 --- a/tests/projects/c++/modules/hello/xmake.lua +++ b/tests/projects/c++/modules/hello/xmake.lua @@ -1,4 +1,4 @@ set_languages("c++20") -target("hello") +target("A hello") set_kind("binary") add_files("src/*.cpp", "src/*.mpp") diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index 6f5f0360b..506d8cdad 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -1060,7 +1060,9 @@ function interpreter:api_register_set_values(scope_kind, ...) end -- expand values - values = table.join(table.unpack(values)) + if not extra_config or extra_config.expand ~= false then + values = table.join(table.unpack(values)) + end -- save values if #values > 0 then @@ -1100,7 +1102,9 @@ function interpreter:api_register_add_values(scope_kind, ...) end -- expand values - values = table.join(table.unpack(values)) + if not extra_config or extra_config.expand ~= false then + values = table.join(table.unpack(values)) + end -- save values scope[name] = table.join2(scope[name] or {}, values) diff --git a/xmake/core/base/scopeinfo.lua b/xmake/core/base/scopeinfo.lua index 26be325eb..8a69a9299 100644 --- a/xmake/core/base/scopeinfo.lua +++ b/xmake/core/base/scopeinfo.lua @@ -114,7 +114,9 @@ function _instance:_api_set_values(name, ...) end -- expand values - values = table.join(table.unpack(values)) + if not extra_config or extra_config.expand ~= false then + values = table.join(table.unpack(values)) + end -- handle values local handled_values = self:_api_handle(name, values) @@ -153,7 +155,9 @@ function _instance:_api_add_values(name, ...) end -- expand values - values = table.join(table.unpack(values)) + if not extra_config or extra_config.expand ~= false then + values = table.join(table.unpack(values)) + end -- save values scope[name] = self:_api_handle(name, table.join2(table.wrap(scope[name]), values)) diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua index 2bf776151..9868c93d5 100644 --- a/xmake/core/base/table.lua +++ b/xmake/core/base/table.lua @@ -120,6 +120,24 @@ function table.join2(self, ...) return self end +-- shallow join all objects, it will not expand all table values +function table.shallow_join(...) + local result = {} + for _, t in ipairs({...}) do + table.insert(result, t) + end + return result +end + + +-- shallow join all objects, it will not expand all table values +function table.shallow_join2(self, ...) + for _, t in ipairs({...}) do + table.insert(self, t) + end + return self +end + -- swap items in array function table.swap(array, i, j) local val = array[i] diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index 343eec0ae..8685c34b7 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -136,12 +136,16 @@ function builder:_add_flags_from_flagkind(flags, target, flagkind, opt) local flagconf = extraconf[flag] if flagconf and flagconf.force then table.join2(flags, flag) + print("111") else table.join2(flags, self:_mapflags(flag, flagkind, target)) + print("222") + utils.dump(self:_mapflags(flag, flagkind, target)) end end else table.join2(flags, self:_mapflags(targetflags, flagkind, target)) + print("xxxx") end end @@ -213,11 +217,13 @@ function builder:_add_flags_from_target(flags, target) self:_inherit_flags_from_targetdeps(targetflags, target) end + utils.dump(targetflags) -- add the target flags for _, flagkind in ipairs(self:_flagkinds()) do self:_add_flags_from_flagkind(targetflags, target, flagkind) end cache[key] = targetflags + utils.dump(targetflags) end table.join2(flags, targetflags) end diff --git a/xmake/rules/c++/modules/build_modules/msvc.lua b/xmake/rules/c++/modules/build_modules/msvc.lua index 1dc04618f..2b227e354 100644 --- a/xmake/rules/c++/modules/build_modules/msvc.lua +++ b/xmake/rules/c++/modules/build_modules/msvc.lua @@ -43,7 +43,7 @@ function load_parent(target, opt) local sourcebatches = dep:sourcebatches() if sourcebatches and sourcebatches["c++.build.modules"] then local cachedir = path.join(dep:autogendir(), "rules", "modules", "cache") - target:add("cxxflags", "/ifcSearchDir " .. os.args(cachedir), {force = true}) + target:add("cxxflags", {"/ifcSearchDir", cachedir}, {force = true, expand = false}) end end end @@ -129,7 +129,7 @@ function build_with_batchjobs(target, batchjobs, sourcebatch, opt) local moduledep = assert(moduledeps_files[sourcefile], "moduledep(%s) not found!", sourcefile) moduledep.job = batchjobs:newjob(sourcefile, function (index, total) local opt2 = table.join(opt, {configs = {force = {cxxflags = {interfaceflag, - outputflag .. " " .. os.args(modulefiles[i]), "/TP"}}}}) + {outputflag, modulefiles[i]}, "/TP"}}}}) opt2.progress = (index * 100) / total opt2.objectfile = sourcebatch.objectfiles[i] opt2.dependfile = sourcebatch.dependfiles[i] @@ -149,7 +149,7 @@ function build_with_batchjobs(target, batchjobs, sourcebatch, opt) -- add module flags target:add("cxxflags", modulesflag) if cachedir then - target:add("cxxflags", "/ifcSearchDir " .. os.args(cachedir)) + target:add("cxxflags", {"/ifcSearchDir", cachedir}, {expand = false}) end if stdifcdirflag then for _, toolchain_inst in ipairs(target:toolchains()) do -- cgit v1.3.1 From 168e70b7e06cfcfbadff763fed0d838b92130ad9 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 22:47:48 +0800 Subject: improve modules with space --- .../c++/modules/hello with spaces/src/hello.mpp | 10 ++++++++ .../c++/modules/hello with spaces/src/main.cpp | 6 +++++ .../c++/modules/hello with spaces/xmake.lua | 4 ++++ tests/projects/c++/modules/hello/xmake.lua | 2 +- xmake/core/tool/builder.lua | 27 ++++++++++------------ xmake/rules/c++/modules/build_modules/msvc.lua | 14 ++++++----- 6 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 tests/projects/c++/modules/hello with spaces/src/hello.mpp create mode 100644 tests/projects/c++/modules/hello with spaces/src/main.cpp create mode 100644 tests/projects/c++/modules/hello with spaces/xmake.lua diff --git a/tests/projects/c++/modules/hello with spaces/src/hello.mpp b/tests/projects/c++/modules/hello with spaces/src/hello.mpp new file mode 100644 index 000000000..124bd72bc --- /dev/null +++ b/tests/projects/c++/modules/hello with spaces/src/hello.mpp @@ -0,0 +1,10 @@ +module; +#include + +export module hello; + +export namespace hello { + void say(const char* str) { + printf("%s\n", str); + } +} diff --git a/tests/projects/c++/modules/hello with spaces/src/main.cpp b/tests/projects/c++/modules/hello with spaces/src/main.cpp new file mode 100644 index 000000000..1e5cc698f --- /dev/null +++ b/tests/projects/c++/modules/hello with spaces/src/main.cpp @@ -0,0 +1,6 @@ +import hello; + +int main() { + hello::say("hello module!"); + return 0; +} diff --git a/tests/projects/c++/modules/hello with spaces/xmake.lua b/tests/projects/c++/modules/hello with spaces/xmake.lua new file mode 100644 index 000000000..6a69ce121 --- /dev/null +++ b/tests/projects/c++/modules/hello with spaces/xmake.lua @@ -0,0 +1,4 @@ +set_languages("c++20") +target("A hello") + set_kind("binary") + add_files("src/*.cpp", "src/*.mpp") diff --git a/tests/projects/c++/modules/hello/xmake.lua b/tests/projects/c++/modules/hello/xmake.lua index 6a69ce121..2315cf287 100644 --- a/tests/projects/c++/modules/hello/xmake.lua +++ b/tests/projects/c++/modules/hello/xmake.lua @@ -1,4 +1,4 @@ set_languages("c++20") -target("A hello") +target("hello") set_kind("binary") add_files("src/*.cpp", "src/*.mpp") diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index 8685c34b7..b7ef1fdc0 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -58,11 +58,13 @@ function builder:_mapflag(flag, flagkind, mapflags, auto_ignore_flags) return flag_mapped end - -- find and replace it using pattern - for k, v in pairs(mapflags) do - local flag_mapped, count = flag:gsub("^" .. k .. "$", function (w) return v end) - if flag_mapped and count ~= 0 then - return #flag_mapped ~= 0 and flag_mapped + -- find and replace it using pattern, maybe flag is table, e.g. {"-I", "/xxx"} + if type(flag) == "string" then + for k, v in pairs(mapflags) do + local flag_mapped, count = flag:gsub("^" .. k .. "$", function (w) return v end) + if flag_mapped and count ~= 0 then + return #flag_mapped ~= 0 and flag_mapped + end end end @@ -70,7 +72,7 @@ function builder:_mapflag(flag, flagkind, mapflags, auto_ignore_flags) if auto_ignore_flags == false or self:has_flags(flag, flagkind) then return flag else - utils.warning("add_%s(\"%s\") is ignored, please pass `{force = true}` or call `set_policy(\"check.auto_ignore_flags\", false)` if you want to set it.", flagkind, flag) + utils.warning("add_%s(\"%s\") is ignored, please pass `{force = true}` or call `set_policy(\"check.auto_ignore_flags\", false)` if you want to set it.", flagkind, os.args(flag)) end end @@ -132,20 +134,17 @@ function builder:_add_flags_from_flagkind(flags, target, flagkind, opt) local extraconf = target:extraconf(flagkind) if extraconf then for _, flag in ipairs(table.wrap(targetflags)) do - -- force to add flags? + -- @note we need join the single flag with shallow mode, aboid expand table values + -- e.g. add_cflags({"-I", "/tmp/xxx foo"}, {force = true, expand = false}) local flagconf = extraconf[flag] if flagconf and flagconf.force then - table.join2(flags, flag) - print("111") + table.shallow_join2(flags, flag) else - table.join2(flags, self:_mapflags(flag, flagkind, target)) - print("222") - utils.dump(self:_mapflags(flag, flagkind, target)) + table.shallow_join2(flags, self:_mapflag(flag, flagkind, target)) end end else table.join2(flags, self:_mapflags(targetflags, flagkind, target)) - print("xxxx") end end @@ -217,13 +216,11 @@ function builder:_add_flags_from_target(flags, target) self:_inherit_flags_from_targetdeps(targetflags, target) end - utils.dump(targetflags) -- add the target flags for _, flagkind in ipairs(self:_flagkinds()) do self:_add_flags_from_flagkind(targetflags, target, flagkind) end cache[key] = targetflags - utils.dump(targetflags) end table.join2(flags, targetflags) end diff --git a/xmake/rules/c++/modules/build_modules/msvc.lua b/xmake/rules/c++/modules/build_modules/msvc.lua index 2b227e354..f1062b044 100644 --- a/xmake/rules/c++/modules/build_modules/msvc.lua +++ b/xmake/rules/c++/modules/build_modules/msvc.lua @@ -43,7 +43,7 @@ function load_parent(target, opt) local sourcebatches = dep:sourcebatches() if sourcebatches and sourcebatches["c++.build.modules"] then local cachedir = path.join(dep:autogendir(), "rules", "modules", "cache") - target:add("cxxflags", {"/ifcSearchDir", cachedir}, {force = true, expand = false}) + target:add("cxxflags", {"/ifcSearchDir", os.args(cachedir)}, {force = true, expand = true}) end end end @@ -128,8 +128,10 @@ function build_with_batchjobs(target, batchjobs, sourcebatch, opt) local sourcefile = sourcebatch.sourcefiles[i] local moduledep = assert(moduledeps_files[sourcefile], "moduledep(%s) not found!", sourcefile) moduledep.job = batchjobs:newjob(sourcefile, function (index, total) - local opt2 = table.join(opt, {configs = {force = {cxxflags = {interfaceflag, - {outputflag, modulefiles[i]}, "/TP"}}}}) + local opt2 = table.join(opt, {configs = {force = {cxxflags = { + interfaceflag, + {outputflag, modulefiles[i]}, + "/TP"}}}}) opt2.progress = (index * 100) / total opt2.objectfile = sourcebatch.objectfiles[i] opt2.dependfile = sourcebatch.dependfiles[i] @@ -140,7 +142,7 @@ function build_with_batchjobs(target, batchjobs, sourcebatch, opt) count = count + 1 if count == sourcefiles_total and not cachedir then for _, modulefile in ipairs(modulefiles) do - target:add("cxxflags", referenceflag .. " " .. os.args(modulefile)) + target:add("cxxflags", {referenceflag, os.args(modulefile)}, {force = true, expand = false}) end end end) @@ -149,7 +151,7 @@ function build_with_batchjobs(target, batchjobs, sourcebatch, opt) -- add module flags target:add("cxxflags", modulesflag) if cachedir then - target:add("cxxflags", {"/ifcSearchDir", cachedir}, {expand = false}) + target:add("cxxflags", {"/ifcSearchDir", os.args(cachedir)}, {force = true, expand = false}) end if stdifcdirflag then for _, toolchain_inst in ipairs(target:toolchains()) do @@ -158,7 +160,7 @@ function build_with_batchjobs(target, batchjobs, sourcebatch, opt) if vcvars.VCInstallDir and vcvars.VCToolsVersion then local stdifcdir = path.join(vcvars.VCInstallDir, "Tools", "MSVC", vcvars.VCToolsVersion, "ifc", target:is_arch("x64") and "x64" or "x86") if os.isdir(stdifcdir) then - target:add("cxxflags", stdifcdirflag .. " " .. winos.short_path(stdifcdir)) + target:add("cxxflags", {stdifcdirflag, winos.short_path(stdifcdir)}, {force = true, expand = false}) end end break -- cgit v1.3.1 From 192a777c4bf9cd434f67a7055d4196dfd650d03d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 22:48:33 +0800 Subject: fix search dir --- xmake/rules/c++/modules/build_modules/msvc.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/rules/c++/modules/build_modules/msvc.lua b/xmake/rules/c++/modules/build_modules/msvc.lua index f1062b044..dfaf56b41 100644 --- a/xmake/rules/c++/modules/build_modules/msvc.lua +++ b/xmake/rules/c++/modules/build_modules/msvc.lua @@ -43,7 +43,7 @@ function load_parent(target, opt) local sourcebatches = dep:sourcebatches() if sourcebatches and sourcebatches["c++.build.modules"] then local cachedir = path.join(dep:autogendir(), "rules", "modules", "cache") - target:add("cxxflags", {"/ifcSearchDir", os.args(cachedir)}, {force = true, expand = true}) + target:add("cxxflags", {"/ifcSearchDir", cachedir}, {force = true, expand = true}) end end end @@ -142,7 +142,7 @@ function build_with_batchjobs(target, batchjobs, sourcebatch, opt) count = count + 1 if count == sourcefiles_total and not cachedir then for _, modulefile in ipairs(modulefiles) do - target:add("cxxflags", {referenceflag, os.args(modulefile)}, {force = true, expand = false}) + target:add("cxxflags", {referenceflag, modulefile}, {force = true, expand = false}) end end end) @@ -151,7 +151,7 @@ function build_with_batchjobs(target, batchjobs, sourcebatch, opt) -- add module flags target:add("cxxflags", modulesflag) if cachedir then - target:add("cxxflags", {"/ifcSearchDir", os.args(cachedir)}, {force = true, expand = false}) + target:add("cxxflags", {"/ifcSearchDir", cachedir}, {force = true, expand = false}) end if stdifcdirflag then for _, toolchain_inst in ipairs(target:toolchains()) do -- cgit v1.3.1 From eddc769c19f130c96c2f4cd10200d388383d5bdb Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 23:10:28 +0800 Subject: fix vxmake with spaces --- xmake/plugins/project/vsxmake/vsproj/Xmake.targets | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets index ce78b88e9..e89a40260 100644 --- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets +++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets @@ -62,6 +62,7 @@ <_XmakeCleanFlags>$(_XmakeCleanFlags.Trim()) <_XmakeConfigFlags>$(_XmakeConfigFlags.Trim()) <_XmakeCommonFlags>$(_XmakeCommonFlags.Trim()) + <_XmakeTarget>"$(XmakeTarget.Trim())" <_XmakeExecutable>"$([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)xmake.exe'))" <_XmakeEnv> @@ -97,14 +98,14 @@ $(_XmakeExecutable) config $(_XmakeCommonFlags) $(_XmakeConfigFlags)" EchoOff="true" Condition="'$(XmakeDefault)' != 'false'" /> - + + $(_XmakeExecutable) build $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(_XmakeTarget)" EchoOff="true" Condition="'$(XmakeDefault)' != 'false'" /> - + + $(_XmakeExecutable) build -r $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(_XmakeTarget)" EchoOff="true" Condition="'$(XmakeDefault)' != 'false'" /> @@ -114,14 +115,14 @@ --files="@(File)" - + + $(_XmakeExecutable) build $(_XmakeCommonFlags) $(_XmakeBuildFileFlags) $(FileFlag) $(_XmakeTarget)" EchoOff="true" /> - + + $(_XmakeExecutable) clean $(_XmakeCommonFlags) $(_XmakeCleanFlags) $(_XmakeTarget)" EchoOff="true" Condition="'$(XmakeDefault)' != 'false'" /> -- cgit v1.3.1 From a488013ba3fc29f9d368a10926640f58bfae7678 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 23:11:55 +0800 Subject: fix ci --- .github/workflows/archlinux.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/archlinux.yml b/.github/workflows/archlinux.yml index c9fb04cb4..19dceb588 100644 --- a/.github/workflows/archlinux.yml +++ b/.github/workflows/archlinux.yml @@ -16,12 +16,14 @@ jobs: group: ${{ github.head_ref }}-Archlinux cancel-in-progress: true steps: - - name: Prepare build tools - run: | - pacman -Sy --noconfirm --needed git base-devel perl make unzip - uses: actions/checkout@v2 with: submodules: true + + - name: Prepare build tools + run: | + pacman -Sy --noconfirm --needed git base-devel perl make unzip + - name: prepare local xmake run: | cp -rf . ../xmake-source -- cgit v1.3.1 From 4f95a3d8fbcbadabcecf71fb902c90c75693e433 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 23:32:17 +0800 Subject: fix pdb with spaces --- .github/workflows/archlinux.yml | 8 ++++---- tests/projects/c++/modules/hello with spaces/xmake.lua | 1 + xmake/modules/core/tools/cl.lua | 9 ++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/archlinux.yml b/.github/workflows/archlinux.yml index 19dceb588..035433687 100644 --- a/.github/workflows/archlinux.yml +++ b/.github/workflows/archlinux.yml @@ -16,14 +16,14 @@ jobs: group: ${{ github.head_ref }}-Archlinux cancel-in-progress: true steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Prepare build tools run: | pacman -Sy --noconfirm --needed git base-devel perl make unzip + - uses: actions/checkout@v2 + with: + submodules: true + - name: prepare local xmake run: | cp -rf . ../xmake-source diff --git a/tests/projects/c++/modules/hello with spaces/xmake.lua b/tests/projects/c++/modules/hello with spaces/xmake.lua index 6a69ce121..4f46b699d 100644 --- a/tests/projects/c++/modules/hello with spaces/xmake.lua +++ b/tests/projects/c++/modules/hello with spaces/xmake.lua @@ -1,3 +1,4 @@ +add_rules("mode.release", "mode.debug") set_languages("c++20") target("A hello") set_kind("binary") diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index b76061cd7..b499542e3 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -112,11 +112,14 @@ function nf_symbols(self, levels, target) end -- check and add symbol output file - local pdbflags = "-Fd" .. (target:is_static() and symbolfile or path.join(symboldir, "compile." .. path.filename(symbolfile))) + -- + -- @note we need use `{}` to wrap it to avoid expand it + -- https://github.com/xmake-io/xmake/issues/2061#issuecomment-1042590085 + local pdbflags = {"-Fd" .. (target:is_static() and symbolfile or path.join(symboldir, "compile." .. path.filename(symbolfile)))} if self:has_flags({"-FS", "-Fd" .. os.nuldev() .. ".pdb"}, "cxflags", { flagskey = "-FS -Fd" }) then - pdbflags = {"-FS", pdbflags} + table.insert(pdbflags, 1, "-FS") end - table.join2(flags, pdbflags) + table.insert(flags, pdbflags) end end return flags -- cgit v1.3.1 From bf15cc2a9c3f734463202f7cf14c439c7039396c Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 23:34:33 +0800 Subject: fix ci --- .github/workflows/archlinux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/archlinux.yml b/.github/workflows/archlinux.yml index 035433687..d7c2dac54 100644 --- a/.github/workflows/archlinux.yml +++ b/.github/workflows/archlinux.yml @@ -9,7 +9,7 @@ on: jobs: build: - container: archlinux:base-devel + container: archlinux:base-devel-20220102.0.42924 runs-on: ubuntu-latest concurrency: -- cgit v1.3.1 From 1ca14da621e39e1a71864fdde0ab8da70e64197c Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 23:39:35 +0800 Subject: add mpp for vsxmake --- .../vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters | 1 + .../project/vsxmake/vsproj/templates/vcxproj.filters/File.mpp(filempp) | 3 +++ .../plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj | 1 + .../plugins/project/vsxmake/vsproj/templates/vcxproj/File.mpp(filempp) | 1 + xmake/plugins/project/vsxmake/vsxmake.lua | 3 +++ 5 files changed, 9 insertions(+) create mode 100644 xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.mpp(filempp) create mode 100644 xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.mpp(filempp) diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters index 02ae9b11b..eee3d1a12 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters @@ -38,6 +38,7 @@ #Import(File.c)# #Import(File.cxx)# +#Import(File.mpp)# #Import(File.cu)# diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.mpp(filempp) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.mpp(filempp) new file mode 100644 index 000000000..6588bbf15 --- /dev/null +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.mpp(filempp) @@ -0,0 +1,3 @@ + + #dir# + diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj index 3574c7d4d..111dd454b 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj @@ -38,6 +38,7 @@ #Import(File.c)# #Import(File.cxx)# +#Import(File.mpp)# #Import(File.cu)# diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.mpp(filempp) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.mpp(filempp) new file mode 100644 index 000000000..3df4626b5 --- /dev/null +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.mpp(filempp) @@ -0,0 +1 @@ + diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua index 469448764..d152cc383 100644 --- a/xmake/plugins/project/vsxmake/vsxmake.lua +++ b/xmake/plugins/project/vsxmake/vsxmake.lua @@ -123,6 +123,9 @@ function _buildparams(info, target, default) elseif args.filecxx then local files = info._targets[target].sourcefiles table.insert(r, _filter_files(files, {".cpp", ".cc", ".cxx"})) + elseif args.filempp then + local files = info._targets[target].sourcefiles + table.insert(r, _filter_files(files, {".mpp", ".mxx", ".cppm", ".ixx"})) elseif args.filecu then local files = info._targets[target].sourcefiles table.insert(r, _filter_files(files, {".cu"})) -- cgit v1.3.1 From 834e430450fed1c65bea2341a783b6ea361b0cf4 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 23:43:16 +0800 Subject: fix ci --- .github/workflows/archlinux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/archlinux.yml b/.github/workflows/archlinux.yml index d7c2dac54..812010df8 100644 --- a/.github/workflows/archlinux.yml +++ b/.github/workflows/archlinux.yml @@ -9,7 +9,7 @@ on: jobs: build: - container: archlinux:base-devel-20220102.0.42924 + container: archlinux:base-devel-20211003.0.35663 runs-on: ubuntu-latest concurrency: -- cgit v1.3.1 From bc9295aa19e645432c0edb48b34a66e68a78d96c Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 18 Feb 2022 00:44:49 +0800 Subject: update ci --- .github/workflows/archlinux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/archlinux.yml b/.github/workflows/archlinux.yml index 812010df8..035433687 100644 --- a/.github/workflows/archlinux.yml +++ b/.github/workflows/archlinux.yml @@ -9,7 +9,7 @@ on: jobs: build: - container: archlinux:base-devel-20211003.0.35663 + container: archlinux:base-devel runs-on: ubuntu-latest concurrency: -- cgit v1.3.1