File: meson.build

package info (click to toggle)
gimp 3.0.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 210,076 kB
  • sloc: ansic: 842,287; lisp: 10,761; python: 10,318; cpp: 7,238; perl: 4,355; sh: 1,043; xml: 963; yacc: 609; lex: 348; javascript: 150; makefile: 43
file content (263 lines) | stat: -rw-r--r-- 6,913 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
rootAppInclude = include_directories('.')

subdir('actions')
subdir('core')
subdir('dialogs')
subdir('display')
subdir('file')
subdir('file-data')
subdir('gegl')
subdir('gui')
subdir('menus')
subdir('operations')
subdir('paint')
subdir('pdb')
subdir('plug-in')
subdir('propgui')
subdir('text')
subdir('tools')
subdir('vectors')
subdir('widgets')
subdir('xcf')


# For app/config
app_debug_files = files(
  'gimp-debug.c',
  'gimp-log.c',
)

# Top-level library

libapp_sources = [
  'app.c',
  'errors.c',
  'gimpcoreapp.c',
  'gimpconsoleapp.c',
  'gimp-debug.c',
  'gimp-log.c',
  'gimp-update.c',
  'gimp-version.c',
  'language.c',
  'sanity.c',
  'signals.c',
  'unique.c',
  gitversion_h,
  gimpdbusservice_gen,
]

if platform_windows
  # for GimpDashboard and GimpBacktrace
  psapi_cflags = [ '-DPSAPI_VERSION=1' ]
  link_args = [ '-lpsapi' ]

else
  psapi_cflags = [ ]
  link_args = []
endif

if platform_osx
  link_args += osx_ldflags
endif

libapp_c_args = [
  '-DG_LOG_DOMAIN="Gimp"',
  '-DGIMP_APP_GLUE_COMPILATION',
  psapi_cflags,
]

# Put GIMP core in a lib so we can conveniently link against that in test cases
# and main GIMP executable. Note that we should not use this static library for
# the console executable as it uses different macro flags.
libapp = static_library('app',
  libapp_sources,
  include_directories: [ rootInclude, rootAppInclude, configInclude, ],
  c_args: libapp_c_args,
  dependencies: [ gdk_pixbuf, gegl, gexiv2, gtk3, ],
)

gimpconsole_deps = [
  cairo,
  dbghelp,
  drmingw,
  gdk_pixbuf,
  gegl,
  gexiv2,
  gio,
  gio_specific,
  lcms,
  libbacktrace,
  pangocairo,
  pangoft2,
  rpc,
]

console_libapps = [
    libappcore,
    libappfile,
    libappfiledata,
    libappgegl,
    libappinternalprocs,
    libapplayermodes,
    libapplayermodeslegacy,
    libappoperations,
    libapppaint,
    libapppdb,
    libappplugin,
    libapptext,
    libappvectors,
    libappxcf,
]

libapp_dep = declare_dependency(
  dependencies: [
    gimpconsole_deps,
    gtk3,
  ],
  link_with: [
    libapp,
    console_libapps,
  ],
  include_directories: [
    rootInclude,
    rootAppInclude,
  ],
  compile_args: psapi_cflags,
  link_args: link_args,
)

# Those subdirs need to link against the first ones
subdir('config')
subdir('tests')

console_libapps += [ libappconfig ]

app_libgimps = [
  libgimpbase,
  libgimpcolor,
  libgimpconfig,
  libgimpmath,
  libgimpmodule,
  libgimpthumb,
]

gui_libapps = [
  console_libapps,
  libappactions,
  libappdialogs,
  libappdisplay,
  libappgui,
  libappmenus,
  libapppropgui,
  libapptools,
  libappwidgets,
  libgimpwidgets,
]

# Executables

