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

Allow to set ENABLE_HARU and WT_RASTERIMAGE_IMPLEMENTATION #18009

Merged
17 changes: 15 additions & 2 deletions recipes/wt/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class WtConan(ConanFile):
"with_dbo": [True, False],
"with_opengl": [True, False],
"with_unwind": [True, False],
"with_haru": [True, False],
"raster_image": ["none", "Direct2D", "GraphicsMagick"],
"no_std_locale": [True, False],
"no_std_wstring": [True, False],
"multi_threaded": [True, False],
Expand All @@ -51,6 +53,8 @@ class WtConan(ConanFile):
"with_dbo": True,
"with_opengl": False,
"with_unwind": True,
"with_haru": False,
"raster_image": "none",
"no_std_locale": False,
"no_std_wstring": False,
"multi_threaded": True,
Expand Down Expand Up @@ -112,7 +116,9 @@ def requirements(self):
self.requires("odbc/2.3.11")
if self.options.get_safe("with_unwind"):
self.requires("libunwind/1.7.2")

if self.options.with_haru:
self.requires("libharu/2.4.3")

def validate(self):
miss_boost_required_comp = any(self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True)
for boost_comp in self._required_boost_components)
Expand All @@ -121,6 +127,8 @@ def validate(self):
f"{self.ref} requires non header-only boost with these components: "
f"{', '.join(self._required_boost_components)}"
)
if self.options.get_safe("raster_image", "none") == "Direct2D" and self.settings.os != "Windows":
raise ConanInvalidConfiguration("Direct2D is supported only on Windows.")

# FIXME: https://redmine.emweb.be/issues/12073w
if conan_version.major == 2 and Version(self.version) == "4.10.1" and is_msvc(self):
Expand Down Expand Up @@ -178,7 +186,7 @@ def generate(self):
tc.variables["BUILD_EXAMPLES"] = False
tc.variables["BUILD_TESTS"] = False
tc.variables["ENABLE_SSL"] = self.options.with_ssl
tc.variables["ENABLE_HARU"] = False
tc.variables["ENABLE_HARU"] = self.options.with_haru
tc.variables["ENABLE_PANGO"] = False
tc.variables["ENABLE_SQLITE"] = self.options.get_safe("with_sqlite", False)
tc.variables["ENABLE_POSTGRES"] = self.options.get_safe("with_postgres", False)
Expand All @@ -191,6 +199,7 @@ def generate(self):
tc.variables["ENABLE_LIBWTDBO"] = self.options.with_dbo
tc.variables["ENABLE_OPENGL"] = self.options.with_opengl
tc.variables["ENABLE_UNWIND"] = self.options.get_safe("with_unwind", False)
tc.variables["WT_WRASTERIMAGE_IMPLEMENTATION"] = self.options.get_safe("raster_image", "none")
tc.variables["WT_NO_STD_LOCALE"] = self.options.no_std_locale
tc.variables["WT_NO_STD_WSTRING"] = self.options.no_std_wstring
tc.variables["MULTI_THREADED"] = self.options.multi_threaded
Expand Down Expand Up @@ -227,6 +236,8 @@ def generate(self):
tc.variables["ODBC_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("odbc"))
tc.variables["ODBC_INCLUDE"] = self._cmakify_path_list(self.dependencies["odbc"].cpp_info.aggregated_components().includedirs)
tc.variables["ODBC_FOUND"] = True
if self.options.with_haru:
tc.variables["HARU_PREFIX"] = self._cmakify_path_list(self.dependencies["libharu"].package_folder)
if self.options.get_safe("with_unwind"):
tc.variables["UNWIND_PREFIX"] = self._cmakify_path_list([self.dependencies["libunwind"].package_folder])
if self.settings.os == "Windows":
Expand Down Expand Up @@ -306,6 +317,8 @@ def package_info(self):
self.cpp_info.components["wtmain"].requires.append("openssl::openssl")
if self.options.get_safe("with_unwind"):
self.cpp_info.components["wtmain"].requires.append("libunwind::libunwind")
if self.options.with_haru:
self.cpp_info.components["wtmain"].requires.append("libharu::libharu")

# wttest
if self.options.with_test:
Expand Down