Debian Codegraph @

crt/s2n/codebuild/bin/build_aws_crt_cpp.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/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 "$(pwdscip-shell system . . pwd.)"
18
19 usagescip-shell shell shell-project 0.0.0 usage().() {
20 echoscip-shell system . . echo. "build_aws_crt_cpp.sh build_dir install_dir"
21 exit 1
22 }
23
24 if [scip-shell system . . `[`. "$#" -ne "2" ]; then
25 usagescip-shell shell shell-project 0.0.0 usage().
26 fi
27
28 source codebuild/bin/s2n_setup_env.shscip-shell 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 rmscip-shell system . . rm. -rf /opt/s2n-tlsscip-shell filesystem . . `/opt/s2n-tls`. || truescip-shell system . . true.
35 mkdirscip-shell system . . mkdir. -p "$BUILD_DIR/s2n"
36 # In case $BUILD_DIR is a subdirectory of current directory
37 for file in *;do testscip-shell system . . test. "$file" != "$BUILD_DIR" && cpscip-shell system . . cp. -r "$file" "$BUILD_DIR/s2n";done
38 cd "$BUILD_DIR"
39 gitscip-shell system . . git. clone --depth 1 --shallow-submodules --recurse-submodules https://github.com/awslabs/aws-crt-cpp.git
40 # Replace S2N
41 rmscip-shell system . . rm. -r aws-crt-cpp/crt/s2n
42 mvscip-shell system . . mv. s2n aws-crt-cpp/crt/
43
44 cmakescip-shell system . . 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 ninjascip-shell system . . ninja. -C ./build install
52 CTEST_OUTPUT_ON_FAILURE=1 CTEST_PARALLEL_LEVEL=$(nprocscip-shell system . . nproc.) ninjascip-shell system . . ninja. -C ./build test
53
54 popd
55
56 exit 0