Commit cd6f4841 authored by Iñigo Martínez's avatar Iñigo Martínez

build: Revised meson build

Minor aesthetic changes that improve readibility.
parent f07ddbee
......@@ -11,9 +11,7 @@ install_headers(
subdir: meson.project_name()
)
private_headers = files(
'gepub-utils.h'
)
private_headers = files('gepub-utils.h')
sources = files(
'gepub-archive.c',
......@@ -25,18 +23,11 @@ sources = files(
symbol_map = 'gepub.map'
ldflags = [
'-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbol_map)
]
gepub_ldflags = []
ldflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbol_map)
ldflags = []
if host_machine.system().contains('linux')
foreach ldflag: ldflags
if cc.has_argument(ldflag)
gepub_ldflags += ldflag
endif
endforeach
if host_machine.system().contains('linux') and cc.has_argument(ldflag)
ldflags += ldflag
endif
libgepub = library(
......@@ -46,7 +37,7 @@ libgepub = library(
soversion: soversion,
include_directories: top_inc,
dependencies: gepub_deps,
link_args: gepub_ldflags,
link_args: ldflags,
link_depends: symbol_map,
install: true,
install_dir: gepub_libdir
......@@ -70,22 +61,18 @@ pkg.generate(
'libxml-2.0',
'libarchive'
],
variables: [
'exec_prefix=' + gepub_libexecdir
],
variables: 'exec_prefix=' + gepub_libexecdir,
install_dir: join_paths(gepub_libdir, 'pkgconfig')
)
if get_option('enable-introspection') and get_option('default_library') == 'shared'
gir_inc = [
gir_incs = [
'GObject-2.0',
'libxml2-2.0',
'WebKit2-4.0'
]
gir_extra_args = [
'--warn-all'
]
gir_extra_args = '--warn-all'
gir_dir = join_paths(gepub_datadir, '@0@-@1@'.format('gir', gepub_gir_version))
typelib_dir = join_paths(gepub_libdir, '@0@-@1@'.format('girepository', gepub_gir_version))
......@@ -95,13 +82,10 @@ if get_option('enable-introspection') and get_option('default_library') == 'shar
sources: sources + headers + private_headers,
namespace: gepub_gir_ns,
nsversion: gepub_version,
identifier_prefix: gepub_gir_ns,
symbol_prefix: gepub_gir_ns.to_lower(),
includes: gir_inc,
include_directories: top_inc,
includes: gir_incs,
extra_args: gir_extra_args,
install: true,
install_dir_gir: gir_dir,
install_dir_typelib: typelib_dir,
extra_args: gir_extra_args
install_dir_typelib: typelib_dir
)
endif
......@@ -32,28 +32,41 @@ cc = meson.get_compiler('c')
config_h = configuration_data()
# package
config_h.set_quoted('PACKAGE', meson.project_name())
config_h.set_quoted('PACKAGE_BUGREPORT', 'danigm@wadobo.com')
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), gepub_version))
config_h.set_quoted('PACKAGE_TARNAME', meson.project_name())
config_h.set_quoted('PACKAGE_URL', '')
config_h.set_quoted('PACKAGE_VERSION', gepub_version)
config_h.set_quoted('PACKAGE_API_VERSION', gepub_version)
config_h.set_quoted('VERSION', gepub_version)
# defines
set_defines = [
# package
['PACKAGE', meson.project_name()],
['PACKAGE_API_VERSION', gepub_version],
['PACKAGE_BUGREPORT', 'danigm@wadobo.com'],
['PACKAGE_NAME', meson.project_name()],
['PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), gepub_version)],
['PACKAGE_TARNAME', meson.project_name()],
['PACKAGE_URL', ''],
['PACKAGE_VERSION', gepub_version],
['VERSION', gepub_version]
]
foreach define: set_defines
config_h.set_quoted(define[0], define[1])
endforeach
# headers
config_h.set('HAVE_DLFCN_H', cc.has_header('dlfcn.h'))
config_h.set('HAVE_INTTYPES_H', cc.has_header('inttypes.h'))
config_h.set('HAVE_MEMORY_H', cc.has_header('memory.h'))
config_h.set('HAVE_STDINT_H', cc.has_header('stdint.h'))
config_h.set('HAVE_STDLIB_H', cc.has_header('stdlib.h'))
config_h.set('HAVE_STRINGS_H', cc.has_header('strings.h'))
config_h.set('HAVE_STRING_H', cc.has_header('string.h'))
config_h.set('HAVE_SYS_STAT_H', cc.has_header('sys/stat.h'))
config_h.set('HAVE_SYS_TYPES_H', cc.has_header('sys/types.h'))
config_h.set('HAVE_UNISTD_H', cc.has_header('unistd.h'))
check_headers = [
['HAVE_DLFCN_H', 'dlfcn.h'],
['HAVE_INTTYPES_H', 'inttypes.h'],
['HAVE_MEMORY_H', 'memory.h'],
['HAVE_STDINT_H', 'stdint.h'],
['HAVE_STDLIB_H', 'stdlib.h'],
['HAVE_STRINGS_H', 'strings.h'],
['HAVE_STRING_H', 'string.h'],
['HAVE_SYS_STAT_H', 'sys/stat.h'],
['HAVE_SYS_TYPES_H', 'sys/types.h'],
['HAVE_UNISTD_H', 'unistd.h']
]
foreach header: check_headers
config_h.set(header[0], cc.has_header(header[1]))
endforeach
# compiler flags
common_flags = ['-DHAVE_CONFIG_H']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment