json2cmake
json2cmake copied to clipboard
Windows paths should use forward slash
When running on Windows, we output paths like "c:\users\..."
, and \u
is interpreted as an escape sequence. We should instead output "c:/users/..."
even if the compile_commands.json
uses backslashes.
I believe this issue can be resolved by replacing the return statement of the resolve(path) function on line 96 of __init__.py with the following code:
if sys.platform.startswith('win32'):
return os.path.normcase(os.path.normpath(path)).replace("\\", "/") # Windows fix so that paths have correct slashes
else:
return os.path.normcase(os.path.normpath(path))