mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 04:41:28 +00:00
fully compiling with qmk target
This commit is contained in:
parent
6a960cbf05
commit
060c15f32b
11
.vscode/tasks.json
vendored
11
.vscode/tasks.json
vendored
@ -16,7 +16,7 @@
|
||||
{
|
||||
"label": "Load Keyboard",
|
||||
"type": "shell",
|
||||
"command": "cmake -Bbuild -DQMK_KEYBOARD_FOLDER=${input:keyboard}",
|
||||
"command": "cmake -Bbuild -DQMK_KEYBOARD_FOLDER=${input:all_keyboards}",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
@ -90,6 +90,15 @@
|
||||
"description": "Target:",
|
||||
"fieldSeparator": "|"
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "all_keyboards",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": "type build\\all_keyboards",
|
||||
"description": "Keyboard:"
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
@ -103,6 +103,8 @@ endif()
|
||||
|
||||
add_library(qmk)
|
||||
|
||||
resolve_keyboard_includes(${QMK_KEYBOARD_FOLDER_ABS})
|
||||
|
||||
add_subdirectory(quantum)
|
||||
add_subdirectory(platforms)
|
||||
add_subdirectory(tmk_core/protocol)
|
||||
|
@ -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()
|
@ -4,27 +4,27 @@ set_property(CACHE BACKLIGHT_DRIVER PROPERTY STRINGS pwm timer software custom)
|
||||
|
||||
string(JSON BACKLIGHT_PIN ERROR_VARIABLE NO_BACKLIGHT_PIN GET ${QMK_KEYBOARD_INFO_JSON_STRING} backlight pin)
|
||||
if(${BACKLIGHT_ENABLE} AND NOT ${NO_BACKLIGHT_PIN} STREQUAL "backlight-NOTFOUND")
|
||||
add_library(backlight
|
||||
target_sources(qmk PUBLIC
|
||||
quantum/backlight/backlight.c
|
||||
quantum/process_keycode/process_backlight.c
|
||||
)
|
||||
add_compile_definitions(
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
BACKLIGHT_ENABLE
|
||||
BACKLIGHT_PIN=${BACKLIGHT_PIN}
|
||||
)
|
||||
if(${BACKLIGHT_DRIVER} STREQUAL "custom")
|
||||
add_compile_definitions(BACKLIGHT_CUSTOM_DRIVER)
|
||||
target_compile_definitions(qmk PUBLIC BACKLIGHT_CUSTOM_DRIVER)
|
||||
else()
|
||||
target_sources(backlight PRIVATE quantum/backlight/backlight_driver_common.c)
|
||||
target_sources(qmk PUBLIC quantum/backlight/backlight_driver_common.c)
|
||||
if(${BACKLIGHT_DRIVER} STREQUAL "pwm")
|
||||
target_sources(backlight PRIVATE quantum/backlight/backlight_${QMK_PLATFORM}.c)
|
||||
target_sources(qmk PUBLIC quantum/backlight/backlight_${QMK_PLATFORM}.c)
|
||||
else()
|
||||
target_sources(backlight PRIVATE quantum/backlight/backlight_${BACKLIGHT_DRIVER}.c)
|
||||
target_sources(qmk PUBLIC quantum/backlight/backlight_${BACKLIGHT_DRIVER}.c)
|
||||
endif()
|
||||
endif()
|
||||
target_include_directories(qmk PUBLIC quantum/backlight)
|
||||
target_include_directories(qmk PUBLIC drivers/oled)
|
||||
target_link_libraries(backlight qmk)
|
||||
# target_link_libraries(backlight qmk)
|
||||
# target_include_directories(backlight PUBLIC quantum/backlight)
|
||||
# target_include_directories(quantum PUBLIC quantum/backlight)
|
||||
# target_link_libraries(backlight ${QMK_TARGET})
|
||||
|
@ -1,13 +1,13 @@
|
||||
option(OLED_ENABLE "" TRUE)
|
||||
if(${OLED_ENABLE})
|
||||
add_library(oled
|
||||
target_sources(qmk PUBLIC
|
||||
drivers/oled/ssd1306_sh1106.c
|
||||
platforms/${QMK_PLATFORM}/drivers/i2c_master.c)
|
||||
add_compile_definitions(OLED_ENABLE)
|
||||
target_include_directories(oled PUBLIC drivers)
|
||||
target_include_directories(oled PUBLIC drivers/oled)
|
||||
target_include_directories(oled PUBLIC platforms/${QMK_PLATFORM}/drivers)
|
||||
target_link_libraries(oled qmk)
|
||||
target_compile_definitions(qmk PUBLIC OLED_ENABLE)
|
||||
target_include_directories(qmk PUBLIC drivers)
|
||||
target_include_directories(qmk PUBLIC drivers/oled)
|
||||
target_include_directories(qmk PUBLIC platforms/${QMK_PLATFORM}/drivers)
|
||||
# target_link_libraries(oled qmk)
|
||||
# target_link_libraries(oled ${QMK_TARGET})
|
||||
# target_link_libraries(oled platforms)
|
||||
endif()
|
||||
|
@ -16,4 +16,13 @@ foreach(KEYBOARD_CMAKE ${KEYBOARDS})
|
||||
get_filename_component(KEYBOARD_FOLDER_ABS "${KEYBOARD_CMAKE}" DIRECTORY)
|
||||
file(RELATIVE_PATH KEYBOARD_FOLDER "${CMAKE_SOURCE_DIR}/keyboards" "${KEYBOARD_FOLDER_ABS}")
|
||||
add_keyboard(${KEYBOARD_FOLDER} "default")
|
||||
endforeach()
|
||||
|
||||
file(GLOB_RECURSE POSSIBLE_KEYBOARDS **/info.json)
|
||||
|
||||
file(WRITE "${CMAKE_SOURCE_DIR}/build/all_keyboards" "")
|
||||
foreach(KEYBOARD_INFO ${POSSIBLE_KEYBOARDS})
|
||||
get_filename_component(KEYBOARD_FOLDER_ABS "${KEYBOARD_INFO}" DIRECTORY)
|
||||
file(RELATIVE_PATH KEYBOARD_FOLDER "${CMAKE_SOURCE_DIR}/keyboards" "${KEYBOARD_FOLDER_ABS}")
|
||||
file(APPEND "${CMAKE_SOURCE_DIR}/build/all_keyboards" "${KEYBOARD_FOLDER}\n")
|
||||
endforeach()
|
@ -4,7 +4,7 @@ target_sources(qmk PUBLIC
|
||||
usb_device_state.c
|
||||
usb_util.c
|
||||
)
|
||||
add_compile_definitions(
|
||||
target_compile_definitions(
|
||||
# MOUSE_ENABLED
|
||||
# EXTRAKEY_ENABLE
|
||||
# NKRO_ENABLE
|
||||
|
Loading…
Reference in New Issue
Block a user