diff options
| author | Jérôme Leclercq <[email protected]> | 2021-12-11 23:46:36 +0100 |
|---|---|---|
| committer | Jérôme Leclercq <[email protected]> | 2021-12-11 23:46:36 +0100 |
| commit | 6291b59a2433a4349dbd51e88290297349130ca6 (patch) | |
| tree | 7d5b3c8f24ef46da9fd64d7446ef6d87acce07d1 | |
| parent | d1cd32f266309971b033b2941abcf8aa02242501 (diff) | |
project/vstudio: add rundir handling
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x.lua | 4 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index 3c7d62737..d835a4270 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -32,6 +32,7 @@ import("vs201x_vcxproj") import("vs201x_vcxproj_filters") import("core.cache.memcache") import("core.cache.localcache") +import("private.action.run.make_runenvs") import("private.action.require.install", {alias = "install_requires"}) import("actions.config.configfiles", {alias = "generate_configfiles", rootdir = os.programdir()}) import("actions.config.configheader", {alias = "generate_configheader", rootdir = os.programdir()}) @@ -243,6 +244,9 @@ function _make_targetinfo(mode, arch, target) local linkflags = linker.linkflags(target:kind(), target:sourcekinds(), {target = target}) targetinfo.linkflags = linkflags + -- save execution dir (when executed from VS) + targetinfo.rundir = target:rundir() + -- use mfc? save the mfc runtime kind if target:rule("win.sdk.mfc.shared_app") or target:rule("win.sdk.mfc.shared") then targetinfo.usemfc = "Dynamic" diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index 5b82dd7a2..19a1b20bd 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -213,6 +213,13 @@ function _make_configurations(vcxprojfile, vsinfo, target, vcxprojdir) vcxprojfile:leave("</PropertyGroup>") end + -- make Debugger + for _, targetinfo in ipairs(target.info) do + vcxprojfile:enter("<PropertyGroup Condition=\"\'%$(Configuration)|%$(Platform)\'==\'%s|%s\'\" Label=\"Debugger\">", targetinfo.mode, targetinfo.arch) + vcxprojfile:print("<LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>", targetinfo.rundir) + vcxprojfile:leave("</PropertyGroup>") + end + -- import Microsoft.Cpp.props vcxprojfile:print("<Import Project=\"%$(VCTargetsPath)\\Microsoft.Cpp.props\" />") |
