From 68304abfa5a7596f6833fb5eb9159a54f793d4f4 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Wed, 14 Aug 2019 17:15:20 +0800 Subject: save config flags --- xmake/plugins/project/vsxmake/getinfo.lua | 10 ++++++++++ xmake/plugins/project/vsxmake/vsproj/Xmake.targets | 9 ++------- .../vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch) | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 906148fa2..5364e120b 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -22,6 +22,7 @@ import("core.base.option") import("core.base.semver") import("core.project.config") +import("core.project.cache") import("core.project.project") import("core.platform.platform") import("core.platform.environment") @@ -162,6 +163,15 @@ function _make_targetinfo(mode, arch, target) -- save defines targetinfo.defines = _make_arrs(_get_values(target, "defines")) targetinfo.languages = _make_arrs(_get_values(target, "languages")) + local configcache = cache("local.config") + local flags = {} + for k, v in pairs(configcache:get("options_" .. target:name())) do + if k ~= "plat" and k ~= "mode" and k ~= arch then + table.insert(flags, "--" .. k) + table.insert(flags, tostring(v)); + end + end + targetinfo.configflags = os.args(flags) -- save runenvs local runenvs = {} diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets index 19bc4afaf..6c61a33d4 100644 --- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets +++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets @@ -91,11 +91,6 @@ - - - - - + @@ -213,7 +208,7 @@ MSBuild Properties: - + diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch) index 341c807f9..317dc32e4 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch) @@ -10,4 +10,5 @@ #cudaver# #mfckind# #runenvs# + #configflags# -- cgit v1.3.1 From 7737be6dff57b0f85aa62ec8fa9e147b8fe9e6ff Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Wed, 14 Aug 2019 17:17:26 +0800 Subject: fix --- xmake/plugins/project/vsxmake/getinfo.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 5364e120b..2e9e8ebee 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -166,7 +166,7 @@ function _make_targetinfo(mode, arch, target) local configcache = cache("local.config") local flags = {} for k, v in pairs(configcache:get("options_" .. target:name())) do - if k ~= "plat" and k ~= "mode" and k ~= arch then + if k ~= "plat" and k ~= "mode" and k ~= "arch" then table.insert(flags, "--" .. k) table.insert(flags, tostring(v)); end -- cgit v1.3.1 From ebe4099e7ea32b023edfc7a5559db5d1d5262e20 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Wed, 14 Aug 2019 17:28:09 +0800 Subject: fix --- xmake/plugins/project/vsxmake/getinfo.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 2e9e8ebee..8f456bc38 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -167,8 +167,7 @@ function _make_targetinfo(mode, arch, target) local flags = {} for k, v in pairs(configcache:get("options_" .. target:name())) do if k ~= "plat" and k ~= "mode" and k ~= "arch" then - table.insert(flags, "--" .. k) - table.insert(flags, tostring(v)); + table.insert(flags, "--" .. k .. "=" .. tostring(v)); end end targetinfo.configflags = os.args(flags) -- cgit v1.3.1