From f75e13802ccf5c7ca0b9d1a2c38e74b396f648a6 Mon Sep 17 00:00:00 2001 From: Serge Petrenko Date: Tue, 23 Jul 2019 00:43:58 +0300 Subject: [PATCH] cmake: make sure yaml is built statically when used in tarantool Follow-up tarantool/tarantool#4090 --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e20a494e..bab14695 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,9 +52,13 @@ configure_file( ${config_h} ) -add_library(yaml ${SRCS}) +if(ENABLE_BUNDLED_LIBYAML) + add_library(yaml STATIC ${SRCS}) +else() + add_library(yaml ${SRCS}) +endif() -if(NOT BUILD_SHARED_LIBS) +if(NOT BUILD_SHARED_LIBS OR ENABLE_BUNDLED_LIBYAML) set_target_properties(yaml PROPERTIES OUTPUT_NAME yaml_static ) @@ -67,7 +71,7 @@ set_target_properties(yaml target_compile_definitions(yaml PRIVATE HAVE_CONFIG_H PUBLIC - $<$>:YAML_DECLARE_STATIC> + $<$>,$>:YAML_DECLARE_STATIC> $<$:_CRT_SECURE_NO_WARNINGS> )