From 968e0c1f0281fdaf66d0983bd8bd694263400810 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Sat, 14 Sep 2019 21:21:35 -0400 Subject: [PATCH] Fix shared lib build with new YAML_BUILD_SHARED_LIBS option (#737) --- 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