Adam Langley | 95c29f3 | 2014-06-20 12:00:00 -0700 | [diff] [blame] | 1 | mkdir build |
| 2 | cd build |
| 3 | cmake .. |
| 4 | make |
| 5 | |
Adam Langley | 95c29f3 | 2014-06-20 12:00:00 -0700 | [diff] [blame] | 6 | Note that the default build flags in the top-leve CMakeLists.txt are for |
| 7 | debugging - optimisation isn't enabled. |
| 8 | |
| 9 | If you'll be building a lot, then installing Ninja[1] is highly recommended. |
| 10 | Wipe out the build directory and recreate it, but using: |
| 11 | |
| 12 | cmake -GNinja .. |
| 13 | ninja |
| 14 | |
| 15 | If you want to cross-compile then there are example toolchain files for 32-bit |
| 16 | Intel and ARM in util/. Wipe out the build directory, recreate it and run cmake |
| 17 | like this: |
| 18 | |
| 19 | cmake -DCMAKE_TOOLCHAIN_FILE=../util/arm-toolchain.cmake -GNinja .. |
| 20 | |
Adam Langley | eb7d2ed | 2014-07-30 16:02:14 -0700 | [diff] [blame] | 21 | If you want to build as a shared library you need to tweak the STATIC tags in |
| 22 | the CMakeLists.txts and also define BORINGSSL_SHARED_LIBRARY and |
| 23 | BORINGSSL_IMPLEMENTATION. On Windows, where functions need to be tagged with |
| 24 | "dllimport" when coming from a shared library, you need just |
| 25 | BORINGSSL_SHARED_LIBRARY defined in the code which #includes the BoringSSL |
| 26 | headers. |
| 27 | |
David Benjamin | bc786a9 | 2014-10-31 17:27:40 -0400 | [diff] [blame] | 28 | To build on Windows, Yasm[2] is required for assembly. Either ensure yasm.exe |
| 29 | is in %PATH% or configure CMAKE_ASM_NASM_COMPILER appropriately. Note that |
| 30 | full Windows support is still in progress. |
| 31 | |
Adam Langley | 95c29f3 | 2014-06-20 12:00:00 -0700 | [diff] [blame] | 32 | [1] http://martine.github.io/ninja/ |
David Benjamin | bc786a9 | 2014-10-31 17:27:40 -0400 | [diff] [blame] | 33 | [2] http://yasm.tortall.net/ |