Skip to content

Commit 1698299

Browse files
authored
Merge pull request #285 from CruizK/master
fix(windows): Fixed cmake run command using forward slashes instead of backslashes
2 parents 4e134ed + 5c36732 commit 1698299

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

lua/cmake-tools/config.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ end
258258

259259
function Config:get_launch_target_from_info(target_info)
260260
local target_path = target_info["artifacts"][1]["path"]
261+
if require("cmake-tools.osys").iswin32 then
262+
target_path = target_path:gsub("/", "\\")
263+
end
261264
target_path = Path:new(target_path)
262265
if not target_path:is_absolute() then
263266
-- then it is a relative path, based on build directory

lua/cmake-tools/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ function cmake.create_regenerate_on_save_autocmd()
14031403

14041404
local cwd = config.cwd
14051405
if require("cmake-tools.osys").iswin32 then
1406-
cwd = config.cwd:gsub("\\", "/")
1406+
cwd = config.cwd:gsub("\\", "/")
14071407
end
14081408

14091409
local presets_exists = config.base_settings.use_preset and Presets.exists(config.cwd)

0 commit comments

Comments
 (0)