2020-04-22 06:20:34 +10:00
|
|
|
cmake_minimum_required(VERSION 3.13.1)
|
2020-04-26 12:41:20 +10:00
|
|
|
|
2020-06-20 05:32:33 +10:00
|
|
|
set(CONFIG_APPLICATION_DEFINED_SYSCALL true)
|
2020-05-02 04:58:00 +10:00
|
|
|
list(APPEND BOARD_ROOT ${CMAKE_SOURCE_DIR})
|
2020-05-06 06:09:05 +10:00
|
|
|
list(APPEND DTS_ROOT ${CMAKE_SOURCE_DIR})
|
2020-04-22 06:20:34 +10:00
|
|
|
|
2020-05-27 10:48:15 +10:00
|
|
|
# Add our custom Zephyr module for drivers w/ syscalls, etc.
|
|
|
|
list(APPEND DTS_ROOT ${CMAKE_SOURCE_DIR}/drivers/zephyr)
|
|
|
|
|
|
|
|
list(APPEND ZEPHYR_EXTRA_MODULES
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers
|
|
|
|
)
|
|
|
|
|
2020-06-14 06:37:31 +10:00
|
|
|
include(cmake/zmk_config.cmake)
|
2020-05-17 07:30:30 +10:00
|
|
|
|
2020-08-20 20:59:41 +10:00
|
|
|
# Find Zephyr. This also loads Zephyr's build system.
|
2020-06-14 06:37:31 +10:00
|
|
|
find_package(Zephyr REQUIRED HINTS ../zephyr)
|
2020-04-22 06:20:34 +10:00
|
|
|
project(zmk)
|
|
|
|
|
2020-06-30 14:31:09 +10:00
|
|
|
zephyr_linker_sources(RODATA include/linker/zmk-events.ld)
|
2020-05-18 23:11:46 +10:00
|
|
|
|
2020-04-22 06:20:34 +10:00
|
|
|
# Add your source file to the "app" target. This must come after
|
|
|
|
# find_package(Zephyr) which defines the target.
|
2020-05-11 07:13:24 +10:00
|
|
|
target_include_directories(app PRIVATE include)
|
2020-10-02 16:09:38 +10:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_SLEEP app PRIVATE src/power.c)
|
2020-12-01 16:52:32 +11:00
|
|
|
target_sources(app PRIVATE src/activity.c)
|
2020-05-02 09:14:18 +10:00
|
|
|
target_sources(app PRIVATE src/kscan.c)
|
2020-06-21 07:54:52 +10:00
|
|
|
target_sources(app PRIVATE src/matrix_transform.c)
|
2020-05-15 23:41:06 +10:00
|
|
|
target_sources(app PRIVATE src/hid.c)
|
2020-07-23 01:08:52 +10:00
|
|
|
target_sources(app PRIVATE src/sensors.c)
|
2021-01-23 03:23:21 +11:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/wpm.c)
|
2020-06-30 14:31:09 +10:00
|
|
|
target_sources(app PRIVATE src/event_manager.c)
|
2020-10-06 18:52:21 +11:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.c)
|
2020-12-01 16:52:32 +11:00
|
|
|
target_sources(app PRIVATE src/events/activity_state_changed.c)
|
2020-06-30 14:31:09 +10:00
|
|
|
target_sources(app PRIVATE src/events/position_state_changed.c)
|
2020-12-10 01:35:57 +11:00
|
|
|
target_sources(app PRIVATE src/events/layer_state_changed.c)
|
2020-07-01 00:43:09 +10:00
|
|
|
target_sources(app PRIVATE src/events/keycode_state_changed.c)
|
|
|
|
target_sources(app PRIVATE src/events/modifiers_state_changed.c)
|
2021-08-03 11:44:01 +10:00
|
|
|
target_sources(app PRIVATE src/events/endpoint_selection_changed.c)
|
2020-07-23 01:08:52 +10:00
|
|
|
target_sources(app PRIVATE src/events/sensor_event.c)
|
2021-01-23 03:23:21 +11:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/events/wpm_state_changed.c)
|
2020-09-09 13:26:00 +10:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/events/ble_active_profile_changed.c)
|
2020-11-02 16:10:21 +11:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/events/battery_state_changed.c)
|
2020-10-12 09:03:21 +11:00
|
|
|
target_sources_ifdef(CONFIG_USB app PRIVATE src/events/usb_conn_state_changed.c)
|
2020-12-13 15:13:49 +11:00
|
|
|
if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
|
2020-09-09 13:26:00 +10:00
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_key_press.c)
|
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_reset.c)
|
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_hold_tap.c)
|
2020-11-12 08:09:08 +11:00
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_sticky_key.c)
|
2020-09-09 13:26:00 +10:00
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_momentary_layer.c)
|
2020-12-27 00:46:56 +11:00
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_mod_morph.c)
|
2020-10-28 05:49:28 +11:00
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_outputs.c)
|
2020-09-09 13:26:00 +10:00
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_toggle_layer.c)
|
2020-12-30 03:57:49 +11:00
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_to_layer.c)
|
2020-09-09 13:26:00 +10:00
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_transparent.c)
|
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_none.c)
|
|
|
|
target_sources(app PRIVATE src/behaviors/behavior_sensor_rotate_key_press.c)
|
2020-10-10 12:29:07 +11:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/behaviors/behavior_ext_power.c)
|
2020-12-12 09:24:44 +11:00
|
|
|
target_sources(app PRIVATE src/combo.c)
|
2020-09-09 13:26:00 +10:00
|
|
|
target_sources(app PRIVATE src/keymap.c)
|
|
|
|
endif()
|
2020-07-25 13:48:48 +10:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_rgb_underglow.c)
|
2020-08-29 04:15:16 +10:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/behaviors/behavior_bt.c)
|
2020-05-18 23:11:46 +10:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/ble.c)
|
2020-10-28 07:10:59 +11:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/battery.c)
|
2020-12-13 15:13:49 +11:00
|
|
|
if (CONFIG_ZMK_SPLIT_BLE AND (NOT CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL))
|
|
|
|
target_sources(app PRIVATE src/split_listener.c)
|
|
|
|
target_sources(app PRIVATE src/split/bluetooth/service.c)
|
|
|
|
endif()
|
|
|
|
if (CONFIG_ZMK_SPLIT_BLE AND CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
|
|
|
|
target_sources(app PRIVATE src/split/bluetooth/central.c)
|
|
|
|
endif()
|
2020-10-05 09:18:44 +11:00
|
|
|
target_sources_ifdef(CONFIG_USB app PRIVATE src/usb.c)
|
2020-05-18 23:11:46 +10:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/hog.c)
|
2020-07-24 16:06:56 +10:00
|
|
|
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c)
|
2020-05-13 04:15:33 +10:00
|
|
|
target_sources(app PRIVATE src/endpoints.c)
|
2020-07-31 14:07:16 +10:00
|
|
|
target_sources(app PRIVATE src/hid_listener.c)
|
2020-04-22 06:20:34 +10:00
|
|
|
target_sources(app PRIVATE src/main.c)
|
2020-09-01 06:24:36 +10:00
|
|
|
|
2020-09-01 00:18:19 +10:00
|
|
|
add_subdirectory(src/display/)
|
|
|
|
|
2020-08-29 04:15:16 +10:00
|
|
|
zephyr_cc_option(-Wfatal-errors)
|