From 90bf7eb817dfe19e78a057d7e2e54608c90896ee Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Fri, 17 Apr 2020 00:37:29 +0300 Subject: [PATCH] mdbx: fix/refine MDBX_BUILD_SHARED_LIBRARY definition. Change-Id: If4e3d32b0ce360eb7275d962fff4b31e53926054 --- CMakeLists.txt | 3 ++- src/config.h.in | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86530262..a17bd35a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -478,6 +478,7 @@ endif() set_target_properties(mdbx-static PROPERTIES C_STANDARD ${MDBX_C_STANDARD} C_STANDARD_REQUIRED ON PUBLIC_HEADER mdbx.h) +target_compile_definitions(mdbx-static PRIVATE MDBX_BUILD_SHARED_LIBRARY=0) target_setup_options(mdbx-static) libmdbx_setup_libs(mdbx-static INTERFACE) if(MDBX_BUILD_SHARED_LIBRARY) @@ -494,7 +495,7 @@ if(MDBX_BUILD_SHARED_LIBRARY) set_target_properties(mdbx PROPERTIES C_STANDARD ${MDBX_C_STANDARD} C_STANDARD_REQUIRED ON PUBLIC_HEADER mdbx.h) - target_compile_definitions(mdbx PRIVATE LIBMDBX_EXPORTS INTERFACE LIBMDBX_IMPORTS) + target_compile_definitions(mdbx PRIVATE LIBMDBX_EXPORTS MDBX_BUILD_SHARED_LIBRARY=1 INTERFACE LIBMDBX_IMPORTS) target_setup_options(mdbx) libmdbx_setup_libs(mdbx PRIVATE) if(CC_HAS_VISIBILITY AND (LTO_ENABLED OR INTERPROCEDURAL_OPTIMIZATION)) diff --git a/src/config.h.in b/src/config.h.in index e6ae23e1..12f3dc63 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -17,7 +17,6 @@ #ifndef MDBX_TXN_CHECKPID_AUTO #cmakedefine01 MDBX_TXN_CHECKPID #endif -#cmakedefine01 MDBX_BUILD_SHARED_LIBRARY #cmakedefine MDBX_LOCKING_AUTO #ifndef MDBX_LOCKING_AUTO #cmakedefine MDBX_LOCKING @MDBX_LOCKING@