You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

97 lines
3.4 KiB

  1. Build Prerequisites:
  2. * CMake[1] 2.8.8 or later is required.
  3. * Perl 5.6.1 or later is required. On Windows, Strawberry Perl and MSYS Perl
  4. have both been reported to work. If not found by CMake, it may be configured
  5. explicitly by setting PERL_EXECUTABLE.
  6. * On Windows you currently must use Ninja[2] to build; on other platforms,
  7. it is not required, but recommended, because it makes builds faster.
  8. * If you need to build Ninja from source, then a recent version of
  9. Python[3] is required (Python 2.7.5 works).
  10. * On Windows only, Yasm[4] is required. If not found by CMake, it may be
  11. configured explicitly by setting CMAKE_ASM_NASM_COMPILER.
  12. * A C compiler is required. On Windows, MSVC 12 (Visual Studio 2013) or later
  13. with Platform SDK 8.1 or later are supported. Recent versions of GCC and
  14. Clang should work on non-Windows platforms, and maybe on Windows too.
  15. * Go[5] is required. If not found by CMake, the go executable may be
  16. configured explicitly by setting GO_EXECUTABLE.
  17. Using Ninja (note the 'N' is capitalized in the cmake invocation):
  18. mkdir build
  19. cd build
  20. cmake -GNinja ..
  21. ninja
  22. Using makefiles (does not work on Windows):
  23. mkdir build
  24. cd build
  25. cmake ..
  26. make
  27. You usually don't need to run cmake again after changing CMakeLists.txt files
  28. because the build scripts will detect changes to them and rebuild themselves
  29. automatically.
  30. Note that the default build flags in the top-level CMakeLists.txt are for
  31. debugging - optimisation isn't enabled.
  32. If you want to cross-compile then there is an example toolchain file for
  33. 32-bit Intel in util/. Wipe out the build directory, recreate it and run cmake
  34. like this:
  35. cmake -DCMAKE_TOOLCHAIN_FILE=../util/32-bit-toolchain.cmake -GNinja ..
  36. If you want to build as a shared library, pass -DBUILD_SHARED_LIBS=1. On
  37. Windows, where functions need to be tagged with "dllimport" when coming from a
  38. shared library, define BORINGSSL_SHARED_LIBRARY in any code which #includes the
  39. BoringSSL headers.
  40. Building for Android:
  41. It's possible to build BoringSSL with the Android NDK using CMake. This has
  42. been tested with version 10d of the NDK.
  43. Unpack the Android NDK somewhere and export ANDROID_NDK to point to the
  44. directory. Clone https://github.com/taka-no-me/android-cmake into util/.
  45. Then make a build directory as above and run CMake *twice* like this:
  46. cmake -DANDROID_NATIVE_API_LEVEL=android-9 \
  47. -DANDROID_ABI=armeabi-v7a \
  48. -DCMAKE_TOOLCHAIN_FILE=../util/android-cmake/android.toolchain.cmake \
  49. -GNinja ..
  50. Once you've run that twice, ninja should produce Android-compatible binaries.
  51. You can replace "armeabi-v7a" in the above with "arm64-v8a" to build aarch64
  52. binaries.
  53. Known Limitations on Windows:
  54. * Versions of cmake since 3.0.2 have a bug in its Ninja generator that causes
  55. yasm to output warnings "yasm: warning: can open only one input file, only
  56. the last file will be processed". These warnings can be safely ignored.
  57. The cmake bug is http://www.cmake.org/Bug/view.php?id=15253.
  58. * cmake can generate Visual Studio projects, but the generated project files
  59. don't have steps for assembling the assembly language source files, so they
  60. currently cannot be used to build BoringSSL.
  61. [1] http://www.cmake.org/download/
  62. [2] https://martine.github.io/ninja/
  63. [3] https://www.python.org/downloads/
  64. [4] http://yasm.tortall.net/
  65. [5] https://golang.org/dl/