Skip to content

Commit

Permalink
[glibmm] review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
planetmarshall committed Feb 3, 2023
1 parent d4b6ddc commit 24ce0b6
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions recipes/glibmm/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def requirements(self):
self.requires("libsigcpp/2.10.8")

def package_id(self):
if not self.options["glib"].shared:
if not self.dependencies["glib"].options.shared:
self.info.requires["glib"].full_package_mode()

def validate(self):
Expand All @@ -84,7 +84,7 @@ def validate(self):
else:
check_min_cppstd(self, 11)

if self.options.shared and not self.dependencies["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."
)
Expand All @@ -111,8 +111,7 @@ def generate(self):
tc.project_options.update({
"build-examples": "false",
"build-documentation": "false",
"msvc14x-parallel-installable": "false",
"default_library": "shared" if self.options.shared else "static"
"msvc14x-parallel-installable": "false"
})
tc.generate()

Expand Down Expand Up @@ -180,17 +179,12 @@ def rename_msvc_static_libs():

def package_info(self):
glibmm_component = f"glibmm-{self._abi_version}"
giomm_component = f"giomm-{self._abi_version}"

self.cpp_info.components[glibmm_component].set_property("pkg_config_name", glibmm_component)
self.cpp_info.components[glibmm_component].libs = [glibmm_component]
self.cpp_info.components[glibmm_component].includedirs = [os.path.join("include", glibmm_component)]
self.cpp_info.components[glibmm_component].requires = ["glib::gobject-2.0", "libsigcpp::libsigcpp"]

if self._abi_version == "2.68":
self.cpp_info.components[glibmm_component].requires = ["glib::gobject-2.0", "libsigcpp::sigc++"]
else:
self.cpp_info.components[glibmm_component].requires = ["glib::gobject-2.0", "libsigcpp::libsigcpp"]

giomm_component = f"giomm-{self._abi_version}"
self.cpp_info.components[giomm_component].set_property("pkg_config_name", giomm_component)
self.cpp_info.components[giomm_component].libs = [giomm_component]
self.cpp_info.components[giomm_component].includedirs = [os.path.join("include", giomm_component)]
Expand Down

0 comments on commit 24ce0b6

Please sign in to comment.