Skip to content

Commit d7b7b34

Browse files
committed
CDRIVER-2668 install mongoc-stat in bin/
1 parent b46a083 commit d7b7b34

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.evergreen/link-sample-program.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,20 @@ else
167167
fi
168168
fi
169169

170+
if [ $(uname) = "Darwin" ]; then
171+
if test -f $INSTALL_DIR/bin/mongoc-stat; then
172+
echo "mongoc-stat shouldn't have been installed"
173+
exit 1
174+
fi
175+
else
176+
if test ! -f $INSTALL_DIR/bin/mongoc-stat; then
177+
echo "mongoc-stat missing!"
178+
exit 1
179+
else
180+
echo "mongoc-stat check ok"
181+
fi
182+
fi
183+
170184
if [ "$BUILD_SAMPLE_WITH_CMAKE" ]; then
171185
# Test our CMake package config file with CMake's find_package command.
172186
EXAMPLE_DIR=$SRCROOT/src/libmongoc/examples/cmake/find_package

src/libmongoc/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,13 @@ endif ()
597597
add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c)
598598
target_link_libraries (mongoc-stat mongoc_shared)
599599

600+
# mongoc-stat works if shared memory performance counters are enabled.
601+
if (ENABLE_SHM_COUNTERS STREQUAL "ON")
602+
install (PROGRAMS ${PROJECT_BINARY_DIR}/mongoc-stat
603+
DESTINATION ${CMAKE_INSTALL_BINDIR}
604+
)
605+
endif ()
606+
600607
function (mongoc_add_test test use_shared)
601608
if (ENABLE_TESTS)
602609
add_executable (${test} ${ARGN})

0 commit comments

Comments
 (0)