Skip to content

Instantly share code, notes, and snippets.

@chengyi
Created November 27, 2019 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chengyi/b79e9fb3bbb466a98c44c2ad76c9c804 to your computer and use it in GitHub Desktop.
Save chengyi/b79e9fb3bbb466a98c44c2ad76c9c804 to your computer and use it in GitHub Desktop.
compile db generate cmake using compiledb
add_custom_command(
OUTPUT ${COMPDB}
WORKING_DIR ${PROJECT_SOURCE_DIR}/build
COMMAND compiledb -n make
COMMAND cp compile_commands.json ${PROJECT_SOURCE_DIR})
add_custom_target(compdb ALL
COMMAND echo "Generate compile db."
DEPENDS ${COMPDB})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment