Skip to content

Converts all Windows paths in a compile_commands.json to WSL compatible ones

Notifications You must be signed in to change notification settings

shyun3/wslpath-compdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wslpath-compdb

Converts all Windows paths in a compile_commands.json to WSL compatible ones.

Prerequisites

This script must be run on WSL, which must have the wslpath utility.

The JSON database must be in "arguments" format, not "command" (see example).

Usage

A compile_commands.json can be generated using compiledb, which can be installed as follows:

pip install git+https://github.com/shyun3/compiledb@support-cl-clang-cl

This fork and branch contains fixes for some issues in the main repo, see #120 and #124.

To generate the database, the following can be used when in the directory of a makefile:

make -Bnwk all | compiledb -f -o /path/to/compile_commands.json

This will create a compile_commands.json at the specified path.

Convert the JSON database using the script:

python3 wslpath_compdb.py -i /path/to/compile_commands.json

Note how the in-place option is used to modify the file.

About

Converts all Windows paths in a compile_commands.json to WSL compatible ones

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages