Brian Smith | ed30c0d | 2015-01-23 15:13:17 -0800 | [diff] [blame] | 1 | Build 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 Smith | dc94b54 | 2015-01-27 23:06:00 -0800 | [diff] [blame] | 17 | 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 Smith | ed30c0d | 2015-01-23 15:13:17 -0800 | [diff] [blame] | 19 | |
| 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 | |
| 25 | Using Ninja (note the 'N' is capitalized in the cmake invocation): |
| 26 | |
| 27 | mkdir build |
| 28 | cd build |
| 29 | cmake -GNinja .. |
| 30 | ninja |
| 31 | |
| 32 | Using makefiles (does not work on Windows): |
| 33 | |
| 34 | mkdir build |
| 35 | cd build |
| 36 | cmake .. |
| 37 | make |
| 38 | |
| 39 | You usually don't need to run cmake again after changing CMakeLists.txt files |
| 40 | because the build scripts will detect changes to them and rebuild themselves |
| 41 | automatically. |
Adam Langley | 95c29f3 | 2014-06-20 12:00:00 -0700 | [diff] [blame] | 42 | |
David Benjamin | 507c1ee | 2015-01-28 00:50:21 -0500 | [diff] [blame] | 43 | Note that the default build flags in the top-level CMakeLists.txt are for |
Adam Langley | 95c29f3 | 2014-06-20 12:00:00 -0700 | [diff] [blame] | 44 | debugging - optimisation isn't enabled. |
| 45 | |
Adam Langley | 95c29f3 | 2014-06-20 12:00:00 -0700 | [diff] [blame] | 46 | If you want to cross-compile then there are example toolchain files for 32-bit |
| 47 | Intel and ARM in util/. Wipe out the build directory, recreate it and run cmake |
| 48 | like this: |
| 49 | |
Brian Smith | ed30c0d | 2015-01-23 15:13:17 -0800 | [diff] [blame] | 50 | cmake -DCMAKE_TOOLCHAIN_FILE=../util/arm-toolchain.cmake -GNinja .. |
Adam Langley | 95c29f3 | 2014-06-20 12:00:00 -0700 | [diff] [blame] | 51 | |
David Benjamin | 507c1ee | 2015-01-28 00:50:21 -0500 | [diff] [blame] | 52 | If you want to build as a shared library, pass -DBUILD_SHARED_LIBS=1. On |
| 53 | Windows, where functions need to be tagged with "dllimport" when coming from a |
| 54 | shared library, define BORINGSSL_SHARED_LIBRARY in any code which #includes the |
| 55 | BoringSSL headers. |
Adam Langley | eb7d2ed | 2014-07-30 16:02:14 -0700 | [diff] [blame] | 56 | |
Brian Smith | ed30c0d | 2015-01-23 15:13:17 -0800 | [diff] [blame] | 57 | Known Limitations on Windows: |
David Benjamin | bc786a9 | 2014-10-31 17:27:40 -0400 | [diff] [blame] | 58 | |
Brian Smith | ed30c0d | 2015-01-23 15:13:17 -0800 | [diff] [blame] | 59 | * 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 Smith | ed30c0d | 2015-01-23 15:13:17 -0800 | [diff] [blame] | 68 | * 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/ |