Skip to content

Commit 2f17286

Browse files
authored
Do not compile with system libmongoc during integration tests (#1308)
1 parent c81d281 commit 2f17286

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.evergreen/scripts/compile.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ cmake_flags=(
103103
-DENABLE_UNINSTALL=ON
104104
)
105105

106+
# System-installed libmongoc must not prevent fetch-and-build of libmongoc.
107+
if [[ -z "$(find "${mongoc_prefix:?}" -name 'bson-config.h')" ]]; then
108+
cmake_flags+=("-DCMAKE_DISABLE_FIND_PACKAGE_mongoc-1.0=ON")
109+
fi
110+
106111
_RUN_DISTCHECK=""
107112
case "${OSTYPE:?}" in
108113
cygwin)
@@ -271,7 +276,7 @@ if [[ -n "$(find "${mongoc_prefix:?}" -name 'bson-config.h')" ]]; then
271276
exit 1
272277
}
273278
fi
274-
else
279+
elif [[ -n "$(find install -name 'bson-config.h')" ]]; then
275280
if [[ "${BSON_EXTRA_ALIGNMENT:-}" == "1" ]]; then
276281
grep -R "#define BSON_EXTRA_ALIGN 1" install || {
277282
echo "BSON_EXTRA_ALIGN is not 1 despite BSON_EXTRA_ALIGNMENT=1" 1>&2
@@ -283,4 +288,7 @@ else
283288
exit 1
284289
}
285290
fi
291+
else
292+
echo "unexpectedly compiled using a system libmongoc library" 1>&2
293+
exit 1
286294
fi

0 commit comments

Comments
 (0)