basic json validator supporting most used properties. converted some regex to cmake-compatible expressions

This commit is contained in:
Jack Humbert
2023-04-03 13:19:45 -04:00
parent d5760d02a6
commit 2ebad0d33f
8 changed files with 240 additions and 28 deletions
+5 -2
View File
@@ -27,8 +27,11 @@ macro(add_keyboard KEYBOARD_FOLDER KEYMAP_FOLDER)
endif()
# find the right toolchain
message(STATUS "Reading config from ${KEYBOARD_FOLDER_ABS}/info.json")
file(READ ${KEYBOARD_FOLDER_ABS}/info.json JSON_STRING)
# not sure we need to validate here
include(ValidateJSON)
validate_json(${KEYBOARD_FOLDER_ABS}/info.json keyboard JSON_STRING)
string(JSON PROCESSOR GET ${JSON_STRING} processor)
if(${PROCESSOR} MATCHES "^at.*")
set(PLATFORM "avr")