diff --git a/recipes/pixman/all/conanfile.py b/recipes/pixman/all/conanfile.py index a5d1aeafc9a5da..5b72fdadecfdc0 100644 --- a/recipes/pixman/all/conanfile.py +++ b/recipes/pixman/all/conanfile.py @@ -11,6 +11,7 @@ from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -50,8 +51,8 @@ def layout(self): basic_layout(self, src_folder="src") def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("pixman can only be built as a static library on Windows") + if self.settings.os == "Windows" and self.options.shared and Version(self.version) < "0.40.0": + raise ConanInvalidConfiguration(f"pixman/{self.version} can only be built as a static library on Windows") def build_requirements(self): self.tool_requires("meson/1.1.1") @@ -88,12 +89,12 @@ def package(self): rmdir(self, os.path.join(lib_folder, "pkgconfig")) rm(self, "*.la", lib_folder) fix_apple_shared_install_name(self) - if is_msvc(self): + if is_msvc(self) and not self.options.shared: prefix = "libpixman-1" rename(self, os.path.join(lib_folder, f"{prefix}.a"), os.path.join(lib_folder, f"{prefix}.lib")) def package_info(self): - self.cpp_info.libs = ['libpixman-1'] if self.settings.os == "Windows" else ['pixman-1'] + self.cpp_info.libs = ['libpixman-1'] if self.settings.os == "Windows" and not self.options.shared else ['pixman-1'] self.cpp_info.includedirs.append(os.path.join("include", "pixman-1")) self.cpp_info.set_property("pkg_config_name", "pixman-1") if self.settings.os in ("FreeBSD", "Linux"):