From 9573d31071b069713ac7bc803777fba65c4ead41 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Mon, 31 Jul 2023 17:32:27 +1000 Subject: [PATCH] all: Remove query-variants make target. This is difficult to implement on cmake-based ports, and having the list of variants in mpconfigboard.{cmake,mk} duplicates information that's already in board.json. This removes the existing query-variants make target from stm32 & rp2 and the definition of BOARD_VARIANTS from the various board files. Also renames the cmake variable to MICROPY_BOARD_VARIANT to match other variables such as MICROPY_BOARD. The make variable stays as BOARD_VARIANT. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared --- extmod/extmod.cmake | 2 +- ports/rp2/Makefile | 7 +------ ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake | 14 ++++++-------- .../ADAFRUIT_METRO_M4_EXPRESS/mpconfigboard.mk | 1 - ports/stm32/Makefile | 3 --- ports/stm32/boards/PYBLITEV10/mpconfigboard.mk | 2 -- ports/stm32/boards/PYBV10/mpconfigboard.mk | 2 -- ports/stm32/boards/PYBV11/mpconfigboard.mk | 2 -- py/mkrules.cmake | 8 +------- 9 files changed, 9 insertions(+), 32 deletions(-) diff --git a/extmod/extmod.cmake b/extmod/extmod.cmake index 7a7b892c96..c8756a682e 100644 --- a/extmod/extmod.cmake +++ b/extmod/extmod.cmake @@ -62,7 +62,7 @@ if(MICROPY_PY_BTREE) set(MICROPY_LIB_BERKELEY_DIR "${MICROPY_DIR}/lib/berkeley-db-1.xx") string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/berkeley-db-1.xx) - if(ECHO_SUBMODULES OR ECHO_QUERY_VARIANTS) + if(ECHO_SUBMODULES) # No-op, we're just doing submodule/variant discovery. # Cannot run the add_library/target_include_directories rules (even though # the build won't run) because IDF will attempt verify the files exist. diff --git a/ports/rp2/Makefile b/ports/rp2/Makefile index 7c14415ad5..ccfc1ac7d6 100644 --- a/ports/rp2/Makefile +++ b/ports/rp2/Makefile @@ -36,7 +36,7 @@ CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Debug endif ifdef BOARD_VARIANT -CMAKE_ARGS += -DBOARD_VARIANT=${BOARD_VARIANT} +CMAKE_ARGS += -DMICROPY_BOARD_VARIANT=$(BOARD_VARIANT) endif HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m" @@ -60,8 +60,3 @@ submodules: @GIT_SUBMODULES=$$(cmake -B $(BUILD)/submodules -DECHO_SUBMODULES=1 ${CMAKE_ARGS} -S . 2>&1 | \ grep '^GIT_SUBMODULES=' | cut -d= -f2); \ $(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$${GIT_SUBMODULES}" submodules - -query-variants: - @BOARD_VARIANTS=$$(cmake -B $(BUILD)/variants -DECHO_BOARD_VARIANTS=1 ${CMAKE_ARGS} -S . 2>&1 | \ - grep '^BOARD_VARIANTS=' | cut -d= -f2); \ - echo "VARIANTS: $${BOARD_VARIANTS}" diff --git a/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake b/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake index 5fd3eec897..28a30f4580 100644 --- a/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake +++ b/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake @@ -7,20 +7,18 @@ list(APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR}) # Freeze board.py set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) -# Provide different variants for the downloads page -set(BOARD_VARIANTS "flash_2mb flash_4mb flash_8mb flash_16mb") - # Select the 16MB variant as the default set(PICO_BOARD "weactstudio_16mb") -if("${BOARD_VARIANT}" STREQUAL "flash_2mb") +# Provide different variants for the downloads page +if(MICROPY_BOARD_VARIANT STREQUAL "flash_2mb") set(PICO_BOARD "weactstudio_2mb") endif() -if("${BOARD_VARIANT}" STREQUAL "flash_4mb") -set(PICO_BOARD "weactstudio_4mb") +if(MICROPY_BOARD_VARIANT STREQUAL "flash_4mb") + set(PICO_BOARD "weactstudio_4mb") endif() -if("${BOARD_VARIANT}" STREQUAL "flash_8mb") -set(PICO_BOARD "weactstudio_8mb") +if(MICROPY_BOARD_VARIANT STREQUAL "flash_8mb") + set(PICO_BOARD "weactstudio_8mb") endif() diff --git a/ports/samd/boards/ADAFRUIT_METRO_M4_EXPRESS/mpconfigboard.mk b/ports/samd/boards/ADAFRUIT_METRO_M4_EXPRESS/mpconfigboard.mk index 1a2635f7af..43ca5a59cc 100644 --- a/ports/samd/boards/ADAFRUIT_METRO_M4_EXPRESS/mpconfigboard.mk +++ b/ports/samd/boards/ADAFRUIT_METRO_M4_EXPRESS/mpconfigboard.mk @@ -7,5 +7,4 @@ TEXT0 = 0x4000 MICROPY_PY_NETWORK ?= 1 MICROPY_PY_NETWORK_NINAW10 ?= 1 -BOARD_VARIANTS += "wlan" MICROPY_HW_CODESIZE ?= 496K diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile index 81a48249e8..2bfd11157e 100644 --- a/ports/stm32/Makefile +++ b/ports/stm32/Makefile @@ -43,9 +43,6 @@ include $(TOP)/extmod/extmod.mk GIT_SUBMODULES += lib/libhydrogen lib/stm32lib -query-variants: - $(ECHO) "VARIANTS:" $(BOARD_VARIANTS) - LD_DIR=boards USBDEV_DIR=usbdev #USBHOST_DIR=usbhost diff --git a/ports/stm32/boards/PYBLITEV10/mpconfigboard.mk b/ports/stm32/boards/PYBLITEV10/mpconfigboard.mk index 461886b63c..afee27e94f 100644 --- a/ports/stm32/boards/PYBLITEV10/mpconfigboard.mk +++ b/ports/stm32/boards/PYBLITEV10/mpconfigboard.mk @@ -6,8 +6,6 @@ TEXT0_ADDR = 0x08000000 TEXT1_ADDR = 0x08020000 # Provide different variants for the downloads page. -BOARD_VARIANTS += "dp thread dp-thread network" - ifeq ($(BOARD_VARIANT),dp) MICROPY_FLOAT_IMPL=double endif diff --git a/ports/stm32/boards/PYBV10/mpconfigboard.mk b/ports/stm32/boards/PYBV10/mpconfigboard.mk index 363f6b4806..d26ebd5ae9 100644 --- a/ports/stm32/boards/PYBV10/mpconfigboard.mk +++ b/ports/stm32/boards/PYBV10/mpconfigboard.mk @@ -16,8 +16,6 @@ endif MICROPY_VFS_LFS2 = 1 # Provide different variants for the downloads page. -BOARD_VARIANTS += "dp thread dp-thread network" - ifeq ($(BOARD_VARIANT),dp) MICROPY_FLOAT_IMPL=double endif diff --git a/ports/stm32/boards/PYBV11/mpconfigboard.mk b/ports/stm32/boards/PYBV11/mpconfigboard.mk index 857049f215..df2d70cda1 100644 --- a/ports/stm32/boards/PYBV11/mpconfigboard.mk +++ b/ports/stm32/boards/PYBV11/mpconfigboard.mk @@ -16,8 +16,6 @@ endif MICROPY_VFS_LFS2 = 1 # Provide different variants for the downloads page. -BOARD_VARIANTS += "dp thread dp-thread network" - ifeq ($(BOARD_VARIANT),dp) MICROPY_FLOAT_IMPL=double endif diff --git a/py/mkrules.cmake b/py/mkrules.cmake index 21d5c27334..02e3148f2b 100644 --- a/py/mkrules.cmake +++ b/py/mkrules.cmake @@ -178,7 +178,7 @@ if(MICROPY_FROZEN_MANIFEST) set(MICROPY_LIB_DIR ${MICROPY_DIR}/lib/micropython-lib) endif() - if(ECHO_SUBMODULES OR ECHO_QUERY_VARIANTS) + if(ECHO_SUBMODULES) # No-op, we're just doing submodule/variant discovery. # Note: All the following rules are safe to run in discovery mode even # though the submodule might not be available as they do not directly depend @@ -223,9 +223,3 @@ if(ECHO_SUBMODULES) execute_process(COMMAND ${CMAKE_COMMAND} -E echo "GIT_SUBMODULES=${GIT_SUBMODULES}") message(FATAL_ERROR "Done") endif() - -# Display BOARD_VARIANTS -if(ECHO_BOARD_VARIANTS) - execute_process(COMMAND ${CMAKE_COMMAND} -E echo "BOARD_VARIANTS=${BOARD_VARIANTS}") - message(FATAL_ERROR "Done") -endif()