Skip to content

Commit

Permalink
[glibmm] disable static builds on msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
planetmarshall committed Jan 6, 2023
1 parent 284f82f commit 8bb99c2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions recipes/glibmm/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 8bb99c2

Please sign in to comment.