Skip to content

Commit 3f074a2

Browse files
author
Chris Wögi
authored
Improve guide for Windows users (#126)
Extend section for Visual Studio Code users.
1 parent d343d60 commit 3f074a2

1 file changed

Lines changed: 50 additions & 13 deletions

File tree

guides/windows.md

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,81 @@
1-
# Windows Users
1+
# Windows users
22

33
> Exqlite uses an [Erlang NIF](https://erlang.org/doc/tutorial/nif.html) under the hood.
4-
> Means calling a native implementation in C.
5-
> For Windows users this means compiling Exqlite does not magically just work.
4+
> Means calling a native implementation in C.
5+
6+
For Windows users this means compiling Exqlite does not magically just work.
7+
Of course, using **WSL 2** can be an alternative.
68

79
## Requirements
810

9-
### Install Microsoft Visual C++ Build Tools
11+
### Install Microsoft Visual C++ build tools
1012

1113
Download page:
1214
[visualstudio.microsoft.com/visual-cpp-build-tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
1315

1416
Alternative direct download link:
1517
[aka.ms/vs/16/release/vs_buildtools.exe](https://aka.ms/vs/16/release/vs_buildtools.exe)
16-
_for Visual Studio 2019 - version 16_
18+
_(aligned with Visual Studio 2019 - version 16)_
19+
20+
You need to install the **C++ build tools** workload with the default optional components.
1721

18-
## Building
22+
## Building environment
1923

2024
### Start command prompt with necessary environment
2125

22-
> Assuming you want to build for Windows x64.
26+
> Assuming you are building for Windows x64.
2327
24-
Within Windows Start menu search for:
28+
Within Windows start menu search for:
2529
x64 Native Tools Command Prompt
2630

27-
Starting this command prompt all necessary environment variables for compiling should be ready.
31+
Starting this command prompt all necessary environment variables
32+
for compiling should be ready within the prompt.
2833

29-
Means ready to run:
30-
```cmd
34+
Ready to run:
35+
```powershell
3136
mix deps.compile exqlite
3237
3338
# or
3439
mix compile
3540
mix test
41+
...
3642
```
3743

3844
**Alternative way to start prompt**
3945

40-
Assuming you have _latest_ version of Build Tools (Visual Studio 2019) installed.
46+
> Assuming you have _latest_ version of Build Tools, aligned with Visual Studio **2019**,
47+
installed in its default installation path.
4148

42-
```
49+
```powershell
4350
cmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
4451
```
52+
53+
## Visual Studio Code users using ElixirLS
54+
55+
> Assuming you have _latest_ version of Build Tools, aligned with Visual Studio **2019**,
56+
installed in its default installation path.
57+
58+
Start Visual Studio Code from a PowerShell prompt within your project folder.
59+
60+
```powershell
61+
cmd /k '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" && code .'
62+
```
63+
64+
With starting Visual Studio Code this way, ElixirLS should work
65+
and even your integrated terminal should be aware or the build tools.
66+
67+
Probably make yourself a shortcut for this.
68+
69+
**Integrated terminal only**
70+
71+
Within your global `settings.json` or your workspace `.vscode\settings.json` add:
72+
73+
```json
74+
{
75+
"terminal.integrated.shell.windows": "cmd.exe",
76+
"terminal.integrated.shellArgs.windows": [
77+
"/k",
78+
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat",
79+
]
80+
}
81+
```

0 commit comments

Comments
 (0)