mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-09-30 13:58:57 +02:00
generate compile_commands.json and configure clangd
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
|
||||
|
||||
include(ResolveToolchain)
|
||||
|
||||
set(QMK_TOOLCHAIN "arm-none-eabi")
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
# @author Natesh Narain
|
||||
# @since Feb 06 2016
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
|
||||
|
||||
include(ResolveToolchain)
|
||||
|
||||
set(QMK_TOOLCHAIN "avr")
|
||||
@@ -127,6 +129,11 @@ macro(add_qmk_executable target_name)
|
||||
# LINK_FLAGS "-mmcu=${QMK_MCU} ${LINK_OPTIONS}"
|
||||
# )
|
||||
|
||||
# add_custom_target(compileOptions
|
||||
# COMMAND cmake -P ${CMAKE_SOURCE_DIR}/cmake/WriteCompileOptions.cmake
|
||||
# COMMENT "Writing compile_flags.txt"
|
||||
# )
|
||||
|
||||
# generate the lst file
|
||||
add_custom_command(
|
||||
OUTPUT ${lst_file}
|
||||
@@ -161,14 +168,12 @@ macro(add_qmk_executable target_name)
|
||||
|
||||
# build the intel hex file for the device
|
||||
add_custom_target(${target_name} ALL
|
||||
DEPENDS ${hex_file} ${lst_file} "print-size-${elf_file}" "print-size-${hex_file}" copy_hex
|
||||
DEPENDS ${hex_file} ${lst_file} "print-size-${elf_file}" "print-size-${hex_file}" copy_hex
|
||||
)
|
||||
|
||||
set_target_properties(${target_name}
|
||||
PROPERTIES OUTPUT_NAME ${elf_file}
|
||||
)
|
||||
|
||||
# list(JOIN COMPILE_OPTIONS "\n" COMPILE_FLAGS_TXT)
|
||||
# file(WRITE ${CMAKE_SOURCE_DIR}/compile_flags.txt ${COMPILE_FLAGS_TXT})
|
||||
|
||||
endmacro(add_qmk_executable)
|
||||
|
||||
Reference in New Issue
Block a user