Skip to content

Commit

Permalink
build: meson options for custom OpenSSL lib/hdr path
Browse files Browse the repository at this point in the history
Required in case the openssl library is not native to the build
environment (e.g. part of vcpkg fetched dependencies).
  • Loading branch information
bharathkumarkm authored and win32asm committed Aug 29, 2023
1 parent fe5639a commit edbf2ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,16 @@ if compiler_id == 'gcc' and compiler.version().version_compare('<9.1') or compil
endif

if get_option('PISTACHE_USE_SSL')
deps_libpistache += dependency('openssl')
ssl_lib_dir = get_option('PISTACHE_SSL_LIB_DIR')
ssl_hdr_dir = get_option('PISTACHE_SSL_INC_DIR')
if ssl_lib_dir != '' and ssl_hdr_dir != ''
deps_libpistache += declare_dependency(
link_args : ['-L' + ssl_lib_dir, '-lcrypto', '-lssl', '-ldl'],
include_directories : include_directories(ssl_hdr_dir)
)
else
deps_libpistache += dependency('openssl')
endif
endif

version_array = []
Expand Down
2 changes: 2 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ option('PISTACHE_INSTALL', type: 'boolean', value: true, description: 'add pista
option('PISTACHE_USE_SSL', type: 'boolean', value: false, description: 'add support for SSL server')
option('PISTACHE_USE_RAPIDJSON', type: 'boolean', value: true, description: 'add support for rapidjson')
option('PISTACHE_USE_CONTENT_ENCODING_DEFLATE', type: 'boolean', value: false, description: 'add support for deflate compressed content encoding')
option('PISTACHE_SSL_LIB_DIR', type: 'string', description: 'SSL library path')
option('PISTACHE_SSL_INC_DIR', type: 'string', description: 'SSL headers path')
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.2.20230803
0.2.2.20230828

0 comments on commit edbf2ee

Please sign in to comment.