feat: support multiple COMPD definitions

This commit is contained in:
Dominik Meyer 2024-11-19 18:20:20 +01:00
parent 86bb4baaf8
commit 64d2732b4e
Signed by: byterazor
GPG Key ID: EABDA0FD5981BC97

View File

@ -10,14 +10,16 @@ find_program(COMPDB_PATH
) )
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
if (COMPDB_PATH) if (COMPDB_PATH)
IF(NOT TARGET COMPD) IF(NOT TARGET COMPD)
add_custom_target(COMPD add_custom_target(COMPD
ALL ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${COMPDB_PATH} -p ${CMAKE_CURRENT_BINARY_DIR} list >compile_commands.json COMMAND ${COMPDB_PATH} -p ${CMAKE_CURRENT_BINARY_DIR} list >compile_commands.json
) )
endif()
endif() endif()
endif() endif()