summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/vstudio/impl/vs201x.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-04-12 22:28:51 +0800
committerruki <[email protected]>2022-04-12 22:28:51 +0800
commiteb7105bbfb5e5f5b1f88441692bd36a5f3238519 (patch)
treefa86ef4a18a7c9180e3da2d70e26464978a048af /xmake/plugins/project/vstudio/impl/vs201x.lua
parent6cc4a014421e5888c7ad18744ec82ad8e78d9b51 (diff)
improve vs201x again
Diffstat (limited to 'xmake/plugins/project/vstudio/impl/vs201x.lua')
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua
index c660b8772..2560faa77 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x.lua
@@ -117,7 +117,7 @@ function _make_custom_commands_for_target(commands, target, vcxprojdir, suffix)
local script = ruleinst:script(scriptname)
if script then
local batchcmds_ = batchcmds.new({target = target})
- script(target, batchcmds_, {translate_path = function (p) return _translate_path(p) end})
+ script(target, batchcmds_, {})
if not batchcmds_:empty() then
for _, cmd in ipairs(batchcmds_:cmds()) do
local command = _get_command_string(cmd, vcxprojdir)
@@ -134,7 +134,7 @@ function _make_custom_commands_for_target(commands, target, vcxprojdir, suffix)
script = ruleinst:script(scriptname)
if script then
local batchcmds_ = batchcmds.new({target = target})
- script(target, batchcmds_, {translate_path = function (p) return _translate_path(p) end})
+ script(target, batchcmds_, {})
if not batchcmds_:empty() then
for _, cmd in ipairs(batchcmds_:cmds()) do
local command = _get_command_string(cmd, vcxprojdir)
@@ -161,7 +161,7 @@ function _make_custom_commands_for_objectrules(commands, target, sourcebatch, vc
local script = ruleinst:script(scriptname)
if script then
local batchcmds_ = batchcmds.new({target = target})
- script(target, batchcmds_, sourcebatch, {translate_path = function (p) return _translate_path(p) end})
+ script(target, batchcmds_, sourcebatch, {})
if not batchcmds_:empty() then
for _, cmd in ipairs(batchcmds_:cmds()) do
local command = _get_command_string(cmd, vcxprojdir)
@@ -182,7 +182,7 @@ function _make_custom_commands_for_objectrules(commands, target, sourcebatch, vc
local sourcekind = sourcebatch.sourcekind
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
local batchcmds_ = batchcmds.new({target = target})
- script(target, batchcmds_, sourcefile, {translate_path = function (p) return _translate_path(p) end})
+ script(target, batchcmds_, sourcefile, {})
if not batchcmds_:empty() then
for _, cmd in ipairs(batchcmds_:cmds()) do
local command = _get_command_string(cmd, vcxprojdir)
@@ -200,6 +200,10 @@ end
-- make custom commands
function _make_custom_commands(target, vcxprojdir)
+ -- https://github.com/xmake-io/xmake/issues/2258
+ target:data_set("plugin.project.translate_path", function (p)
+ return _translate_path(p, vcxprojdir)
+ end)
local commands = {}
_make_custom_commands_for_target(commands, target, vcxprojdir, "before")
_make_custom_commands_for_target(commands, target, vcxprojdir)