File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
tools/scripts/build-tests Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 22# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33# SPDX-License-Identifier: Apache-2.0.
44
5- # This script is an example of how to build the SDK on Debug build-type with minimize on and address sanitizers
5+ # This script is an example of how to build the SDK with minimize on (debugging information and address sanitizer enabled for Debug builds)
66# Directories created and files are prefixed with PREFIX_DIR argument
77# A clone of aws-sdk-cpp is expected to be in ${PREFIX_DIR}/aws-sdk-cpp
88# Platform: Amazon Linux 2
99
1010set -e
1111
12- if [ " $# " -ne 1 ]; then
13- echo " Usage: ${0} PREFIX_DIR"
12+ if [ " $# " -lt 1 ] || [ " $# " -gt 2 ]; then
13+ echo " Usage: ${0} PREFIX_DIR [BUILD_TYPE]"
14+ echo " BUILD_TYPE defaults to Debug if not provided"
1415 exit 1
1516fi
1617PREFIX_DIR=" $1 "
18+ BUILD_TYPE=" ${2:- Debug} "
1719
1820mkdir " ${PREFIX_DIR} /al2-build"
1921mkdir " ${PREFIX_DIR} /al2-install"
2022cd " ${PREFIX_DIR} /al2-build"
21- cmake -GNinja ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=" -ggdb -fsanitize=address" -DMINIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=" ${PREFIX_DIR} /al2-install" -DBUILD_PERFORMANCE_TESTS=ON
23+ CMAKE_ARGS=(-GNinja ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=" $BUILD_TYPE " -DMINIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=" ${PREFIX_DIR} /al2-install" -DBUILD_PERFORMANCE_TESTS=ON)
24+ if [ " $BUILD_TYPE " = " Debug" ]; then
25+ CMAKE_ARGS+=(-DCMAKE_CXX_FLAGS=" -ggdb -fsanitize=address" )
26+ fi
27+ cmake " ${CMAKE_ARGS[@]} "
2228ninja-build -j $( grep -c ^processor /proc/cpuinfo)
2329ninja-build install
You can’t perform that action at this time.
0 commit comments