From 27fc6a6c99f5412450d5d926566194e9455fc13d Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Sat, 14 Sep 2019 10:37:11 -0400 Subject: [PATCH] Fix shared lib build with new YAML_BUILD_SHARED_LIBS option --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cede142..f3380b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,7 +252,11 @@ set(_INSTALL_DESTINATIONS ### ### Library ### -add_library(yaml-cpp ${library_sources}) +if(YAML_BUILD_SHARED_LIBS) + add_library(yaml-cpp SHARED ${library_sources}) +else() + add_library(yaml-cpp STATIC ${library_sources}) +endif() if (NOT CMAKE_VERSION VERSION_LESS 2.8.12) target_include_directories(yaml-cpp