Skip to content

Commit

Permalink
subprojects/zlib: Improve meson.build, emulating configure script (#3759
Browse files Browse the repository at this point in the history
)

* subprojects/zlib: Improve meson.build, emulating configure script
* Update zlib to 1.3
  • Loading branch information
ur4t authored Aug 24, 2023
1 parent 762feed commit f0c932f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
project('zlib', 'c', version : '1.2.13', license : 'zlib')
project('zlib', 'c', version : '1.3', license : 'zlib')

cc = meson.get_compiler('c')

link_args = []
compile_args = []
if cc.get_id() == 'msvc'
add_project_arguments('-D_CRT_SECURE_NO_DEPRECATE',
'-D_CRT_NONSTDC_NO_DEPRECATE', language : 'c')
else
if cc.get_argument_syntax() == 'msvc'
add_project_arguments(
'-D_CRT_SECURE_NO_DEPRECATE',
'-D_CRT_NONSTDC_NO_DEPRECATE',
language : 'c')
elif cc.get_argument_syntax() == 'gcc'
# Don't spam consumers of this wrap with these warnings
compile_args += cc.get_supported_arguments(['-Wno-implicit-fallthrough',
'-Wno-implicit-function-declaration'])
if cc.get_id() == 'gcc' and host_machine.system() != 'windows'
vflag = '-Wl,--version-script,@0@/zlib.map'.format(meson.current_source_dir())
link_args += [vflag]
compile_args += cc.get_supported_arguments('-Wno-implicit-fallthrough')
if host_machine.system() not in ['windows', 'darwin']
link_args += '-Wl,--version-script,@0@/zlib.map'.format(meson.current_source_dir())
endif
endif

if cc.has_header('unistd.h')
compile_args += '-DHAVE_UNISTD_H'
endif

if cc.has_header('stdarg.h')
compile_args += '-DHAVE_STDARG_H'
endif

src = files([
'adler32.c',
'crc32.c',
Expand Down
12 changes: 6 additions & 6 deletions subprojects/zlib.wrap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[wrap-file]
directory = zlib-1.2.13
source_url = https://raw.githubusercontent.com/rizinorg/fallback-repo/main/zlib-1.2.13.tar.gz
source_filename = zlib-1.2.13.tar.gz
source_hash = b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30
patch_directory = zlib-1.2.13
source_fallback_url = https://zlib.net/fossils/zlib-1.2.13.tar.gz
directory = zlib-1.3
source_url = https://raw.githubusercontent.com/rizinorg/fallback-repo/main/zlib-1.3.tar.gz
source_filename = zlib-1.3.tar.gz
source_hash = ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e
patch_directory = zlib-1.3
source_fallback_url = https://zlib.net/fossils/zlib-1.3.tar.gz

0 comments on commit f0c932f

Please sign in to comment.