Skip to content

Commit ff0093c

Browse files
Redundant ENABLE_SHM_COUNTERS logic
1 parent a10cca4 commit ff0093c

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/libmongoc/CMakeLists.txt

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -372,25 +372,7 @@ endif ()
372372

373373
set (MONGOC_ENABLE_SHM_COUNTERS 0)
374374

375-
if (NOT ENABLE_SHM_COUNTERS MATCHES "ON|OFF|AUTO")
376-
message (FATAL_ERROR "ENABLE_SHM_COUNTERS option must be ON, OFF, or AUTO")
377-
endif ()
378-
379-
if (ENABLE_SHM_COUNTERS STREQUAL "AUTO")
380-
if (UNIX AND NOT APPLE)
381-
set (ENABLE_SHM_COUNTERS ON)
382-
endif ()
383-
if (APPLE AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
384-
set (ENABLE_SHM_COUNTERS ON)
385-
endif ()
386-
endif ()
387-
388-
if (ENABLE_SHM_COUNTERS STREQUAL "ON")
389-
if (( NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64" AND APPLE ) OR NOT UNIX)
390-
message (
391-
FATAL_ERROR
392-
"Shared memory performance counters only supported on arm64 Mac and Linux")
393-
endif ()
375+
if (ENABLE_SHM_COUNTERS)
394376
set (MONGOC_ENABLE_SHM_COUNTERS 1)
395377
find_library(RT_LIBRARY rt HINTS /usr/lib32)
396378
if (RT_LIBRARY)
@@ -848,7 +830,7 @@ add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c)
848830
target_link_libraries (mongoc-stat mongoc_shared ${LIBRARIES})
849831

850832
# mongoc-stat works if shared memory performance counters are enabled.
851-
if (ENABLE_SHM_COUNTERS STREQUAL "ON")
833+
if (ENABLE_SHM_COUNTERS)
852834
install (TARGETS mongoc-stat
853835
EXPORT mongoc_targets
854836
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

0 commit comments

Comments
 (0)