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

brunsli: allow shared brotli dependency #21238

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions recipes/brunsli/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file, save
Expand Down Expand Up @@ -37,7 +36,6 @@ def config_options(self):
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
self.options["brotli"].shared = False

def layout(self):
cmake_layout(self, src_folder="src")
Expand All @@ -48,8 +46,6 @@ def requirements(self):
def validate(self):
if self.settings.compiler.cppstd:
check_min_cppstd(self, 11)
if self.dependencies["brotli"].options.shared:
raise ConanInvalidConfiguration("brotli must be built as a static library")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down Expand Up @@ -94,7 +90,9 @@ def package(self):

def package_info(self):
self.cpp_info.components["brunslidec-c"].libs = ["brunslidec-c"]
self.cpp_info.components["brunslidec-c"].requires = ["brotli::brotlidec"]
self.cpp_info.components["brunslienc-c"].libs = ["brunslienc-c"]
self.cpp_info.components["brunslienc-c"].requires = ["brotli::brotlienc"]
if not self.options.shared:
self.cpp_info.components["brunslidec-c"].libs += ["brunslicommon-static", "brunslidec-static"]
self.cpp_info.components["brunslienc-c"].libs += ["brunslicommon-static", "brunslienc-static"]