Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glibmm v2 toolchain #14930

Merged
merged 15 commits into from
Feb 3, 2023
Merged
Prev Previous commit
Next Next commit
[glibmm] disable static builds on msvc
  • Loading branch information
planetmarshall committed Jan 6, 2023
commit 8bb99c2ce5ca89ded68d4f50c2958ef4432983e4
9 changes: 5 additions & 4 deletions recipes/glibmm/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -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")
planetmarshall marked this conversation as resolved.
Show resolved Hide resolved

if self.options.shared and not self.options["glib"].shared:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if self.options.shared and not self.options["glib"].shared:
if self.options.shared and not self.dependencies["glib"].options.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):
planetmarshall marked this conversation as resolved.
Show resolved Hide resolved
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):
Copy link
Contributor

@SpaceIm SpaceIm Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configure() appears so late when you read this recipe from top to bottom, with a logic to change glib shared option.
I wouldn't be against reordering of methods by order of execution: https://docs.conan.io/en/latest/reference/commands/creator/create.html#methods-execution-order
It's super hard to follow global logic of this recipe.

if self.options.shared:
del self.options.fPIC
self.options.rm_safe("fPIC")
if self.options.shared:
self.options["glib"].shared = True