-
Notifications
You must be signed in to change notification settings - Fork 4
/
meson.build.tmpl
107 lines (106 loc) · 2.64 KB
/
meson.build.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# OpenSSL library
libcrypto_sources = [
%%-
foreach $src (@libcrypto_srcs) {
$OUT .= " '$src',\n";
}
foreach $src (@generated_srcs) {
if ($src !~ /\.ld/) {
$OUT .= " 'generated-config/archs/$arch/$asm/$src',\n";
}
}
-%%]
libssl_sources = [
%%-
foreach $src (@libssl_srcs) {
$OUT .= " '$src',\n";
}
-%%]
openssl_defines = [
%%-
foreach $define (@{$config{defines}}) {
# We rely on Meson's `b_ndebug` instead
if ($define ne 'NDEBUG') {
$OUT .= " '$define',\n";
}
}
foreach $define (@lib_cppflags) {
$OUT .= " '$define',\n";
}
foreach $define (@{$target{defines}}) {
$OUT .= " '$define',\n";
}
foreach $define (@{lib_defines}) {
$OUT .= " '$define',\n";
}
foreach $define (@{$config{lib_defines}}) {
$OUT .= " '$define',\n";
}
-%%]
openssl_cflags = [
%%-
my %cflags_used;
if (!$is_win) {
my @cflags_filtered = grep { !/^-arch / } @cflags;
@cflags_filtered = grep { !/^-isysroot / } @cflags_filtered;
foreach $cflag (@cflags_filtered) {
foreach $single_cflag (split / /, $cflag) {
# Warning and optimization levels are configured on Meson level now, threads will be handled in the root `meson.build`
if (
$single_cflag ne '-Wall' &&
$single_cflag ne '-O2' &&
$single_cflag ne '-O3' &&
$single_cflag !~ /^--sysroot=/ &&
$single_cflag !~ /^-m(32|64|arch=.+|abi=.+|no-unaligned-access)$/ &&
$single_cflag !~ /^-mips/ &&
$single_cflag ne '-fomit-frame-pointer' &&
$single_cflag ne '-pthread' &&
$single_cflag ne '-Wa,--noexecstack' &&
!exists($cflags_used{$single_cflag} )
) {
$OUT .= " '$single_cflag',\n";
$cflags_used{$single_cflag} = true;
}
}
}
}
-%%]
openssl_libraries = [
%%-
foreach $ex_lib (split / /, $target{ex_libs}) {
# Threads will be handled in the root `meson.build`
if ($ex_lib ne '-pthread') {
# *nix
if (substr($ex_lib, 0, 2) eq '-l') {
$ex_lib = substr($ex_lib, 2);
$OUT .= " '$ex_lib',\n";
}
# Windows
if ($ex_lib =~ /\.lib$/) {
$ex_lib = substr($ex_lib, 0, length($ex_lib) - 4);
$OUT .= " '$ex_lib',\n";
}
}
}
-%%]
openssl_include_directories = [
'generated-config/archs/%%-$arch-%%/%%-$asm-%%',
'generated-config/archs/%%-$arch-%%/%%-$asm-%%/include',
'generated-config/archs/%%-$arch-%%/%%-$asm-%%/providers/common/include',
]
# OpenSSL CLI
openssl_cli_sources = [
%%-
foreach $src (@apps_openssl_srcs) {
if ($src eq 'apps/progs.c') {
$OUT .= " 'generated-config/archs/$arch/$asm/$src',\n";
} else {
unless ($src eq "apps/openssl.rc") {
$OUT .= " '$src',\n";
}
}
}
foreach $src (@libapps_srcs) {
$OUT .= " '$src',\n";
}
-%%]