Skip to content

Instantly share code, notes, and snippets.

@gavxin
Last active April 13, 2016 18:48
Show Gist options
  • Save gavxin/2dcc90ca1fd1b9680ee01d95b4bc1f8b to your computer and use it in GitHub Desktop.
Save gavxin/2dcc90ca1fd1b9680ee01d95b4bc1f8b to your computer and use it in GitHub Desktop.
Build boringssl with VS2015 Update 2

BoringSSL URL: https://boringssl.googlesource.com/boringssl This gist will tell you something about build current(2016.04.14) stable branch chromium-stable with VS 2015 Update 2.

  1. As BUILDING.md sad, you needs cmake, perl(I use ActivePerl), ninja, yasm, go.
  2. There is a VS BUG. If you installed VS 2015 Update 2, and install WDK 10. Your commandline tools will broken. That because commandline tools like VS2015 x64 Native Tools Command Prompt will always use newest SDK version. BUT the version of WDK 10 is 10.0.10586.0, the version of Windows SDK in VS2015 Update2 is 10.0.10240.0 or lower. If you try to link something in commandline environment, you will see link error cannot found 'ucrtd.lib'. The one way to fix this bug is JUST download and install newest(2016.04.14) Windows SDK 10.0.10586.15. Another way is just specify the SDK version number, in cmd CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1, this is equal to running VS2015 x86 Native Tools Command Prompt.
  3. Open CMakeLists.txt, add more ignored warnings to MSVC_DISABLED_WARNINGS_LIST, includes "C4464" "C4819" "C4701" "C4702" "C4623" "C4777" "C5027".
  4. Create a folder build as BUILDING.md sad. And create a batch file x86.bat in the folder build.
@ECHO OFF
cd %~dp0

REM Set the yasm.exe(yasm-1.3.0-win32.exe) filepath.
SET ASM_NASM=%~dp0\yasm.exe

REM Set PATH to find cmake.
SET PATH=%PATH%;C:\Program Files (x86)\CMake\bin

REM Add the ninja.exe folder to PATH
SET PATH=%PATH%;%~dp0

REM Add the Go executable folder to PATH, Set GOROOT env-variable
SET PATH=%PATH%;D:\WinPrograms\Go\bin\
SET GOROOT=D:\WinPrograms\Go

REM Setting building environment
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86

REM Delete outx86 folder if exists
IF EXIST outx86 del /s /q outx86

mkdir outx86
REM cd to outx86
PUSHD outx86

REM
REM Generate cmake file.
REM
cmake -DBUILD_SHARED_LIBS=1 -DGO_EXECUTABLE=D:/WinPrograms/Go/bin/go.exe -DCMAKE_BUILD_TYPE=Release -GNinja ..\..

REM
REM Start to build.
REM
ninja

POPD
PAUSE

That's it! Change the some path to fit your environment. You also can write your x64.bat based x86.bat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment