Skip to content

Commit 9a85cd4

Browse files
committed
fix: check boost components in conan recipe
and remove unused variables
1 parent 1c6fac8 commit 9a85cd4

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

recipes/ogre/1.x/conanfile.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ def validate(self):
133133
raise ConanInvalidConfiguration("OGRE 1.x not supported with gcc version greater than 11")
134134
if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) >= 11:
135135
raise ConanInvalidConfiguration("OGRE 1.x not supported with clang version greater than 11")
136+
137+
miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components)
138+
if self.options["boost"].header_only or miss_boost_required_comp:
139+
raise ConanInvalidConfiguration("OGRE requires these boost components: {}".format(", ".join(self._required_boost_components)))
136140

137141
@property
138142
def _source_subfolder(self):
@@ -146,6 +150,16 @@ def config_options(self):
146150
def configure(self):
147151
if self.options.shared:
148152
del self.options.fPIC
153+
self._strict_options_requirements()
154+
155+
def _strict_options_requirements(self):
156+
self.options["boost"].header_only = False
157+
for boost_comp in self._required_boost_components:
158+
setattr(self.options["boost"], "without_{}".format(boost_comp), False)
159+
160+
@property
161+
def _required_boost_components(self):
162+
return ["date_time", "thread"]
149163

150164
@functools.lru_cache(1)
151165
def _configure_cmake(self):
@@ -249,7 +263,6 @@ def _create_cmake_module_variables(module_file, version):
249263

250264
@property
251265
def _components(self):
252-
pkg_name = "OGRE"
253266
include_prefix = os.path.join("include", "OGRE")
254267
plugin_lib_dir = os.path.join("lib", "OGRE")
255268
components = {
@@ -321,7 +334,6 @@ def _components(self):
321334
return components
322335

323336
def package_info(self):
324-
version_major = tools.Version(self.version).major
325337
self.cpp_info.set_property("cmake_file_name", "OGRE")
326338
self.cpp_info.names["cmake_find_package"] = "OGRE"
327339
self.cpp_info.names["cmake_find_package_multi"] = "OGRE"

0 commit comments

Comments
 (0)