mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-25090: Depend on libpmem where available
WITH_PMEM: Change the parameter from BOOL to a ternary STRING with a default value that allows to use libpmem when it is available. In this way, a libpmem dependency will be automatically installed on other than Debian-based systems, based on what is available on the continuous integraton system for building the packages. WITH_PMEM=auto (default): Use libpmem when available. WITH_PMEM=yes: Require libpmem to be available. WITH_PMEM=no: Do not depend on libpmem.
This commit is contained in:
parent
418381bf99
commit
7c5c6fa65c
1 changed files with 17 additions and 4 deletions
|
@ -1,13 +1,26 @@
|
|||
INCLUDE(CheckIncludeFiles)
|
||||
OPTION(WITH_PMEM "Enable persistent memory features" OFF)
|
||||
IF(WITH_PMEM)
|
||||
SET(WITH_PMEM "auto" CACHE STRING "Enable persistent memory features")
|
||||
IF(WITH_PMEM STREQUAL "yes" OR WITH_PMEM STREQUAL "auto")
|
||||
FIND_LIBRARY(LIBPMEM pmem)
|
||||
CHECK_INCLUDE_FILES(libpmem.h HAVE_LIBPMEM_H)
|
||||
IF (NOT LIBPMEM)
|
||||
MESSAGE(FATAL_ERROR "Can't find libpmem")
|
||||
IF(WITH_PMEM STREQUAL "yes")
|
||||
MESSAGE(FATAL_ERROR "Can't find libpmem")
|
||||
ENDIF()
|
||||
UNSET(HAVE_LIBPMEM_H CACHE)
|
||||
UNSET(LIBPMEM CACHE)
|
||||
ELSEIF(NOT HAVE_LIBPMEM_H)
|
||||
MESSAGE(FATAL_ERROR "Can't find libpmem.h")
|
||||
IF(WITH_PMEM STREQUAL "yes")
|
||||
MESSAGE(FATAL_ERROR "Can't find libpmem.h")
|
||||
ENDIF()
|
||||
UNSET(HAVE_LIBPMEM_H CACHE)
|
||||
UNSET(LIBPMEM CACHE)
|
||||
ELSE()
|
||||
ADD_DEFINITIONS(-DHAVE_PMEM)
|
||||
ENDIF()
|
||||
ELSEIF(WITH_PMEM STREQUAL "no")
|
||||
UNSET(HAVE_LIBPMEM_H CACHE)
|
||||
UNSET(LIBPMEM CACHE)
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Invalid value for WITH_PMEM. Must be 'yes', 'no', or 'auto'.")
|
||||
ENDIF()
|
||||
|
|
Loading…
Add table
Reference in a new issue