diff --git a/app/config/config-enums.c b/app/config/config-enums.c index ab09025b6a..4c414b9b01 100644 --- a/app/config/config-enums.c +++ b/app/config/config-enums.c @@ -5,7 +5,7 @@ #include #include "libgimpbase/gimpbase.h" #include "config-enums.h" -#include"gimp-intl.h" +#include "gimp-intl.h" /* enumerations from "config-enums.h" */ GType diff --git a/app/config/meson.build b/app/config/meson.build index 4b675e7549..4354a8059a 100644 --- a/app/config/meson.build +++ b/app/config/meson.build @@ -2,7 +2,16 @@ appconfigenums = custom_target('config-enums.c', input : [ 'config-enums.h', ], output: [ 'config-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/app/core/meson.build b/app/core/meson.build index d65661f071..e9a0342a58 100644 --- a/app/core/meson.build +++ b/app/core/meson.build @@ -2,7 +2,16 @@ appcoreenums = custom_target('core-enums', input : [ 'core-enums.h', ], output: [ 'core-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/app/display/display-enums.c b/app/display/display-enums.c index 2ef15fc046..3c00c38b9d 100644 --- a/app/display/display-enums.c +++ b/app/display/display-enums.c @@ -5,7 +5,7 @@ #include #include "libgimpbase/gimpbase.h" #include "display-enums.h" -#include"gimp-intl.h" +#include "gimp-intl.h" /* enumerations from "display-enums.h" */ GType diff --git a/app/display/meson.build b/app/display/meson.build index 05a8494dab..096f058a01 100644 --- a/app/display/meson.build +++ b/app/display/meson.build @@ -2,7 +2,16 @@ appdisplayenums = custom_target('display-enums.c', input : [ 'display-enums.h', ], output: [ 'display-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/app/gegl/meson.build b/app/gegl/meson.build index 50ef7a096a..6cfd438f4a 100644 --- a/app/gegl/meson.build +++ b/app/gegl/meson.build @@ -2,7 +2,17 @@ appgeglenums = custom_target('gimp-gegl-enums.c', input : [ 'gimp-gegl-enums.h', ], output: [ 'gimp-gegl-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "core/core-enums.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/app/meson.build b/app/meson.build index 8e56a0c6ba..c452e49035 100644 --- a/app/meson.build +++ b/app/meson.build @@ -1,14 +1,21 @@ rootAppInclude = include_directories('.') -app_mkenums_custom_target_command = [ - gimp_mkenums, - '--fhead','#include "config.h"\n' - + '#include \n' - + '#include "libgimpbase/gimpbase.h"\n' - + '#include "core/core-enums.h"\n' - + '#include "@INPUT@"\n' - + '#include "gimp-intl.h"\n', +app_mkenums_custom_target_commonargs = [ gimp_mkenums_custom_target_commonargs, + '--dtail',' { 0, NULL, NULL }\n'+ + ' };\n'+ + '\n'+ + ' static GType type = 0;\n'+ + '\n'+ + ' if (G_UNLIKELY (! type))\n'+ + ' {\n'+ + ' type = g_@type@_register_static ("@EnumName@", values);\n'+ + ' gimp_type_set_translation_context (type, "@enumnick@");\n'+ + ' gimp_@type@_set_value_descriptions (type, descs);\n'+ + ' }\n'+ + '\n'+ + ' return type;\n'+ + '}\n', ] subdir('actions') diff --git a/app/operations/meson.build b/app/operations/meson.build index 40ec2707a0..aecc7228ed 100644 --- a/app/operations/meson.build +++ b/app/operations/meson.build @@ -2,7 +2,16 @@ appoperationsenums = custom_target('operations-enums.c', input : [ 'operations-enums.h', ], output: [ 'operations-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/app/paint/meson.build b/app/paint/meson.build index c9d014f8a4..23c168d465 100644 --- a/app/paint/meson.build +++ b/app/paint/meson.build @@ -2,7 +2,16 @@ apppaintenums = custom_target('paint-enums.c', input : [ 'paint-enums.h', ], output: [ 'paint-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/app/plug-in/meson.build b/app/plug-in/meson.build index 079945d645..8713bd32a5 100644 --- a/app/plug-in/meson.build +++ b/app/plug-in/meson.build @@ -2,7 +2,16 @@ apppluginenums = custom_target('plug-in-enums.c', input : [ 'plug-in-enums.h', ], output: [ 'plug-in-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/app/text/meson.build b/app/text/meson.build index d3cf312ecc..f85fc765c1 100644 --- a/app/text/meson.build +++ b/app/text/meson.build @@ -2,7 +2,16 @@ apptextenums = custom_target('text-enums.c', input : [ 'text-enums.h', ], output: [ 'text-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/app/tools/meson.build b/app/tools/meson.build index fa0bdb96fd..b4c4bfd530 100644 --- a/app/tools/meson.build +++ b/app/tools/meson.build @@ -2,7 +2,17 @@ apptoolsenums = custom_target('tools-enums.c', input : [ 'tools-enums.h', ], output: [ 'tools-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "core/core-enums.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/app/widgets/meson.build b/app/widgets/meson.build index d9fce26a31..f7b30b8847 100644 --- a/app/widgets/meson.build +++ b/app/widgets/meson.build @@ -2,7 +2,16 @@ appwidgetsenums = custom_target('widgets-enums.c', input : [ 'widgets-enums.h', ], output: [ 'widgets-enums.c', ], - command: app_mkenums_custom_target_command, + command: [ + gimp_mkenums, + '--fhead','#include "config.h"\n' + + '#include \n' + + '#include "libgimpbase/gimpbase.h"\n' + + '#include "@basename@"\n' + + '#include "gimp-intl.h"\n', + app_mkenums_custom_target_commonargs, + '@INPUT@', + ], capture: true, ) diff --git a/libgimp/meson.build b/libgimp/meson.build index ac4cb34f06..b3e3028538 100644 --- a/libgimp/meson.build +++ b/libgimp/meson.build @@ -12,7 +12,8 @@ gimpenums_notail = custom_target('gimpenums.c.notail', + '#include "libgimpbase/gimpbase-private.h"\n' + '#include "libgimpconfig/gimpconfigenums.h"\n' + '#include "gimpenums.h"\n', - gimp_mkenums_custom_target_commonargs, + libgimp_mkenums_custom_target_commonargs, + '@INPUT@', ], capture: true, ) diff --git a/libgimpbase/meson.build b/libgimpbase/meson.build index 2ee70f15e6..5e1fcfc734 100644 --- a/libgimpbase/meson.build +++ b/libgimpbase/meson.build @@ -16,7 +16,8 @@ gimpbaseenums = custom_target('gimpbaseenums.c', + '#undef GIMP_DISABLE_DEPRECATED\n' + '#include "gimpbasetypes.h"\n' + '#include "libgimp/libgimp-intl.h"\n', - gimp_mkenums_custom_target_commonargs, + libgimp_mkenums_custom_target_commonargs, + '@INPUT@', ], capture: true, ) @@ -29,9 +30,10 @@ gimpcompatenums = custom_target('gimpcompatenums.c', '--fhead','#include "config.h"\n' + '#include \n' + '#include "gimpbasetypes.h"\n' - + '#include "@INPUT@"\n' + + '#include "@basename@"\n' + '#include "libgimp/libgimp-intl.h"\n', - gimp_mkenums_custom_target_commonargs, + libgimp_mkenums_custom_target_commonargs, + '@INPUT@', ], capture: true, ) diff --git a/libgimpconfig/meson.build b/libgimpconfig/meson.build index ce95f4a884..ca3a8dcf17 100644 --- a/libgimpconfig/meson.build +++ b/libgimpconfig/meson.build @@ -7,9 +7,10 @@ gimpconfigenums = custom_target('gimpconfigenums.c', '--fhead','#include "config.h"\n' + '#include \n' + '#include "libgimpbase/gimpbase.h"\n' - + '#include "@INPUT@"\n' + + '#include "@basename@"\n' + '#include "libgimp/libgimp-intl.h"\n', - gimp_mkenums_custom_target_commonargs, + libgimp_mkenums_custom_target_commonargs, + '@INPUT@', ], capture: true, ) diff --git a/libgimpwidgets/meson.build b/libgimpwidgets/meson.build index b54ab4c005..2631d380c0 100644 --- a/libgimpwidgets/meson.build +++ b/libgimpwidgets/meson.build @@ -7,9 +7,10 @@ gimpwidgetsenums = custom_target('gimpwidgetsenums.c', '--fhead','#include "config.h"\n' + '#include \n' + '#include "libgimpbase/gimpbase.h"\n' - + '#include "gimpwidgetsenums.h"\n' + + '#include "@basename@"\n' + '#include "libgimp/libgimp-intl.h"\n', - gimp_mkenums_custom_target_commonargs, + libgimp_mkenums_custom_target_commonargs, + '@INPUT@', ], capture: true, ) diff --git a/meson.build b/meson.build index e775f96522..356195d38a 100644 --- a/meson.build +++ b/meson.build @@ -1092,30 +1092,31 @@ gimp_mkenums_custom_target_commonargs = [ '--dhead',' static const Gimp@Type@Desc descs[] =\n'+ ' {', '--dprod',' { @VALUENAME@, @valuedesc@, @valuehelp@ },'+ - '@if (\'@valueabbrev@\' ne \'NULL\')@ \n'+ - ' /* Translators:\n'+ - ' this is an abbreviated version of @valueudesc@.\n'+ + '@if (\'@valueabbrev@\' ne \'NULL\')@\n'+ + ' /* Translators: this is an abbreviated version of @valueudesc@.\n'+ ' Keep it short. */\n'+ - ' { @VALUENAME@, @valueabbrev@, NULL },\n'+ - ' @endif@', - '--dtail',' { 0, NULL, NULL }\n'+ - ' };\n'+ - '\n'+ - ' static GType type = 0;\n'+ - '\n'+ - ' if (G_UNLIKELY (! type))\n'+ - ' {\n'+ - ' type = g_@type@_register_static ("@EnumName@", values);\n'+ - ' gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");\n'+ - ' gimp_type_set_translation_context (type, "@enumnick@");\n'+ - ' gimp_@type@_set_value_descriptions (type, descs);\n'+ - ' }\n'+ - '\n'+ - ' return type;\n'+ - '}\n', - '@INPUT@', + ' { @VALUENAME@, @valueabbrev@, NULL },'+ + '@endif@', ] +libgimp_mkenums_custom_target_commonargs = [ + gimp_mkenums_custom_target_commonargs, + '--dtail',' { 0, NULL, NULL }\n'+ + ' };\n'+ + '\n'+ + ' static GType type = 0;\n'+ + '\n'+ + ' if (G_UNLIKELY (! type))\n'+ + ' {\n'+ + ' type = g_@type@_register_static ("@EnumName@", values);\n'+ + ' gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");\n'+ + ' gimp_type_set_translation_context (type, "@enumnick@");\n'+ + ' gimp_@type@_set_value_descriptions (type, descs);\n'+ + ' }\n'+ + '\n'+ + ' return type;\n'+ + '}\n', +] conf.set('ENABLE_NLS', true) conf.set('HAVE_GETTEXT', true)