You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/getting-started/windows.md
+70-1
Original file line number
Diff line number
Diff line change
@@ -99,4 +99,73 @@ If you want to use TinyGo to compile your own or sample code, you should be able
99
99
100
100
## Docker Install
101
101
102
-
The other option is to use the Docker image. This has the benefit of making no changes to your system but has a large download and installation size. For instructions on using the Docker image, please see the page [here](../using-docker).
102
+
Another option is to use the Docker image. This has the benefit of making no changes to your system but has a large download and installation size. For instructions on using the Docker image, please see the page [here](../using-docker).
103
+
104
+
## Source Install
105
+
106
+
***If you have already followed the "Windows Native Install" instructions above, you do not need to perform a source install. You are now done with the needed installation. The "Source Install" is for when you want to contribute to TinyGo.***
107
+
108
+
Be warned that building TinyGo on Windows is not tested as well as building TinyGo on other operating systems (such as Linux). If you want to contribute to TinyGo but don't need to run natively on Windows, it may be easier and faster to do development within [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10). See the [Linux page](../linux) for how to build TinyGo on Linux.
109
+
110
+
### Dependencies
111
+
112
+
You will need to have the following programs installed on your Windows system and configured to be accessible in your PATH variable:
113
+
114
+
* Git
115
+
* Go 1.14
116
+
* MinGW-w64
117
+
* GNU Make
118
+
* CMake
119
+
* Ninja
120
+
* Python
121
+
122
+
The easiest way to install all these dependencies is through [Chocolatey](https://chocolatey.org/). Install Chocolatey first, and then run the following command in a command prompt or PowerShell with administrative privileges:
123
+
124
+
choco install --confirm git golang mingw make cmake ninja python
125
+
126
+
Now open a Git Bash window for the remaining steps. The Git Bash window provides a Bash shell with some standard Unix utilities for convenience.
127
+
128
+
The first thing to do is download the source code:
Unfortunately there is no way to use a binary release of LLVM to build against (like on Linux and MacOS) so we'll have to build LLVM from scratch. This is a long process which takes at least one hour on most machines.
136
+
137
+
The following command takes care of downloading and building LLVM. It places the
138
+
source code in`llvm-project/` and the build output in`llvm-build/`. It only needs to
139
+
be done once until the next LLVM release.
140
+
141
+
```shell
142
+
make llvm-build
143
+
```
144
+
145
+
Once this is finished, you can build TinyGo against this manually built LLVM:
146
+
147
+
```shell
148
+
make
149
+
```
150
+
151
+
This results in a `tinygo.exe` binary in the `build` directory:
152
+
153
+
```text
154
+
$ ./build/tinygo version
155
+
tinygo version 0.13.1 windows/amd64 (using go version go1.14.1 and LLVM version 10.0.1)
156
+
```
157
+
158
+
### Additional Requirements for Microcontrollers
159
+
160
+
Before anything can be built for a bare-metal target, you need to generate some
161
+
files first:
162
+
163
+
```shell
164
+
make gen-device
165
+
```
166
+
167
+
This will generate register descriptions, interrupt vectors, and linker scripts
168
+
for various devices. Also, you may need to re-run this command after updates,
169
+
as some updates cause changes to the generated files.
170
+
171
+
The same additional requirements to compile TinyGo programs that can run on microcontrollers must be fulfilled when installing TinyGo from source. Please follow [these instructions](#additional-requirements-for-microcontrollers) above.
0 commit comments