diff --git a/cmd/v/simple_tool.v b/cmd/v/simple_tool.v index 211c01bcad..d39d6b47cb 100644 --- a/cmd/v/simple_tool.v +++ b/cmd/v/simple_tool.v @@ -20,7 +20,7 @@ fn launch_tool(is_verbose bool, tname string, cmdname string) { } mut compilation_options := os.args[1..tname_index].clone() tool_args := os.args[1..].join(' ') - tool_exe := os.realpath('$vroot/cmd/tools/$tname') + tool_exe := path_of_executable(os.realpath('$vroot/cmd/tools/$tname')) tool_source := os.realpath('$vroot/cmd/tools/${tname}.v') tool_command := '"$tool_exe" $tool_args' if is_verbose { @@ -68,3 +68,10 @@ fn launch_tool(is_verbose bool, tname string, cmdname string) { exit(os.system(tool_command)) } + +fn path_of_executable(path string) string { + $if windows { + return path + '.exe' + } + return path +}