* Update meson.build
- add logic to loop over more lua names (in the future more names might be discovered)
- disable warnings and errors on dependencies

* adding missing includes and checks, correct data types, pointer mess […]
- various functions from string.h were used but never defined
- logic was done across multiple different data types with different signedness, got all of them up to snuff
- give 0 sized array size of 1 (array of size 0 is illegal, but rewriting the code is out of the scope of this commit)
- add preprocessor that marks possibly unused argument as such (does not mean they will get optimized out or anything)
- correctly initialize structs with all data needed

All these were found by generating the project using `meson -Dwarning_level=3 -Dwerror=true`

* remove undefined behavior, correct data types

* Comment manual bit manipulation to be investigated

* check for more edge cases, replace multiple cleanups with goto

* remove system specific includes
This commit is contained in:
Jan
2022-04-15 11:34:46 -04:00
committed by GitHub
parent d323917538
commit fff10a2612
10 changed files with 158 additions and 90 deletions
+21 -13
View File
@@ -69,30 +69,38 @@ endif
if not get_option('source-only')
libm = cc.find_library('m', required : false)
libdl = cc.find_library('dl', required : false)
lua_fallback = ['lua', 'lua_dep']
lua_quick_fallback = []
if get_option('wrap_mode') == 'forcefallback'
lua_quick_fallback = lua_fallback
endif
lua_dep = dependency('lua5.4', fallback: lua_quick_fallback, required : false)
if not lua_dep.found()
lua_dep = dependency('lua', fallback: ['lua', 'lua_dep'],
default_fallback_options = ['warning_level=0', 'werror=false']
# Lua has no official .pc file
# so distros come up with their own names
lua_names = [
'lua5.4', # Debian
'lua-5.4', # FreeBSD
'lua', # Fedora
]
foreach lua : lua_names
last_lua = (lua == lua_names[-1])
lua_dep = dependency(lua, fallback: last_lua ? ['lua', 'lua_dep'] : [], required : last_lua,
version: '>= 5.4',
default_options: ['default_library=static', 'line_editing=false', 'interpreter=false']
default_options: default_fallback_options + ['default_library=static', 'line_editing=false', 'interpreter=false']
)
endif
if lua_dep.found()
break
endif
endforeach
pcre2_dep = dependency('libpcre2-8', fallback: ['pcre2', 'libpcre2_8'],
default_options: ['default_library=static', 'grep=false', 'test=false']
default_options: default_fallback_options + ['default_library=static', 'grep=false', 'test=false']
)
freetype_dep = dependency('freetype2', fallback: ['freetype2', 'freetype_dep'],
default_options: ['default_library=static', 'zlib=disabled', 'bzip2=disabled', 'png=disabled', 'harfbuzz=disabled', 'brotli=disabled']
default_options: default_fallback_options + ['default_library=static', 'zlib=disabled', 'bzip2=disabled', 'png=disabled', 'harfbuzz=disabled', 'brotli=disabled']
)
sdl_dep = dependency('sdl2', fallback: ['sdl2', 'sdl2_dep'],
default_options: ['default_library=static']
default_options: default_fallback_options + ['default_library=static']
)
lite_deps = [lua_dep, sdl_dep, freetype_dep, pcre2_dep, libm, libdl]