Debian Codegraph @

crt/s2n/codebuild/bin/build_aws_crt_cpp.sh

raw symbols SCIP
1 #!/bin/bash
2 # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License").
5 # You may not use this file except in compliance with the License.
6 # A copy of the License is located at
7 #
8 # http://aws.amazon.com/apache2.0
9 #
10 # or in the "license" file accompanying this file. This file is distributed
11 # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 # express or implied. See the License for the specific language governing
13 # permissions and limitations under the License.
14 #
15
16 set -ex
17 pushd "$(pwd)"
18
19 usage() {
20 echo "build_aws_crt_cpp.sh build_dir install_dir"
21 exit 1
22 }
23
24 if [ "$#" -ne "2" ]; then
25 usage
26 fi
27
28 source codebuild/bin/s2n_setup_env.sh
29
30 BUILD_DIR=$1
31 INSTALL_DIR=$2
32
33 # Make sure there isn't another source tree hanging around.
34 rm -rf /opt/s2n-tls || true
35 mkdir -p "$BUILD_DIR/s2n"
36 # In case $BUILD_DIR is a subdirectory of current directory
37 for file in *;do test "$file" != "$BUILD_DIR" && cp -r "$file" "$BUILD_DIR/s2n";done
38 cd "$BUILD_DIR"
39 git clone --depth 1 --shallow-submodules --recurse-submodules https://github.com/awslabs/aws-crt-cpp.git
40 # Replace S2N
41 rm -r aws-crt-cpp/crt/s2n
42 mv s2n aws-crt-cpp/crt/
43
44 cmake ./aws-crt-cpp \
45 -Bbuild \
46 -GNinja \
47 -DENFORCE_SUBMODULE_VERSIONS=off \
48 -DBUILD_DEPS=ON \
49 -DCMAKE_BUILD_TYPE=Release \
50 -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
51 ninja -C ./build install
52 CTEST_OUTPUT_ON_FAILURE=1 CTEST_PARALLEL_LEVEL=$(nproc) ninja -C ./build test
53
54 popd
55
56 exit 0