diff options
-rw-r--r-- | BUILDING.md | 23 | ||||
-rw-r--r-- | FUZZING.md | 6 | ||||
-rw-r--r-- | rust/bssl-crypto/Cargo.toml | 4 | ||||
-rw-r--r-- | rust/bssl-crypto/README.md | 4 | ||||
-rw-r--r-- | rust/bssl-sys/build.rs | 2 |
5 files changed, 16 insertions, 23 deletions
diff --git a/BUILDING.md b/BUILDING.md index bedba3c..4dcd0f4 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -48,17 +48,13 @@ most recent stable version of each tool. Using Ninja (note the 'N' is capitalized in the cmake invocation): - mkdir build - cd build - cmake -GNinja .. - ninja + cmake -GNinja -B build + ninja -C build Using Make (does not work on Windows): - mkdir build - cd build - cmake .. - make + cmake -B build + make -C build You usually don't need to run `cmake` again after changing `CMakeLists.txt` files because the build scripts will detect changes to them and rebuild @@ -69,10 +65,9 @@ debugging—optimisation isn't enabled. Pass `-DCMAKE_BUILD_TYPE=Release` to `cmake` to configure a release build. If you want to cross-compile then there is an example toolchain file for 32-bit -Intel in `util/`. Wipe out the build directory, recreate it and run `cmake` like -this: +Intel in `util/`. Wipe out the build directory, run `cmake` like this: - cmake -DCMAKE_TOOLCHAIN_FILE=../util/32-bit-toolchain.cmake -GNinja .. + cmake -B build -DCMAKE_TOOLCHAIN_FILE=../util/32-bit-toolchain.cmake -GNinja If you want to build as a shared library, pass `-DBUILD_SHARED_LIBS=1`. On Windows, where functions need to be tagged with `dllimport` when coming from a @@ -93,12 +88,12 @@ versions of the NDK include a CMake toolchain file which works with CMake 3.6.0 or later. This has been tested with version r16b of the NDK. Unpack the Android NDK somewhere and export `ANDROID_NDK` to point to the -directory. Then make a build directory as above and run CMake like this: +directory. Then run CMake like this: cmake -DANDROID_ABI=armeabi-v7a \ -DANDROID_PLATFORM=android-19 \ -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \ - -GNinja .. + -GNinja -B build Once you've run that, Ninja should produce Android-compatible binaries. You can replace `armeabi-v7a` in the above with `arm64-v8a` and use API level 21 or @@ -140,7 +135,7 @@ In order to build with prefixed symbols, the `BORINGSSL_PREFIX` CMake variable should specify the prefix to add to all symbols, and the `BORINGSSL_PREFIX_SYMBOLS` CMake variable should specify the path to a file which contains a list of symbols which should be prefixed (one per line; -comments are supported with `#`). In other words, `cmake .. +comments are supported with `#`). In other words, `cmake -B build -DBORINGSSL_PREFIX=MY_CUSTOM_PREFIX -DBORINGSSL_PREFIX_SYMBOLS=/path/to/symbols.txt` will configure the build to add the prefix `MY_CUSTOM_PREFIX` to all of the symbols listed in @@ -7,10 +7,8 @@ We use Clang's [libFuzzer](http://llvm.org/docs/LibFuzzer.html) for fuzz testing In order to build the fuzz tests you will need at least Clang 6.0. Pass `-DFUZZ=1` on the CMake command line to enable building BoringSSL with coverage and AddressSanitizer, and to build the fuzz test binaries. You'll probably need to set the `CC` and `CXX` environment variables too, like this: ``` -mkdir build -cd build -CC=clang CXX=clang++ cmake -GNinja -DFUZZ=1 .. -ninja +CC=clang CXX=clang++ cmake -GNinja -DFUZZ=1 -B build +ninja -C build ``` diff --git a/rust/bssl-crypto/Cargo.toml b/rust/bssl-crypto/Cargo.toml index 57a6440..7822767 100644 --- a/rust/bssl-crypto/Cargo.toml +++ b/rust/bssl-crypto/Cargo.toml @@ -7,5 +7,5 @@ license = "MIT" [dependencies] # the crate will need to be generated at this path by running this command at root -# `mkdir build && cd build && cmake -G Ninja .. -DRUST_BINDINGS="$(gcc -dumpmachine)" && ninja` -bssl-sys = {path = "../../build/rust/bssl-sys"}
\ No newline at end of file +# `cmake -G Ninja -B build -DRUST_BINDINGS="$(gcc -dumpmachine)" && ninja -C build` +bssl-sys = {path = "../../build/rust/bssl-sys"} diff --git a/rust/bssl-crypto/README.md b/rust/bssl-crypto/README.md index 9e10fad..0d52053 100644 --- a/rust/bssl-crypto/README.md +++ b/rust/bssl-crypto/README.md @@ -5,10 +5,10 @@ rust bindings to boringssl which wrap bssl-sys, a low level autogenerated bindin Before using this crate, first generate the bssl-sys bindings by running this command from the root of the repo: ``` -mkdir build && cd build && cmake -G Ninja .. -DRUST_BINDINGS="$(gcc -dumpmachine)" && ninja +cmake -G Ninja -B build -DRUST_BINDINGS="$(gcc -dumpmachine)" && ninja -C build ``` Then to run all tests: ``` cd rust/bssl-crypto && cargo clippy && cargo deny check && cargo test -```
\ No newline at end of file +``` diff --git a/rust/bssl-sys/build.rs b/rust/bssl-sys/build.rs index c2b7358..e540702 100644 --- a/rust/bssl-sys/build.rs +++ b/rust/bssl-sys/build.rs @@ -30,7 +30,7 @@ fn main() { .unwrap(); println!("cargo:rustc-env=BINDGEN_RS_FILE={}", bindgen_file); - // building bssl-sys with: `mkdir build && cd build && cmake -G Ninja .. -DRUST_BINDINGS="$(gcc -dumpmachine)" && ninja` + // building bssl-sys with: `cmake -G Ninja -B build -DRUST_BINDINGS="$(gcc -dumpmachine)" && ninja -C build` // outputs this crate to /build/rust/bssl-sys/ so need to go up 3 levels to the root of the repo let repo_root = crate_path.parent().unwrap().parent().unwrap(); |