-
project tree directory
- project/
- src/
- build/
- project/
-
generate ‘compile_commands.json’ file from ‘project’ toplevel directory.
cmake -S ./src/ -B ./build/ -DCMAKE_EXPORT_COMPILE_COMMANDS=1
-
‘compile_commands.json’ is created in ‘build’ dir
-
link file into ‘src’ directory
cd ./src ln -s ../build/compile_commands.json .
Create 'compile_commands.json' with CMake (13 July, 2021)