Skip to content

Commit

Permalink
feat(run.sh): make it possible to build partial objects
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Dec 20, 2023
1 parent dec19d4 commit 533dc8b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ function usage_build()
{
echo "Options for subcommand 'build':"
echo " -h|--help print the help info"
echo " -m|--modules specify modules to build, split by ',',"
echo " e.g., \"pegasus_unit_test,dsn_runtime_tests,dsn_meta_state_tests\","
echo " if not set, then build all objects"
echo " -t|--type build type: debug|release, default is release"
echo " -c|--clear clear pegasus before building, not clear thirdparty"
echo " --clear_thirdparty clear thirdparty/pegasus before building"
Expand Down Expand Up @@ -128,13 +131,18 @@ function run_build()
USE_JEMALLOC=OFF
BUILD_TEST=OFF
IWYU=""
BUILD_MODULES=""
while [[ $# > 0 ]]; do
key="$1"
case $key in
-h|--help)
usage_build
exit 0
;;
-m|--modules)
BUILD_MODULES=$2
shift
;;
-t|--type)
BUILD_TYPE="$2"
shift
Expand Down Expand Up @@ -213,6 +221,12 @@ function run_build()
exit 1
fi

# Replace all ',' to ' ' in $BUILD_MODULES.
if [ "$BUILD_MODULES" != "" ]; then
BUILD_MODULES=${BUILD_MODULES//,/ }
fi
echo "build_modules=$BUILD_MODULES"

CMAKE_OPTIONS="-DCMAKE_C_COMPILER=${C_COMPILER}
-DCMAKE_CXX_COMPILER=${CXX_COMPILER}
-DUSE_JEMALLOC=${USE_JEMALLOC}"
Expand Down Expand Up @@ -325,6 +339,8 @@ function run_build()
pushd $BUILD_DIR
if [ ! -z "${IWYU}" ]; then
make $MAKE_OPTIONS 2> iwyu.out
elif [ "$BUILD_MODULES" != "" ]; then
make $BUILD_MODULES $MAKE_OPTIONS
else
make install $MAKE_OPTIONS
fi
Expand Down

0 comments on commit 533dc8b

Please sign in to comment.