qulogic/gplugin

Add public headers to gplugin_dep.
feature/meson
2016-12-18, Elliott Sales de Andrade
67310e92c974
Add public headers to gplugin_dep.

This ensures that they are built before anything that uses them, such
as tests.
if get_option('lua')
if not get_option('gobject-introspection')
error('Lua plugin requires GObject Introspection.')
endif
GPLUGIN_LUA_SOURCES = [
'gplugin-lua-core.c',
'gplugin-lua-loader.c',
'gplugin-lua-plugin.c',
]
GPLUGIN_LUA_HEADERS = [
'gplugin-lua-loader.h',
'gplugin-lua-plugin.h',
]
_LUAS = [['lua', '>=5.1.0'],
['lua5.1', '>=5.1.0'],
['luajit', '>=2.0.0'],
['lua5.2', '>=5.2.0']]
LUA_FOUND = false
foreach _LUA : _LUAS
if not LUA_FOUND
LUA = dependency(_LUA[0], version : _LUA[1], required : false)
LUA_FOUND = LUA.found()
endif
endforeach
if not LUA_FOUND
error('No usable Lua library was found')
endif
# Compile and run our lua-lgi test program
lua_lgi_test = compiler.run(files('gplugin-lua-test-lgi.c'),
dependencies : LUA,
name : 'lua "lgi" module')
if not lua_lgi_test.compiled() or lua_lgi_test.returncode() != 0
error('Failed to find the "lgi" lua module')
endif
# now add the library
shared_library('gplugin-lua',
GPLUGIN_LUA_SOURCES,
GPLUGIN_LUA_HEADERS,
name_prefix : '',
dependencies : [LUA, gplugin_dep],
install : true,
install_dir : get_option('libdir') + '/gplugin'
)
endif # lua
if get_option('testing')
subdir('tests')
endif