if platform_windows
  console_rc_name = 'gimp-console-'+ gimp_app_version
  gimp_app_console_rc = configure_file(
    input : gimp_plugins_rc.full_path(),
    output: console_rc_name + '.rc',
    copy: true,
  )
  console_rc_file = windows.compile_resources(
    gimp_app_console_rc,
    args: [
      '--define', 'ORIGINALFILENAME_STR="@0@"'.format(console_rc_name+'.exe'),
      '--define', 'INTERNALNAME_STR="@0@"'    .format(console_rc_name),
      '--define', 'TOP_SRCDIR="@0@"'          .format(meson.project_source_root()),
    ],
    include_directories: [
      rootInclude, appInclude,
    ],
  )

  gui_rc_name = 'gimp-'+ gimp_app_version
  gimp_app_gui_rc = configure_file(
    input : gimp_plugins_rc.full_path(),
    output: gui_rc_name + '.rc',
    copy: true,
  )
  gui_rc_file = windows.compile_resources(
    gimp_app_rc,
    args: [
      '--define', 'ORIGINALFILENAME_STR="@0@"'.format(gui_rc_name+'.exe'),
      '--define', 'INTERNALNAME_STR="@0@"'    .format(gui_rc_name),
      '--define', 'TOP_SRCDIR="@0@"'          .format(meson.project_source_root()),
    ],
    include_directories: [
      rootInclude, appInclude,
    ],
  )
else
  console_rc_file = []
  gui_rc_file = []
endif

if enable_console_bin
  gimpconsole_exe = executable(gimpconsole_exe_name,
    'main.c',
    libapp_sources,
    console_rc_file,
    c_args: [ libapp_c_args, '-DGIMP_CONSOLE_COMPILATION', ],
    dependencies: gimpconsole_deps,
    link_with: [
      app_libgimps,
      console_libapps
    ],
    include_directories: [
      rootInclude,
      rootAppInclude,
    ],
    win_subsystem: 'console',
    link_args: link_args,
    install: true,
  )
endif

gimpmain_exe = executable(gimpmain_exe_name,
  'main.c',
  gui_rc_file,
  c_args: libapp_c_args,
  dependencies: libapp_dep,
  link_with: [
    app_libgimps,
    gui_libapps,
  ],
  win_subsystem: 'windows',
  install: true,
)

if enable_default_bin
  if not platform_windows
    install_symlink(fs.name(gimpmain_exe.full_path()).replace(exec_ver, ''),
                    pointing_to: fs.name(gimpmain_exe.full_path()),
                    install_dir: get_option('bindir'))
    install_symlink(fs.name(gimpmain_exe.full_path()).replace(exec_ver, '-@0@'.format(api_version_major)),
                    pointing_to: fs.name(gimpmain_exe.full_path()),
                    install_dir: get_option('bindir'))
  else
    meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; copy2(argv[1], str(Path(argv[2]) / "bin" / argv[3]))',
                             gimpmain_exe.full_path(), get_option('prefix'), fs.name(gimpmain_exe.name()).replace(exec_ver, '.exe'))
    meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; copy2(argv[1], str(Path(argv[2]) / "bin" / argv[3].replace("@0@", argv[4])))',
                             gimpmain_exe.full_path(), get_option('prefix'), fs.name(gimpmain_exe.name()).replace(exec_ver, '-@0@.exe'), api_version_major.to_string())
  endif
  if enable_console_bin
    if not platform_windows
      install_symlink(fs.name(gimpconsole_exe.full_path()).replace(exec_ver, ''),
                      pointing_to: fs.name(gimpconsole_exe.full_path()),
                      install_dir: get_option('bindir'))
      install_symlink(fs.name(gimpconsole_exe.full_path()).replace(exec_ver, '-@0@'.format(api_version_major)),
                      pointing_to: fs.name(gimpconsole_exe.full_path()),
                      install_dir: get_option('bindir'))
    else
      meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; copy2(argv[1], str(Path(argv[2]) / "bin" / argv[3]))',
                               gimpconsole_exe.full_path(), get_option('prefix'), fs.name(gimpconsole_exe.name()).replace(exec_ver, '.exe'))
      meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; copy2(argv[1], str(Path(argv[2]) / "bin" / argv[3].replace("@0@", argv[4])))',
                               gimpconsole_exe.full_path(), get_option('prefix'), fs.name(gimpconsole_exe.name()).replace(exec_ver, '-@0@.exe'), api_version_major.to_string())
    endif
  endif
endif