From c27c3312ad15ceebc223b01cef90916141ef13f1 Mon Sep 17 00:00:00 2001 From: Philip Howard Date: Thu, 15 Jul 2021 14:06:40 +0100 Subject: [PATCH 1/3] Tweak Windows CLI docs --- docs/Windows.md | 72 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/docs/Windows.md b/docs/Windows.md index 609ce7245..de8a03134 100644 --- a/docs/Windows.md +++ b/docs/Windows.md @@ -3,25 +3,32 @@ These instructions cover building 32blit on Windows (without WSL). - [Prerequisites](#prerequisites) -- [Using Visual Studio](#using-visual-studio) +- [Setting Up](#setting-up) - [Building & Running on 32Blit](#building--running-on-32blit) - [Building & Running Locally](#building--running-locally) - [Build Everything](#build-everything) +To build using Visual Studio [see here](Windows-VisualStudio.md). The rest of these instructions cover command-line builds. + ## Prerequisites -You'll need to install: +- Windows Terminal - grab it from the Windows Store +- [Git for Windows](https://git-scm.com/download/win) +- [Python](https://www.python.org/downloads/) - eg: "python-3.9.6-amd64.exe" +- The [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) (For 32blit device builds, use the 9-2020-q2-update version). Make sure to select the "Add path to environment variable" at the end of the setup. + - At least the [Visual Studio build tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) (For local builds, select "Desktop development with C++"). This includes CMake and NMake. + +If you have Visual Studio installed you can Modify the installation and select "C++/CLI support for vXXX build tools (Latest)" - - [Git for Windows](https://git-scm.com/download/win) - - [Python](https://www.python.org/downloads/) - - At least the [Visual Studio build tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) (For local builds, select "Desktop development with C++"). This includes a copy of CMake. A full Visual Studio install can also be used. - - The [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) (For 32blit device builds, use the 9-2020-q2-update version). Make sure to select the "Add path to environment variable" at the end of the setup. +## Setting Up + +Open "Developer Command Prompt for VS 2022." This is where you'll build the 32blit SDK and flash .blit files to your device. + +Install the 32blit tools: -Now open "Developer Command Prompt for VS 2022" and install the 32blit tools: ``` py -m pip install 32blit ``` -(Keep this open for building later) This may result in a waning similar to: @@ -31,20 +38,39 @@ WARNING: The script 32blit.exe is installed in 'C:\Users\[Name]\AppData\Local\Pr You will either need to add that to your PATH, or run the tools as `py -m ttblit ...` instead of `32blit ...`. -## Using Visual Studio -To build using Visual Studio [see here](Windows-VisualStudio.md). The rest of these instructions cover command-line builds. +You should now be able to run `32blit.exe`, you can test your connection to your 32blit with: + +``` +32blit flash list +``` + +## Building & Running + +### On 32Blit -## Building & Running on 32Blit +If you want to run code on 32Blit, you should now refer to [Building & Running On 32Blit](32blit.md). On Windows you will need to add `-G"NMake Makefiles"` to your cmake commands, for example: -If you want to run code on 32Blit, you should now refer to [Building & Running On 32Blit](32blit.md). You will need to add `-G"NMake Makefiles"` to your cmake commands and use `nmake` instead of `make`. For example: ``` mkdir build.stm32 cd build.stm32 cmake -G"NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=../32blit.toolchain .. -nmake ``` -## Building & Running Locally +Now to build an example, type: + +``` +cmake --build . --target raycaster +``` + +This will produce `examples/raycaster/raycaster.blit`. + +You can build & flash to your 32blit with one command by adding ".flash" to the end of any target, for example: + +``` +cmake --build . --target raycaster.flash +``` + +### Locally (Windows .exe) Set up the 32Blit Makefile from the root of the repository with the following commands: @@ -57,27 +83,29 @@ cmake -G"NMake Makefiles" .. Now to make any example, type: ``` -nmake example-name +cmake --build . --target raycaster ``` -For example: +This will produce `examples\raycaster\raycaster.exe` which you should run with: ``` -nmake raycaster +examples\raycaster\raycaster ``` -This will produce `examples/raycaster/raycaster.exe` which you should run with: +### List Targets + +For an exhaustive list of all the examples you can build, type: ``` -.\examples\raycaster\raycaster +cmake --build . --target help ``` ### Build Everything -Alternatively you can build everything by just typing: +Whether you're building locally or for device you can build the SDK and all examples by typing: ``` -nmake +cmake --build . ``` -When the build completes you should be able to run any example. +When the build completes you should be able to run/install any example. From bf4d823bbab111d6beab1daafdf9b0480b4460f7 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Sat, 22 Jun 2024 12:23:12 +0100 Subject: [PATCH 2/3] docs: specify more accurate VS components We definitely don't use C++/CLI --- docs/Windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Windows.md b/docs/Windows.md index de8a03134..a505e3632 100644 --- a/docs/Windows.md +++ b/docs/Windows.md @@ -18,7 +18,7 @@ To build using Visual Studio [see here](Windows-VisualStudio.md). The rest of th - The [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) (For 32blit device builds, use the 9-2020-q2-update version). Make sure to select the "Add path to environment variable" at the end of the setup. - At least the [Visual Studio build tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) (For local builds, select "Desktop development with C++"). This includes CMake and NMake. -If you have Visual Studio installed you can Modify the installation and select "C++/CLI support for vXXX build tools (Latest)" +If you have Visual Studio installed you can Modify the installation and select "MSVC vXXX - VS 2022 C++ x64/x86 build tools (Latest)" and "C++ CMake tools for Windows" ## Setting Up From 4b6b6b9564ec1f89d7b44a4b62d28746ffe350a4 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Sat, 22 Jun 2024 17:14:21 +0100 Subject: [PATCH 3/3] docs: move windows VS note back down You still need to read as far as installing the tools --- docs/Windows.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Windows.md b/docs/Windows.md index a505e3632..ca625bc79 100644 --- a/docs/Windows.md +++ b/docs/Windows.md @@ -8,8 +8,6 @@ These instructions cover building 32blit on Windows (without WSL). - [Building & Running Locally](#building--running-locally) - [Build Everything](#build-everything) -To build using Visual Studio [see here](Windows-VisualStudio.md). The rest of these instructions cover command-line builds. - ## Prerequisites - Windows Terminal - grab it from the Windows Store @@ -46,6 +44,8 @@ You should now be able to run `32blit.exe`, you can test your connection to your ## Building & Running +To build using Visual Studio [see here](Windows-VisualStudio.md). The rest of these instructions cover command-line builds. + ### On 32Blit If you want to run code on 32Blit, you should now refer to [Building & Running On 32Blit](32blit.md). On Windows you will need to add `-G"NMake Makefiles"` to your cmake commands, for example: