@@ -27,6 +27,10 @@ export CMAKE_INSTALL_PREFIX="${MONGOCRYPT_INSTALL_PREFIX-}"
2727export CTEST_OUTPUT_ON_FAILURE=1
2828# Generate a compilation database for use by other tools
2929export CMAKE_EXPORT_COMPILE_COMMANDS=1
30+ # Permit skipping build of tests.
31+ BUILD_TESTING=" ${BUILD_TESTING-TRUE} "
32+ # Build nocrypto and sharedbson variants (true by defualt).
33+ LIBMONGOCRYPT_BUILD_VARIANTS=" ${LIBMONGOCRYPT_BUILD_VARIANTS:- TRUE} "
3034
3135# Accumulate arguments that are passed to CMake
3236cmake_args=(
@@ -38,7 +42,7 @@ cmake_args=(
3842 # Toggle compiling with shared BSON
3943 -D USE_SHARED_LIBBSON=" ${USE_SHARED_LIBBSON-FALSE} "
4044 # Toggle building of tests
41- -D BUILD_TESTING=" ${BUILD_TESTING-TRUE } "
45+ -D BUILD_TESTING=" ${BUILD_TESTING:? } "
4246 # Enable additional warnings-as-errors
4347 -D ENABLE_MORE_WARNINGS_AS_ERRORS=TRUE
4448)
@@ -85,7 +89,7 @@ if [ "$CONFIGURE_ONLY" ]; then
8589 exit 0;
8690fi
8791echo " Installing libmongocrypt"
88- _cmake_with_env --build " $BINARY_DIR " --target install test-mongocrypt test_kms_request
92+ _cmake_with_env --build " $BINARY_DIR " --target install
8993run_chdir " $BINARY_DIR " run_ctest
9094
9195# MONGOCRYPT-372, ensure macOS universal builds contain both x86_64 and arm64 architectures.
@@ -105,18 +109,23 @@ if [ "$PPA_BUILD_ONLY" ]; then
105109 exit 0;
106110fi
107111
112+ if [ " ${LIBMONGOCRYPT_BUILD_VARIANTS:? } " != " TRUE" ]; then
113+ echo " Skipping build of libmongocrypt variants" ;
114+ exit 0;
115+ fi
116+
108117# Build and install libmongocrypt with no native crypto.
109118_cmake_with_env " ${cmake_args[@]} " \
110119 -DDISABLE_NATIVE_CRYPTO=ON \
111120 -DCMAKE_INSTALL_PREFIX=" $MONGOCRYPT_INSTALL_PREFIX /nocrypto" \
112121 -B " $BINARY_DIR " -S " $LIBMONGOCRYPT_DIR "
113- _cmake_with_env --build " $BINARY_DIR " --target install test-mongocrypt
122+ _cmake_with_env --build " $BINARY_DIR " --target install
114123run_chdir " $BINARY_DIR " run_ctest
115124
116125# Build and install libmongocrypt without statically linking libbson
117126_cmake_with_env " ${cmake_args[@]} " \
118127 -DUSE_SHARED_LIBBSON=ON \
119128 -DCMAKE_INSTALL_PREFIX=" $MONGOCRYPT_INSTALL_PREFIX /sharedbson" \
120129 -B " $BINARY_DIR " -S " $LIBMONGOCRYPT_DIR "
121- _cmake_with_env --build " $BINARY_DIR " --target install test-mongocrypt
130+ _cmake_with_env --build " $BINARY_DIR " --target install
122131run_chdir " $BINARY_DIR " run_ctest
0 commit comments