From: John Marshall Date: Sun, 7 Jun 2020 14:54:43 +0000 (+0100) Subject: build: code cleanup X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~8^2~11 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4b152b35bd952118fa4a343b7d4494b951fcb95a;p=babl.git build: code cleanup --- diff --git a/babl/base/meson.build b/babl/base/meson.build index 97ec38b..a78fd84 100644 --- a/babl/base/meson.build +++ b/babl/base/meson.build @@ -18,6 +18,6 @@ babl_base_sources = [ babl_base = static_library('babl_base', babl_base_sources, - include_directories: [ rootInclude, bablInclude, ], - dependencies: [ math, lcms], + include_directories: [rootInclude, bablInclude], + dependencies: [math, lcms], ) diff --git a/docs/graphics/meson.build b/docs/graphics/meson.build index 607a0c6..1e1c55d 100644 --- a/docs/graphics/meson.build +++ b/docs/graphics/meson.build @@ -14,26 +14,20 @@ graphic_files_install += configure_file( copy: true ) -foreach file : graphic_files +foreach _file : graphic_files # Copy svg files to build graphic_files_install += configure_file( - input: file, + input: _file, output: '@PLAINNAME@', copy: true ) endforeach if rsvg_convert_bin.found() - foreach file : graphic_files - sizeinfo = ( - file.contains('a4poster') - ? [ '-w', '256', ] - : [] - ) - - graphic_files_install += custom_target( - file, - input: file, + foreach _file : graphic_files + sizeinfo = _file.contains('a4poster') ? ['-w', '256'] : [] + graphic_files_install += custom_target(_file, + input: _file, output: '@BASENAME@.png', command: [ rsvg_convert_bin, diff --git a/extensions/meson.build b/extensions/meson.build index 8d96066..c254718 100644 --- a/extensions/meson.build +++ b/extensions/meson.build @@ -17,7 +17,7 @@ babl_ext_inc = [ # Linker arguments babl_ext_link_args = [ ] -if platform_win32 +if platform_win32 and cc.has_link_argument('-Wl,--no-undefined') babl_ext_link_args += '-Wl,--no-undefined' endif @@ -43,7 +43,7 @@ extensions = [ ['HSV', no_cflags], ['naive-CMYK', no_cflags], ['simple', no_cflags], - ['sse-half', [sse4_1_cflags, f16c_cflags]], + ['sse-half', [sse4_1_cflags, f16c_cflags]], ['sse2-float', sse2_cflags], ['sse2-int16', sse2_cflags], ['sse2-int8', sse2_cflags], @@ -64,6 +64,6 @@ foreach ext : extensions dependencies: babl_ext_dep, name_prefix: '', install: true, - install_dir: join_paths(get_option('libdir'), lib_name), + install_dir: babl_libdir / lib_name, ) endforeach diff --git a/meson.build b/meson.build index 071cbcd..814906f 100644 --- a/meson.build +++ b/meson.build @@ -3,9 +3,6 @@ project('babl', 'c', version: '0.1.79', meson_version: '>=0.53.0', default_options: [ - 'sysconfdir=/etc', - 'localstatedir=/var', - 'sharedstatedir=/var/lib', 'buildtype=debugoptimized' ], # https://gitlab.gnome.org/GNOME/babl/issues/ @@ -20,11 +17,9 @@ project('babl', 'c', # if backwards compatibility has been broken, # set BABL_BINARY_AGE _and_ BABL_INTERFACE_AGE to 0. - conf = configuration_data() pkgconfig = import('pkgconfig') -i18n = import('i18n') gnome = import('gnome') python = import('python') @@ -156,7 +151,9 @@ common_c_flags = [] if buildtype == 'debugoptimized' or buildtype == 'release' common_c_flags += cc.get_supported_arguments(['-Ofast']) endif -common_c_flags += cc.get_supported_arguments(['-fno-unsafe-math-optimizations']) +common_c_flags += cc.get_supported_arguments( + ['-fno-unsafe-math-optimizations'] +) extra_warnings_list = [ '-Wdeclaration-after-statement', @@ -342,12 +339,16 @@ endif ################################################################################ # Build utilities -env_bin = find_program('env', required: false, native: true) +# build from git repo git_bin = find_program('git', required: false, native: true) + +# docs +env_bin = find_program('env', required: false, native: true) rsvg_convert_bin = find_program('rsvg-convert', required: false, native: true) w3m_bin = find_program('w3m', required: false, native: true) + ################################################################################ # Build flags @@ -360,6 +361,9 @@ if get_option('with-docs') != 'false' and not env_bin.found() elif get_option('with-docs') == 'auto' if meson.is_cross_build() build_docs = false + message( + 'configure with -Ddocs=true to cross-build documentation' + ) endif elif get_option('with-docs') == 'false' build_docs = false @@ -431,6 +435,7 @@ pkgconfig.generate(filebase: 'babl', summary( { 'prefix': babl_prefix, + 'libdir': get_option('libdir'), }, section: 'Directories' ) summary( diff --git a/tools/meson.build b/tools/meson.build index 13b55d0..12180de 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -15,9 +15,9 @@ tool_names = [ foreach tool_name : tool_names tool = executable(tool_name, tool_name + '.c', - include_directories: [ rootInclude, bablInclude, ], - link_with: [ babl, ], - dependencies: [ math, thread, ], + include_directories: [rootInclude, bablInclude], + link_with: babl, + dependencies: [math, thread], install: false, )