Skip to content

Commit

Permalink
[graphene]: use shared glib for shared graphene
Browse files Browse the repository at this point in the history
  • Loading branch information
theartful committed Jun 18, 2022
1 parent b4d02d7 commit 5e96728
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion recipes/graphene/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,21 @@ def build_requirements(self):

def requirements(self):
if self.options.with_glib:
self.requires("glib/2.72.0")
self.requires("glib/2.73.0")

def configure(self):
if self.options.shared:
del self.options.fPIC
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd
if self.options.shared and self.options.with_glib:
self.options["glib"].shared = True

def validate(self):
if self.options.shared and self.options.with_glib and not self.options["glib"].shared:
raise ConanInvalidConfiguration(
"Linking a shared library against static glib can cause unexpected behaviour."
)

def source(self):
tools.get(**self.conan_data["sources"][self.version],
Expand Down Expand Up @@ -101,3 +109,6 @@ def package_info(self):
self.cpp_info.components["graphene-gobject-1.0"].includedirs = [os.path.join("include", "graphene-1.0")]
self.cpp_info.components["graphene-gobject-1.0"].names["pkg_config"] = "graphene-gobject-1.0"
self.cpp_info.components["graphene-gobject-1.0"].requires = ["graphene-1.0", "glib::gobject-2.0"]

def package_id(self):
self.info.requires["glib"].full_package_mode()

0 comments on commit 5e96728

Please sign in to comment.