From 015ed5bc98c209582e6a2039afb16fd5044b9e37 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 17 Nov 2020 13:51:10 +0300 Subject: [PATCH] mdbx-cmake: minor fix `MDBX_BUILD_FLAGS` preparation. Change-Id: I91eebdffd06b4239ccc2dccd0931b3f82f0b5f52 --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20a50a45..bc0461d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,14 +756,21 @@ if(NOT CMAKE_CONFIGURATION_TYPES) endif() endif() +# choice target to fetch definitions and options +if(MDBX_BUILD_SHARED_LIBRARY) + set(target4fetch mdbx) +else() + set(target4fetch mdbx-static) +endif() + # get definitions -get_target_property(defs_list mdbx-static COMPILE_DEFINITIONS) +get_target_property(defs_list ${target4fetch} COMPILE_DEFINITIONS) if(defs_list) list(APPEND MDBX_BUILD_FLAGS ${defs_list}) endif() # get target compile options -get_target_property(options_list mdbx-static COMPILE_OPTIONS) +get_target_property(options_list ${target4fetch} COMPILE_OPTIONS) if(options_list) list(APPEND MDBX_BUILD_FLAGS ${options_list}) endif()