Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Commit 1d445b8

Browse files
jpakkaneignatenkobrain
authored andcommitted
Can build both either as shared or static.
1 parent f4a82f4 commit 1d445b8

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

meson.build

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
project('zlib', 'c')
22

3-
zlib = static_library('z',
4-
'adler32.c', 'crc32.c', 'deflate.c', 'infback.c', 'inffast.c', 'inflate.c',
3+
src = ['adler32.c', 'crc32.c', 'deflate.c', 'infback.c', 'inffast.c', 'inflate.c',
54
'inftrees.c', 'trees.c', 'zutil.c',
6-
'compress.c', 'uncompr.c', 'gzclose.c', 'gzlib.c', 'gzread.c', 'gzwrite.c')
5+
'compress.c', 'uncompr.c', 'gzclose.c', 'gzlib.c', 'gzread.c', 'gzwrite.c']
6+
7+
if get_option('shared_lib')
8+
zlib = shared_library('z', src)
9+
else
10+
zlib = static_library('z', src)
11+
endif
712

813
incdir = include_directories('.')

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
option('shared_lib', type : 'boolean', value : false)

upstream.wrap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ directory = zlib-1.2.8
44
source_url = http://zlib.net/zlib-1.2.8.tar.gz
55
source_filename = zlib-1.2.8.tar.gz
66
source_hash = 36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d
7-

0 commit comments

Comments
 (0)