Skip to content

Commit be874b9

Browse files
authored
fix: incorrect macro expansion for $(hostSystemName} on Windows (#272)
1 parent 1b5892f commit be874b9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lua/cmake-tools/preset.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
local Path = require("plenary.path")
2+
local osys = require("cmake-tools.osys")
23

34
local Preset = {}
45

@@ -25,7 +26,7 @@ local function expandMacro(self, str)
2526
if self.generator then
2627
str = str:gsub("${generator}", self.generator)
2728
end
28-
str = str:gsub("${hostSystemName}", vim.loop.os_uname().sysname)
29+
str = str:gsub("${hostSystemName}", osys.iswin32 and "Windows" or vim.loop.os_uname().sysname)
2930
str = str:gsub("${fileDir}", source_path.filename)
3031
str = str:gsub("${dollar}", "$")
3132
str = str:gsub("${pathListSep}", "/")

0 commit comments

Comments
 (0)