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

build: properly handle public dependencies #1232

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
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
22 changes: 13 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,30 @@ deps_libpistache = [
dependency('threads'),
date_dep
]
public_deps = []

if get_option('PISTACHE_USE_RAPIDJSON')
rapidjson_dep = dependency('RapidJSON', fallback: ['rapidjson', 'rapidjson_dep'])
deps_libpistache += rapidjson_dep
public_deps += rapidjson_dep
endif

# Support Brotli compressed Content-Encoding responses...
if get_option('PISTACHE_USE_CONTENT_ENCODING_BROTLI')

# Need Brotli encoder for library...
brotli = dependency('libbrotlienc')
deps_libpistache += brotli

# Need Brotli encoder for library...
brotli_dep = dependency('libbrotlienc')
deps_libpistache += brotli_dep
public_deps += brotli_dep
endif

# Support deflate compressed Content-Encoding responses...
if get_option('PISTACHE_USE_CONTENT_ENCODING_DEFLATE')

# Need zlib...
zlib = dependency('zlib')
deps_libpistache += zlib

# Need zlib...
zlib_dep = dependency('zlib')
deps_libpistache += zlib_dep
public_deps += zlib_dep
endif

# Check if -latomic is needed - https://github.com/llvm/llvm-project/blob/main/llvm/cmake/modules/CheckAtomic.cmake
Expand Down Expand Up @@ -130,7 +132,9 @@ if compiler_id == 'gcc' and compiler.version().version_compare('<9.1') or compil
endif

if get_option('PISTACHE_USE_SSL')
deps_libpistache += dependency('openssl')
openssl_dep = dependency('openssl')
deps_libpistache += openssl_dep
public_deps += openssl_dep
endif

if host_machine.system() == 'darwin' or host_machine.system().endswith('bsd') or get_option('PISTACHE_FORCE_LIBEVENT')
Expand Down
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pistache_dep = declare_dependency(
compile_args: public_args,
include_directories: incl_pistache,
link_with: libpistache,
dependencies: [ rapidjson_dep ]
dependencies: public_deps
)

if meson.version().version_compare('>=0.54.0')
Expand Down
Loading