diff --git a/cmake/pico_pre_load_platform.cmake b/cmake/pico_pre_load_platform.cmake index df511ece..e5c56974 100644 --- a/cmake/pico_pre_load_platform.cmake +++ b/cmake/pico_pre_load_platform.cmake @@ -15,23 +15,23 @@ set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}") # If PICO_PLATFORM is specified but not PICO_BOARD, we'll make a stab at defaulting if (NOT PICO_DEFAULT_BOARD_rp2040) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2040, The default PICO_BOARD for PICO_PLATFORM=rp2040, type=string, default=pico, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2040, The default PICO_BOARD for PICO_PLATFORM==rp2040, type=string, default=pico, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2040 "pico") endif() if (NOT PICO_DEFAULT_BOARD_rp2350) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350, The default PICO_BOARD for PICO_PLATFORM=rp2350, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350, The default PICO_BOARD for PICO_PLATFORM==rp2350, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350 "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-arm-s) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-arm-s, The default PICO_BOARD for PICO_PLATFORM=rp2350-arm-s, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-arm-s, The default PICO_BOARD for PICO_PLATFORM==rp2350-arm-s, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350-arm-s "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-riscv) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-riscv, The default PICO_BOARD for PICO_PLATFORM=rp2350-riscv, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-riscv, The default PICO_BOARD for PICO_PLATFORM==rp2350-riscv, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350-riscv "pico2") endif() if (NOT PICO_DEFAULT_BOARD_host) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_host, The default PICO_BOARD for PICO_PLATFORM=host, type=string, default=none, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_host, The default PICO_BOARD for PICO_PLATFORM==host, type=string, default=none, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_host "none") endif() diff --git a/tools/extract_build_defines.py b/tools/extract_build_defines.py index 8df16ee8..8f09da59 100755 --- a/tools/extract_build_defines.py +++ b/tools/extract_build_defines.py @@ -160,7 +160,7 @@ for dirpath, dirnames, filenames in os.walk(scandir): # allow commas to appear inside brackets by converting them to and from NULL chars _attrs = re.sub(r'(\(.+\))', lambda m: m.group(1).replace(',', '\0'), _attrs) - if '=' in config_description: + if '=' in config_description and not '==' in config_description: errors.append(Exception("For {} at {}:{} the description was set to '{}' - has the description field been omitted?".format(config_name, file_path, linenum, config_description))) all_descriptions = chips_all_descriptions[applicable] if config_description in all_descriptions: diff --git a/tools/extract_cmake_configs.py b/tools/extract_cmake_configs.py index b86df28d..cf930386 100755 --- a/tools/extract_cmake_configs.py +++ b/tools/extract_cmake_configs.py @@ -44,7 +44,7 @@ BASE_CMAKE_CONFIG_RE = re.compile(r'\b{}\b'.format(BASE_CMAKE_CONFIG_NAME)) BASE_BUILD_DEFINE_NAME = 'PICO_BUILD_DEFINE' BASE_BUILD_DEFINE_RE = re.compile(r'\b{}\b'.format(BASE_BUILD_DEFINE_NAME)) -CMAKE_CONFIG_RE = re.compile(r'#\s+{}:\s+(\w+),\s+([^,]+)(?:,\s+(.*))?$'.format(BASE_CMAKE_CONFIG_NAME)) +CMAKE_CONFIG_RE = re.compile(r'#\s+{}:\s+([\w-]+),\s+([^,]+)(?:,\s+(.*))?$'.format(BASE_CMAKE_CONFIG_NAME)) ALLOWED_CONFIG_PROPERTIES = set(['type', 'default', 'min', 'max', 'group', 'advanced', 'docref']) @@ -159,7 +159,7 @@ for dirpath, dirnames, filenames in os.walk(scandir): # allow commas to appear inside brackets by converting them to and from NULL chars _attrs = re.sub(r'(\(.+\))', lambda m: m.group(1).replace(',', '\0'), _attrs) - if '=' in config_description: + if '=' in config_description and not '==' in config_description: errors.append(Exception("For {} at {}:{} the description was set to '{}' - has the description field been omitted?".format(config_name, file_path, linenum, config_description))) all_descriptions = chips_all_descriptions[applicable] if config_description in all_descriptions: diff --git a/tools/extract_configs.py b/tools/extract_configs.py index a95870c6..ad2cc248 100755 --- a/tools/extract_configs.py +++ b/tools/extract_configs.py @@ -178,7 +178,7 @@ for dirpath, dirnames, filenames in os.walk(scandir): # allow commas to appear inside brackets by converting them to and from NULL chars _attrs = re.sub(r'(\(.+\))', lambda m: m.group(1).replace(',', '\0'), _attrs) - if '=' in config_description: + if '=' in config_description and not '==' in config_description: errors.append(Exception("For {} at {}:{} the description was set to '{}' - has the description field been omitted?".format(config_name, file_path, linenum, config_description))) all_descriptions = chips_all_descriptions[applicable] if config_description in all_descriptions: