fixup to pass extra_cmake_configs.py - make that accept '-' in a variable name which is valid for CMake
Some checks are pending
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Waiting to run
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Waiting to run
Bazel presubmit checks / other-bazel-checks (push) Waiting to run
Check Configs / check-configs (push) Waiting to run
CMake / build (push) Waiting to run

This commit is contained in:
graham sanderson 2025-07-16 08:58:29 -05:00
parent c5da7301cf
commit 6024f4cd31
4 changed files with 9 additions and 9 deletions

View file

@ -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()

View file

@ -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:

View file

@ -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:

View file

@ -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: