[meson] add matching -I for lua lib version
@@ -382,9 +382,24 @@ if get_option('with_lua')
found_lua = false
foreach l: ['lua5.3', 'lua-5.3', 'lua5.2', 'lua-5.2', 'lua5.1', 'lua-5.1', 'lua']
if not(found_lua)
+ liblua = dependency(l, required: false)
+ if (liblua.found())
+ found_lua = true
+ else
liblua = compiler.find_library(l, required: false)
if (liblua.found())
- found_lua = liblua.found()
+ found_lua = true
+ liblua_found_header = false
+ foreach ib: include_base_paths
+ if not(liblua_found_header)
+ i = join_paths(ib, l)
+ if compiler.has_header(join_paths(i, 'lua.h'))
+ liblua_found_header = true
+ liblua += [ declare_dependency(include_directories: include_directories(i)) ]
+ endif
+ endif
+ endforeach
+ endif
endif
endif
endforeach
