stamp_gegl_enums = custom_target('stamp-pika-gegl-enums.h',
  input : [
    files(
      'pika-gegl-enums.h'
    ),
  ],
  output: [ 'stamp-pika-gegl-enums.h', ],
  command: [
    mkenums_wrap, perl,
    meson.project_source_root(), meson.current_source_dir(),
    meson.current_build_dir(),
    'pika-gegl-',
    '#include <gio/gio.h>\n'              +
    '#include "libpikabase/pikabase.h"\n' +
    '#include "core/core-enums.h"\n',
    '#include "pika-intl.h"'
  ],
  build_by_default: true
)

libappgegl_loops = simd.check('pika-gegl-loops-simd',
  sse2: 'pika-gegl-loops-sse2.c',
  compiler: cc,
  include_directories: [ rootInclude, rootAppInclude, ],
  dependencies: [
    cairo,
    gegl,
    gdk_pixbuf,
  ],
)

libappgegl_sources = [
  'pika-babl-compat.c',
  'pika-babl.c',
  'pika-gegl-apply-operation.c',
  'pika-gegl-loops.cc',
  'pika-gegl-mask-combine.cc',
  'pika-gegl-mask.c',
  'pika-gegl-nodes.c',
  'pika-gegl-tile-compat.c',
  'pika-gegl-utils.c',
  'pika-gegl.c',
  'pikaapplicator.c',
  'pikatilehandlervalidate.c',

  'pika-gegl-enums.c',
  stamp_gegl_enums
]

libappgegl = static_library('appgegl',
  libappgegl_sources,
  link_with: libappgegl_loops[0],
  include_directories: [ rootInclude, rootAppInclude, ],
  c_args: '-DG_LOG_DOMAIN="Pika-GEGL"',
  dependencies: [
    cairo,
    gegl,
    gdk_pixbuf,
  ],
)
