summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-14 21:48:59 +0800
committerGitHub <[email protected]>2019-08-14 21:48:59 +0800
commite339a14e189e57fb8bf4ff778a7d170cf6af2c1c (patch)
treec0ff730c0f335761df34b73799da04bf3675865a /xmake/plugins
parent4c2f262933bc2712d39b89a68d2289ff17e5ceba (diff)
parentebe4099e7ea32b023edfc7a5559db5d1d5262e20 (diff)
Merge pull request #525 from OpportunityLiu/dev
save config flags
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua9
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.targets9
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch)1
3 files changed, 12 insertions, 7 deletions
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 906148fa2..8f456bc38 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,14 @@ 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 .. "=" .. 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 @@
<Exec StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
$(_XmakeExecutable) config $(_XmakeCommonFlags) $(_XmakeConfigFlags) $(XmakeTarget)" EchoOff="true" />
</Target>
- <Target Name="_XmakeReconfig" DependsOnTargets="_XmakeProjCheck">
- <Message Text="$xmake config $(_XmakeCommonFlags) -c $(_XmakeConfigFlags) $(XmakeTarget)" Importance="High" />
- <Exec StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
- $(_XmakeExecutable) config $(_XmakeCommonFlags) -c $(_XmakeConfigFlags) $(XmakeTarget)" EchoOff="true" />
- </Target>
<Target Name="_XmakeBuild" DependsOnTargets="_XmakeProjCheck">
<Message Text="$xmake build $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(XmakeTarget)" Importance="High" />
<Exec StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
@@ -203,7 +198,7 @@ MSBuild Properties:
<Target Name="Clean" Condition="'$(DesignTimeBuild)' != 'true'">
<CallTarget Targets="Show" Condition="$(XmakeDiagnosis)" />
<CallTarget Targets="BeforeClean" />
- <CallTarget Targets="_XmakeClean;_XmakeReconfig" />
+ <CallTarget Targets="_XmakeClean;_XmakeConfig" />
<CallTarget Targets="AfterClean" />
</Target>
@@ -213,7 +208,7 @@ MSBuild Properties:
<CallTarget Targets="Show" Condition="$(XmakeDiagnosis)" />
<CallTarget Targets="BeforeRebuild" />
<CallTarget Targets="BeforeClean" />
- <CallTarget Targets="_XmakeClean;_XmakeReconfig" />
+ <CallTarget Targets="_XmakeClean;_XmakeConfig" />
<CallTarget Targets="AfterClean" />
<CallTarget Targets="BeforeBuild" />
<CallTarget Targets="_XmakeBuild" />
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 @@
<XmakeCudaVersion>#cudaver#</XmakeCudaVersion>
<XmakeMfcKind>#mfckind#</XmakeMfcKind>
<XmakeRunEnvs>#runenvs#</XmakeRunEnvs>
+ <XmakeConfigFlags>#configflags#</XmakeConfigFlags>
</PropertyGroup>