From 3464f4e934cdbd261ef2ed9b36ec4e7eed673079 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sun, 30 Jan 2022 16:38:55 -0800 Subject: [PATCH] (#9139) ceres-solver: setup options in configure + validate Following up from https://github.com/conan-io/conan-center-index/pull/8902#discussion_r793511997 --- recipes/ceres-solver/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/ceres-solver/all/conanfile.py b/recipes/ceres-solver/all/conanfile.py index 240ff067a7d63..7b49bca54466c 100644 --- a/recipes/ceres-solver/all/conanfile.py +++ b/recipes/ceres-solver/all/conanfile.py @@ -69,6 +69,8 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC + if self.options.use_gflags: + self.options["gflags"].nothreads = False def requirements(self): self.requires("eigen/3.4.0") @@ -76,7 +78,6 @@ def requirements(self): self.requires("glog/0.5.0") if self.options.use_gflags: self.requires("gflags/2.2.2") - self.options["gflags"].nothreads = False if self.options.use_TBB: self.requires("tbb/2020.3") @@ -97,6 +98,8 @@ def validate(self): raise ConanInvalidConfiguration("Ceres-solver only links against the release version of glog") if self.options.use_glog and not self.options.use_gflags: #At this stage we can't check the value of self.options["glog"].with_gflags so we asume it is true because is the default value raise ConanInvalidConfiguration("To depend on glog built with gflags (Default behavior) set use_gflags=True, otherwise Ceres may fail to link due to missing gflags symbols.") + if self.options.use_gflags and self.options["gflags"].nothreads: + raise ConanInvalidConfiguration("Ceres-solver requires options gflags:nothreads=False") # This could use a source as to why if tools.Version(self.version) >= "2.0": # 1.x uses ceres-solver specific FindXXX.cmake modules self.generators.append("cmake_find_package")