diff --git a/etc/makefiles/arduino-cli.mk b/etc/makefiles/arduino-cli.mk index 06bd8bde74..0826bbacdb 100644 --- a/etc/makefiles/arduino-cli.mk +++ b/etc/makefiles/arduino-cli.mk @@ -132,8 +132,6 @@ $(ARDUINO_DIRECTORIES_DATA)/arduino-cli.yaml: arduino-update-cores: $(QUIET) $(ARDUINO_CLI) core update-index - - install-arduino-core-kaleidoscope: arduino-update-cores $(QUIET) $(ARDUINO_CLI) core install "keyboardio:avr-tools-only" $(QUIET) $(ARDUINO_CLI) core install "keyboardio:gd32-tools-only" @@ -147,6 +145,20 @@ install-arduino-core-deps: $(QUIET) $(ARDUINO_CLI) core install "keyboardio:gd32-tools-only" +# On arm64 macs, we need rosetta to function +.PHONY: check-rosetta +check-rosetta: + $(QUIET) if [ "$$(uname)" = "Darwin" ]; then \ + if [ "$$(uname -m)" = "arm64" ]; then \ + if ! pgrep oahd >/dev/null 2>&1; then \ + echo "Rosetta 2 is required but not installed. Please install Rosetta 2 and try again."; \ + exit 1; \ + fi; \ + fi; \ + fi + + + # If we're not calling setup, we should freak out if the hardware # definitions don't exist diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index 212e67e849..936b5428fa 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -171,7 +171,7 @@ ifneq ("$(wildcard ${SKETCH_DIR}/.kaleidoscope_board)","") endif -compile: kaleidoscope-hardware-configured +compile: kaleidoscope-hardware-configured check-rosetta -$(QUIET) install -d "${OUTPUT_PATH}" $(QUIET) $(ARDUINO_CLI) compile --fqbn "${FQBN}" ${ARDUINO_VERBOSE} ${ccache_wrapper_property} ${local_cflags_property} \ ${_arduino_local_libraries_prop} ${_ARDUINO_CLI_COMPILE_CUSTOM_FLAGS} ${kaleidoscope_board_config}\