From fcf071b6309c2f4ec95b9c3b4aac2c66e25b6d28 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 4 Jul 2019 12:36:42 +0200 Subject: [PATCH] readme: Visual Studio build instructions --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4b1c95f208..ed678c7efb 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,9 @@ If you want to build v.exe on Windows without WSL, you can use MinGW-w64 or Visu #### 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 # 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 ``` +#### 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