From a1153b8831c46a8b0e47831c29392a265bb3e074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Moskal?= Date: Tue, 3 Dec 2024 14:12:16 -0800 Subject: [PATCH] Write down how to build C++ locally (#6569) --- docs/developer/local-cpp.md | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 docs/developer/local-cpp.md diff --git a/docs/developer/local-cpp.md b/docs/developer/local-cpp.md new file mode 100644 index 00000000000..a7147701e5c --- /dev/null +++ b/docs/developer/local-cpp.md @@ -0,0 +1,49 @@ +# Local C++ development setup + +Install ARM GCC https://developer.arm.com/downloads/-/gnu-rm 10.3 + +```bash +npm install -g pxt # cmd line tool +cd pxt-arcade +npm install +pxt link ../pxt +pxt link ../pxt-common-packages +pxt serve --rebundle # and stop it +mkdir -p projects/myprj +cd projects/myprj +``` + +Create the following files (replacing with rp2040 with the target you need): + +`pxt.json` + +```json +{ + "name": "myprj", + "version": "0.0.0", + "dependencies": { + "hw": "file:../../libs/hw---rp2040", + "device": "file:../../libs/device" + }, + "files": [ + "main.ts" + ], + "supportedTargets": [ + "arcade" + ] +} +``` + +`main.ts` + +```typescript +let mySprite = sprites.create(sprites.duck.duck1) +mySprite.ay = 50 +mySprite.setStayInScreen(true) +``` + +To build the native binary: + +```bash +PXT_FORCE_LOCAL=yes PXT_NODOCKER=yes PXT_RUNTIME_DEV=yes PXT_ASMDEBUG=yes pxt build +```