fully compiling with qmk target

This commit is contained in:
Jack Humbert
2023-04-04 12:46:29 -04:00
parent 6a960cbf05
commit 060c15f32b
7 changed files with 48 additions and 15 deletions
+13
View File
@@ -113,4 +113,17 @@ function(resolve_keymap_c KEYBOARD_FOLDER_ABS KEYMAP_FOLDER KEYMAP_C_STR)
endif()
endif()
endif()
endfunction()
function(resolve_keyboard_includes KEYBOARD_FOLDER_ABS)
if(${IS_KEYBOARDS_FOLDER})
file(RELATIVE_PATH RELATIVE_KEYBOARD_FOLDER ${QMK_KEYBOARDS_FOLDER} ${KEYBOARD_FOLDER_ABS})
# get the deepest config.h
while(NOT ${RELATIVE_KEYBOARD_FOLDER} STREQUAL "")
target_include_directories(qmk PUBLIC "${CMAKE_SOURCE_DIR}/keyboards/${RELATIVE_KEYBOARD_FOLDER}")
get_filename_component(RELATIVE_KEYBOARD_FOLDER ${RELATIVE_KEYBOARD_FOLDER} DIRECTORY)
endwhile()
else()
target_include_directories(qmk PUBLIC "${KEYBOARD_FOLDER_ABS}")
endif()
endfunction()