Skip to content

Commit

Permalink
Do just one library lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Aug 12, 2021
1 parent ba81a73 commit e5b4507
Showing 1 changed file with 11 additions and 38 deletions.
49 changes: 11 additions & 38 deletions subprojects/packagefiles/openssl/meson.build
Expand Up @@ -300,34 +300,12 @@ if host_machine.system() == 'windows'
c_args += [
'-wd4090', '-Gs0', '-GF', '-Gy', '-nologo',
]
foreach library: openssl_libraries
dependencies += [
compiler.find_library(library),
]
endforeach
else
foreach library: openssl_libraries
dependencies += [
compiler.find_library(
library,
static: get_option('default_library') == 'static',
),
]
endforeach
endif
elif host_machine.system() == 'darwin'
defines += [
'OPENSSLDIR="/System/Library/OpenSSL/"',
'ENGINESDIR="/dev/null"',
]
foreach library: openssl_libraries
dependencies += [
compiler.find_library(
library,
static: get_option('default_library') == 'static',
),
]
endforeach
c_args += [
'-Wno-missing-field-initializers',
]
Expand All @@ -337,29 +315,13 @@ elif host_machine.system() == 'sunos'
'ENGINESDIR="/dev/null"',
'__EXTENSIONS__'
]
foreach library: openssl_libraries
dependencies += [
compiler.find_library(
library,
static: get_option('default_library') == 'static',
),
]
endforeach
else
# linux and others
defines += [
'OPENSSLDIR="/etc/ssl"',
'ENGINESDIR="/dev/null"',
'TERMIOS',
]
foreach library: openssl_libraries
dependencies += [
compiler.find_library(
library,
static: get_option('default_library') == 'static',
),
]
endforeach
c_args += [
'-Wno-missing-field-initializers',
]
Expand All @@ -370,6 +332,17 @@ else
endif
endif

# MSVC fails with "ERROR: C static library 'ws2_32' not found"
try_static_libs = get_option('default_library') == 'static' and compiler.get_id() != 'msvc'
foreach library: openssl_libraries
dependencies += [
compiler.find_library(
library,
static: try_static_libs,
),
]
endforeach

# We may need to add some defines for static builds
if get_option('default_library') == 'static'
defines += [
Expand Down

0 comments on commit e5b4507

Please sign in to comment.