blob: 18ddde1703569fdd5fc7ad52551461a0b90bc6f2 [file] [log] [blame]
Brian Smithed30c0d2015-01-23 15:13:17 -08001Build Prerequisites:
2
3 * CMake[1] 2.8.8 or later is required.
4
5 * Perl 5.6.1 or later is required. On Windows, Strawberry Perl and MSYS Perl
6 have both been reported to work.
7
8 * On Windows you currently must use Ninja[2] to build; on other platforms,
9 it is not required, but recommended, because it makes builds faster.
10
11 * If you need to build Ninja from source, then a recent version of
12 Python[3] is required (Python 2.7.5 works).
13
14 * On Windows only, Yasm[4] is required.
15
16 * A C compiler is required. On Windows, MSVC 12 (Visual Studio 2013) or later
Brian Smithdc94b542015-01-27 23:06:00 -080017 with Platform SDK 8.1 or later are supported. Recent versions of GCC and
18 Clang should work on non-Windows platforms, and maybe on Windows too.
Brian Smithed30c0d2015-01-23 15:13:17 -080019
20 * Bash is required for running some tests, but not for building.
21
22 * Go[5] is required for running some tests, but not for building. Note that
23 these tests do not work on Windows.
24
25Using Ninja (note the 'N' is capitalized in the cmake invocation):
26
27 mkdir build
28 cd build
29 cmake -GNinja ..
30 ninja
31
32Using makefiles (does not work on Windows):
33
34 mkdir build
35 cd build
36 cmake ..
37 make
38
39You usually don't need to run cmake again after changing CMakeLists.txt files
40because the build scripts will detect changes to them and rebuild themselves
41automatically.
Adam Langley95c29f32014-06-20 12:00:00 -070042
David Benjamin507c1ee2015-01-28 00:50:21 -050043Note that the default build flags in the top-level CMakeLists.txt are for
Adam Langley95c29f32014-06-20 12:00:00 -070044debugging - optimisation isn't enabled.
45
Adam Langley95c29f32014-06-20 12:00:00 -070046If you want to cross-compile then there are example toolchain files for 32-bit
47Intel and ARM in util/. Wipe out the build directory, recreate it and run cmake
48like this:
49
Brian Smithed30c0d2015-01-23 15:13:17 -080050 cmake -DCMAKE_TOOLCHAIN_FILE=../util/arm-toolchain.cmake -GNinja ..
Adam Langley95c29f32014-06-20 12:00:00 -070051
David Benjamin507c1ee2015-01-28 00:50:21 -050052If you want to build as a shared library, pass -DBUILD_SHARED_LIBS=1. On
53Windows, where functions need to be tagged with "dllimport" when coming from a
54shared library, define BORINGSSL_SHARED_LIBRARY in any code which #includes the
55BoringSSL headers.
Adam Langleyeb7d2ed2014-07-30 16:02:14 -070056
Brian Smithed30c0d2015-01-23 15:13:17 -080057Known Limitations on Windows:
David Benjaminbc786a92014-10-31 17:27:40 -040058
Brian Smithed30c0d2015-01-23 15:13:17 -080059 * Versions of cmake since 3.0.2 have a bug in its Ninja generator that causes
60 yasm to output warnings "yasm: warning: can open only one input file, only
61 the last file will be processed". These warnings can be safely ignored.
62 The cmake bug is http://www.cmake.org/Bug/view.php?id=15253.
63
64 * cmake can generate Visual Studio projects, but the generated project files
65 don't have steps for assembling the assembly language source files, so they
66 currently cannot be used to build BoringSSL.
67
Brian Smithed30c0d2015-01-23 15:13:17 -080068 * The tests written in Go do not work.
69
70[1] http://www.cmake.org/download/
71
72[2] https://martine.github.io/ninja/
73
74[3] https://www.python.org/downloads/
75
76[4] http://yasm.tortall.net/
77
78 Either ensure yasm.exe is in %PATH% or configure CMAKE_ASM_NASM_COMPILER
79 appropriately.
80
81[5] https://golang.org/dl/