build: code cleanup
authorJohn Marshall <jtm.home@gmail.com>
Sun, 7 Jun 2020 14:54:43 +0000 (15:54 +0100)
committerJohn Marshall <jtm.home@gmail.com>
Thu, 25 Jun 2020 07:06:54 +0000 (08:06 +0100)
babl/base/meson.build
docs/graphics/meson.build
extensions/meson.build
meson.build
tools/meson.build

index 97ec38b23c6502d9123ee51d8e96ce608b2893cb..a78fd847b700897190b357a74af64730d0882f67 100644 (file)
@@ -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],
 )
index 607a0c60d0a8cb3a09b32b23e32a121a22f1bee5..1e1c55d51e4e1d69d53c35bf18941788962c305e 100644 (file)
@@ -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,
index 8d96066431fd5c6a109b4b92255c854d315946b8..c25471811bacf4476c6553f8904111eee937fb2f 100644 (file)
@@ -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
index 071cbcd9b4682483d7d99272882a1dc5348460d6..814906f02e87a3909a08e28c58b78c8625e6f312 100644 (file)
@@ -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(
index 13b55d09c9ee5f3c57ecb2e19cde81ec7f9ac860..12180def37da6a27aa90d6b96aea4dcda09611c7 100644 (file)
@@ -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,
   )