1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

readme: Visual Studio build instructions

This commit is contained in:
Alexander Medvednikov 2019-07-04 12:36:42 +02:00 committed by GitHub
parent d117c0a742
commit fcf071b630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,9 +87,9 @@ If you want to build v.exe on Windows without WSL, you can use MinGW-w64 or Visu
#### MinGW-w64 #### MinGW-w64
[Download](https://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe?r=&ts=1561736169&use_mirror=gigenet) and install MinGW-w64. [Download](https://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe?r=&ts=1561736169&use_mirror=gigenet) and install MinGW-w64. I recommend installing it in `C:/mingw-w64`.
Make sure the `C:/mingw-w64/bin` directory is in system's PATH. Make sure the `C:/mingw-w64/bin` directory is in system's PATH, verify that by running `gcc` in your terminal.
```bash ```bash
# You can clone V anywhere # You can clone V anywhere
@ -101,6 +101,24 @@ gcc -std=gnu11 -w -o v.exe v.c # Build it with GCC
v.exe -o v2.exe compiler # Use V to build itself to make sure it works v.exe -o v2.exe compiler # Use V to build itself to make sure it works
``` ```
#### Visual Studio
Download and install Visual Studio. The community edition will suffice. In the installer select `Visual Studio core editor`, `Desktop development with C++`, and `Windows 10 SDK`.
[Download](https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/LLVM-7.1.0-win32.exe) and install Clang. The installer is ~130 MB. It will use Visual Studio's libraries and linker, but the compiler has to be Clang. V can't be compiled with Microsoft's C compiler. Make sure you check `Add Clang to PATH` when installing it.
```bash
# You can clone V anywhere
git clone https://github.com/vlang/v
cd v
# Download the V compiler's source translated to C
curl -O https://raw.githubusercontent.com/vlang/vc/master/v.c
clang -m32 -w -o v.exe v.c # Build it with Clang
```
If your Windows version doesn't have `curl` installed, you can install it, or simply download the `v.c` file via a browser.
### Testing ### Testing