From 8bb99c2ce5ca89ded68d4f50c2958ef4432983e4 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Fri, 6 Jan 2023 17:40:26 +0000 Subject: [PATCH] [glibmm] disable static builds on msvc --- recipes/glibmm/all/conanfile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/recipes/glibmm/all/conanfile.py b/recipes/glibmm/all/conanfile.py index ee146119575fd..66d419161325e 100644 --- a/recipes/glibmm/all/conanfile.py +++ b/recipes/glibmm/all/conanfile.py @@ -59,15 +59,16 @@ def validate(self): else: check_min_cppstd(self, 11) + if is_msvc(self) and not self.options.shared: + raise ConanInvalidConfiguration("Static library build is not supported by MSVC") + if self.options.shared and not self.options["glib"].shared: raise ConanInvalidConfiguration( "Linking a shared library against static glib can cause unexpected behaviour." ) if self.options["glib"].shared and is_msvc_static_runtime(self): - raise ConanInvalidConfiguration( - "Linking shared glib with the MSVC static runtime is not supported" - ) + raise ConanInvalidConfiguration("Linking shared glib with the MSVC static runtime is not supported") def config_options(self): if self.settings.os == "Windows": @@ -135,7 +136,7 @@ def _patch_sources(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if self.options.shared: self.options["glib"].shared = True