Merge pull request #3757 from andy5995/iss-3752
[geany-mirror.git] / meson.build
blob6573463f6c9f8fe89f820a37376f17c6677d973f
1 project('geany', 'c', 'cpp',
2         meson_version: '>= 0.53',
3         version: '2.1',
4         default_options : ['c_std=c11', 'cpp_std=c++17'])
6 gnome = import('gnome')
7 pymod = import('python')
9 cc = meson.get_compiler('c')
10 cxx = meson.get_compiler('cpp')
11 prefix = get_option('prefix')
13 deps_in = [
14         ['glib-2.0',    '2.32'],
15         ['gmodule-2.0', '2.32'],
16         ['gtk+-3.0',    '3.24']
19 deps = []
20 deps_for_pc = ''
21 foreach dep : deps_in
22         deps += [dependency(dep[0], version: '>= ' + dep[1])]
23         deps_for_pc += ' ' + dep[0] + ' >= ' + dep[1]
24 endforeach
26 glib = deps[0]
28 # detect libc
29 glibc = false
30 if cc.has_header('gnu/libc-version.h')
31         glibc = true
32 endif
34 gnu_source = glibc
36 cdata = configuration_data()
37 check_headers = [
38         'alloca.h',
39         'asprintf.h',
40         'direct.h',
41         'dirent.h',
42         'dlfcn.h',
43         'errno.h',
44         'fcntl.h',
45         'fnmatch.h',
46         'inttypes.h',
47         'io.h',
48         'langinfo.h',
49         'libintl.h',
50         'limits.h',
51         'locale.h',
52         'memory.h',
53         'stdbool.h',
54         'sys/dir.h',
55         'sys/stat.h',
56         'sys/time.h',
57         'sys/types.h',
58         'unistd.h',
59         'wchar.h',
60         'wctype.h',
63 check_functions = [
64         ['alloca', '#include <alloca.h>'],
65         ['asprintf', '#include <stdio.h>'],
66         ['chsize', '#include <io.h>'],
67         ['fnmatch', '#include <fnmatch.h>'],
68         ['ftruncate', '#include <unistd.h>'],
69         ['isblank', '#include <ctype.h>'],
70         ['mbrtowc', '#include <wchar.h>'],
71         ['memcpy',  '#include <string.h>'],
72         ['mkstemp', '#include <stdlib.h>'],
73         ['realpath', '#include <limits.h>\n#include <stdlib.h>'],
74         ['regcomp', '#include <regex.h>'],
75         ['socket', '#include <sys/socket.h>'],
76         # man page says strings.h but we include only string.h and it works
77         ['strcasecmp', '#include <string.h>'],
78         ['strncasecmp', '#include <string.h>'],
79         ['stricmp', '#include <string.h>'],
80         ['strnicmp', '#include <string.h>'],
81         ['strerror', '#include <string.h>'],
82         ['strstr', '#include <string.h>'],
83         ['tempnam', '#include <stdio.h>'],
84         ['truncate', '#include <unistd.h>'],
85         ['wcrtomb', '#include <wchar.h>'],
86         ['wcscoll', '#include <wchar.h>'],
87         ['g_strv_equal', '#include <glib.h>']
90 foreach h : check_headers
91         define = 'HAVE_' + h.underscorify().to_upper()
92         if cc.has_header(h)
93                 cdata.set(define, 1)
94         endif
95 endforeach
97 foreach f : check_functions
98         define = 'HAVE_' + f.get(0).underscorify().to_upper()
99         ccprefix = '\n'.join([gnu_source ? '#define _GNU_SOURCE' : '', f.get(1)])
100         if cc.has_function(f.get(0), prefix: ccprefix, dependencies: deps)
101                 cdata.set(define, 1)
102         endif
103 endforeach
105 # From configure.ac:
106 # non-functions checks for u-ctags.  Not that we really need those as we don't
107 # use u-ctags's main, but the corresponding macros have to be defined to
108 # something, so simply perform the actual checks.
109 #AC_CHECK_DECLS([__environ],,,[[#include <unistd.h>]])
110 #AC_CHECK_DECLS([_NSGetEnviron],,,[[#include <crt_externs.h>]])
111 # In meson we cannot as easily test for declarations so defining as 0 is easiest
112 cdata.set('HAVE_DECL___ENVIRON', 0)
113 cdata.set('HAVE_DECL__NSGETENVIRON', 0)
115 cdata.set_quoted('PACKAGE', 'geany')
116 cdata.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/geany/geany/issues')
117 cdata.set_quoted('PACKAGE_NAME','Geany')
118 cdata.set_quoted('PACKAGE_STRING', 'Geany ' + meson.project_version())
119 cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
120 cdata.set('GETTEXT_PACKAGE', 'PACKAGE')
121 cdata.set('VERSION', meson.project_version())
122 cdata.set('ENABLE_NLS', 1)
123 if (host_machine.system() != 'windows' and get_option('vte'))
124         cdata.set('HAVE_VTE', 1)
125 endif
126 cdata.set('HAVE_PLUGINS', get_option('plugins'))
127 cdata.set('HAVE_SOCKET', get_option('socket'))
128 if (host_machine.system() == 'windows')
129         cdata.set('GEANY_DATA_DIR', join_paths(prefix, 'data'))
130         cdata.set('GEANY_DOC_DIR', join_paths(prefix))
131 else
132         cdata.set('GEANY_DATA_DIR', join_paths(prefix, get_option('datadir'), 'geany'))
133         cdata.set('GEANY_DOC_DIR', join_paths(prefix, get_option('datadir'), 'doc', 'geany'))
134 endif
135 cdata.set('top_srcdir', meson.source_root())
136 cdata.set('top_builddir', meson.build_root())
138 # for geany.pc (adapted from GTK+)
139 pcconf = cdata
140 pcconf.set('DEPENDENCIES', deps_for_pc)
141 pcconf.set('prefix', get_option('prefix'))
142 pcconf.set('libdir', join_paths('${exec_prefix}', get_option('libdir')))
143 pcconf.set('includedir', join_paths('${prefix}', get_option('includedir')))
144 pcconf.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
145 # actually constant, just match autconf
146 pcconf.set('exec_prefix', '${prefix}')
147 pcconf.set('datadir', '${datarootdir}')
148 pcconf.set('localedir', join_paths('${datarootdir}', 'locale'))
150 # needed programs
151 sh = find_program('sh')
152 cp = find_program('cp')
153 ln = find_program('ln')
154 doxygen = find_program('doxygen', required: get_option('api-docs'))
155 python = pymod.find_installation('python3', modules: doxygen.found() and get_option('gtkdoc') ? ['lxml'] : [])
156 # These two are truly optional
157 rst2html = find_program('rst2html', required: get_option('html-docs'))
158 rst2pdf = find_program('rst2pdf', required: get_option('pdf-docs'))
159 git = find_program('git', required: false)
160 revision = '-1'
161 if git.found()
162         ret = run_command(git, 'rev-parse', '--short', '--revs-only', 'HEAD', check: false)
163         if ret.returncode() == 0
164                 revision = ret.stdout().strip()
165         endif
166 endif
167 cdata.set_quoted('REVISION', revision)
169 python_command = get_option('python-command')
170 if python_command == '' or python_command == 'auto'
171         if host_machine.system() == 'windows'
172                 python_command = 'py'
173         else
174                 python_command = 'python'
175         endif
176 endif
177 cdata.set('PYTHON_COMMAND', python_command)
179 configure_file(
180         output : 'config.h',
181         configuration : cdata
184 configure_file(
185         input: 'geany.pc.in',
186         install: true,
187         install_dir: join_paths(prefix, get_option('libdir'), 'pkgconfig'),
188         output: 'geany.pc',
189         configuration: pcconf
192 # CFLAGS for basic stuff that only depends on libc
193 basic_cflags  = [ '-DHAVE_CONFIG_H=1', '-O2' ]
194 if (gnu_source)
195         basic_cflags += '-D_GNU_SOURCE'
196 endif
198 # CFLAGS common between Geany and bundled plugins
199 def_cflags = basic_cflags + [
200         '-DGTK',
201 # we're using lots of deprecated stuff with gtk3 (often because there is no proper alternative!)
202         '-Wno-deprecated-declarations',
203         '-DGDK_DISABLE_DEPRECATION_WARNINGS',
204         '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32',
205         '-DGEANY_PREFIX="@0@"'.format(get_option('prefix')),
206         '-DGEANY_DOCDIR="@0@"'.format(join_paths(prefix, get_option('datadir'), 'doc'))
208 foreach d : [ 'includedir', 'libdir', 'libexecdir', 'datadir', 'localedir' ]
209         def_cflags += '-DGEANY_@0@="@1@"'.format(d.underscorify().to_upper(), join_paths(prefix, get_option(d)))
210 endforeach
212 # CFLAGS for everything else, i.e. most of Geany
213 geany_cflags = def_cflags
214 have_gcc4_visibility = cc.has_argument('-fvisibility=hidden')
215 geany_cflags += '-DGEANY_PRIVATE'
216 if host_machine.system() == 'windows'
217         geany_cflags += '-DGEANY_EXPORT_SYMBOL=__declspec(dllexport)'
218 elif have_gcc4_visibility
219         geany_cflags += '-fvisibility=hidden'
220         geany_cflags += '-DGEANY_EXPORT_SYMBOL=__attribute__((visibility("default")))'
221 endif
222 geany_cflags += '-DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL'
223 sci_cflags = geany_cflags
224 sci_cflags += [ '-std=c++17', '-Wno-non-virtual-dtor', '-DNDEBUG', '-DSCI_LEXER', '-DNO_CXX11_REGEX' ]
226 iregex = include_directories('ctags/gnu_regex')
227 ifnmatch = include_directories('ctags/fnmatch')
228 ictags = include_directories('ctags/main', 'ctags/parsers', 'ctags/dsl', 'ctags/libreadtags')
229 itagmanager = include_directories('src/tagmanager')
230 iscintilla = include_directories('scintilla/include', 'scintilla/lexilla/include')
231 igeany = include_directories('src')
233 install_headers(
234         'scintilla/include/Scintilla.h',
235         'scintilla/include/Scintilla.iface',
236         'scintilla/include/ScintillaWidget.h',
237         'scintilla/include/Sci_Position.h',
238         'scintilla/lexilla/include/SciLexer.h',
239         subdir: 'geany/scintilla'
242 lexilla = static_library('lexilla',
243         'scintilla/lexilla/include/Lexilla.h',
244         'scintilla/lexilla/include/SciLexer.h',
245         'scintilla/lexilla/lexers/LexAbaqus.cxx',
246         'scintilla/lexilla/lexers/LexAda.cxx',
247         'scintilla/lexilla/lexers/LexAsciidoc.cxx',
248         'scintilla/lexilla/lexers/LexAsm.cxx',
249         'scintilla/lexilla/lexers/LexAU3.cxx',
250         'scintilla/lexilla/lexers/LexBash.cxx',
251         'scintilla/lexilla/lexers/LexBasic.cxx',
252         'scintilla/lexilla/lexers/LexBatch.cxx',
253         'scintilla/lexilla/lexers/LexCaml.cxx',
254         'scintilla/lexilla/lexers/LexCmake.cxx',
255         'scintilla/lexilla/lexers/LexCOBOL.cxx',
256         'scintilla/lexilla/lexers/LexCoffeeScript.cxx',
257         'scintilla/lexilla/lexers/LexCPP.cxx',
258         'scintilla/lexilla/lexers/LexCSS.cxx',
259         'scintilla/lexilla/lexers/LexD.cxx',
260         'scintilla/lexilla/lexers/LexDiff.cxx',
261         'scintilla/lexilla/lexers/LexErlang.cxx',
262         'scintilla/lexilla/lexers/LexForth.cxx',
263         'scintilla/lexilla/lexers/LexGDScript.cxx',
264         'scintilla/lexilla/lexers/LexFortran.cxx',
265         'scintilla/lexilla/lexers/LexHaskell.cxx',
266         'scintilla/lexilla/lexers/LexHTML.cxx',
267         'scintilla/lexilla/lexers/LexJulia.cxx',
268         'scintilla/lexilla/lexers/LexLaTeX.cxx',
269         'scintilla/lexilla/lexers/LexLisp.cxx',
270         'scintilla/lexilla/lexers/LexLua.cxx',
271         'scintilla/lexilla/lexers/LexMake.cxx',
272         'scintilla/lexilla/lexers/LexMarkdown.cxx',
273         'scintilla/lexilla/lexers/LexMatlab.cxx',
274         'scintilla/lexilla/lexers/LexNsis.cxx',
275         'scintilla/lexilla/lexers/LexNull.cxx',
276         'scintilla/lexilla/lexers/LexPascal.cxx',
277         'scintilla/lexilla/lexers/LexPerl.cxx',
278         'scintilla/lexilla/lexers/LexPO.cxx',
279         'scintilla/lexilla/lexers/LexPowerShell.cxx',
280         'scintilla/lexilla/lexers/LexProps.cxx',
281         'scintilla/lexilla/lexers/LexPython.cxx',
282         'scintilla/lexilla/lexers/LexR.cxx',
283         'scintilla/lexilla/lexers/LexRaku.cxx',
284         'scintilla/lexilla/lexers/LexRuby.cxx',
285         'scintilla/lexilla/lexers/LexRust.cxx',
286         'scintilla/lexilla/lexers/LexSmalltalk.cxx',
287         'scintilla/lexilla/lexers/LexSQL.cxx',
288         'scintilla/lexilla/lexers/LexTCL.cxx',
289         'scintilla/lexilla/lexers/LexTxt2tags.cxx',
290         'scintilla/lexilla/lexers/LexVerilog.cxx',
291         'scintilla/lexilla/lexers/LexVHDL.cxx',
292         'scintilla/lexilla/lexers/LexYAML.cxx',
293         'scintilla/lexilla/lexlib/Accessor.cxx',
294         'scintilla/lexilla/lexlib/Accessor.h',
295         'scintilla/lexilla/lexlib/CatalogueModules.h',
296         'scintilla/lexilla/lexlib/CharacterCategory.cxx',
297         'scintilla/lexilla/lexlib/CharacterCategory.h',
298         'scintilla/lexilla/lexlib/CharacterSet.cxx',
299         'scintilla/lexilla/lexlib/CharacterSet.h',
300         'scintilla/lexilla/lexlib/DefaultLexer.cxx',
301         'scintilla/lexilla/lexlib/DefaultLexer.h',
302         'scintilla/lexilla/lexlib/LexAccessor.cxx',
303         'scintilla/lexilla/lexlib/LexAccessor.h',
304         'scintilla/lexilla/lexlib/LexerBase.cxx',
305         'scintilla/lexilla/lexlib/LexerBase.h',
306         'scintilla/lexilla/lexlib/LexerModule.cxx',
307         'scintilla/lexilla/lexlib/LexerModule.h',
308         'scintilla/lexilla/lexlib/LexerNoExceptions.cxx',
309         'scintilla/lexilla/lexlib/LexerNoExceptions.h',
310         'scintilla/lexilla/lexlib/LexerSimple.cxx',
311         'scintilla/lexilla/lexlib/LexerSimple.h',
312         'scintilla/lexilla/lexlib/OptionSet.h',
313         'scintilla/lexilla/lexlib/PropSetSimple.cxx',
314         'scintilla/lexilla/lexlib/PropSetSimple.h',
315         'scintilla/lexilla/lexlib/SparseState.h',
316         'scintilla/lexilla/lexlib/StringCopy.h',
317         'scintilla/lexilla/lexlib/StyleContext.cxx',
318         'scintilla/lexilla/lexlib/StyleContext.h',
319         'scintilla/lexilla/lexlib/SubStyles.h',
320         'scintilla/lexilla/lexlib/WordList.cxx',
321         'scintilla/lexilla/lexlib/WordList.h',
322         'scintilla/lexilla/src/Lexilla.cxx',
323         cpp_args: sci_cflags,
324         dependencies: deps,
325         include_directories: [
326                 iscintilla,
327                 include_directories('scintilla/lexilla/lexlib', 'scintilla/lexilla/include')
328         ]
330 dep_lexilla = declare_dependency(
331         link_with: lexilla,
332         include_directories: include_directories('scintilla/lexilla/include')
335 scintilla = static_library('scintilla',
336         'scintilla/gtk/Converter.h',
337         'scintilla/gtk/PlatGTK.cxx',
338         'scintilla/gtk/ScintillaGTKAccessible.cxx',
339         'scintilla/gtk/ScintillaGTKAccessible.h',
340         'scintilla/gtk/ScintillaGTK.cxx',
341         'scintilla/gtk/ScintillaGTK.h',
342         'scintilla/gtk/scintilla-marshal.c',
343         'scintilla/gtk/scintilla-marshal.h',
344         'scintilla/gtk/Wrappers.h',
345         'scintilla/include/ILexer.h',
346         'scintilla/include/ILoader.h',
347         'scintilla/include/ScintillaCall.h',
348         'scintilla/include/Scintilla.h',
349         'scintilla/include/ScintillaMessages.h',
350         'scintilla/include/ScintillaStructures.h',
351         'scintilla/include/ScintillaTypes.h',
352         'scintilla/include/ScintillaWidget.h',
353         'scintilla/include/Sci_Position.h',
354         'scintilla/src/AutoComplete.cxx',
355         'scintilla/src/AutoComplete.h',
356         'scintilla/src/CallTip.cxx',
357         'scintilla/src/CallTip.h',
358         'scintilla/src/CaseConvert.cxx',
359         'scintilla/src/CaseConvert.h',
360         'scintilla/src/CaseFolder.cxx',
361         'scintilla/src/CaseFolder.h',
362         'scintilla/src/CellBuffer.cxx',
363         'scintilla/src/CellBuffer.h',
364         'scintilla/src/ChangeHistory.cxx',
365         'scintilla/src/ChangeHistory.h',
366         'scintilla/src/CharacterCategoryMap.cxx',
367         'scintilla/src/CharacterCategoryMap.h',
368         'scintilla/src/CharacterType.cxx',
369         'scintilla/src/CharacterType.h',
370         'scintilla/src/CharClassify.cxx',
371         'scintilla/src/CharClassify.h',
372         'scintilla/src/ContractionState.cxx',
373         'scintilla/src/ContractionState.h',
374         'scintilla/src/DBCS.cxx',
375         'scintilla/src/DBCS.h',
376         'scintilla/src/Debugging.h',
377         'scintilla/src/Decoration.cxx',
378         'scintilla/src/Decoration.h',
379         'scintilla/src/Document.cxx',
380         'scintilla/src/Document.h',
381         'scintilla/src/EditModel.cxx',
382         'scintilla/src/EditModel.h',
383         'scintilla/src/Editor.cxx',
384         'scintilla/src/Editor.h',
385         'scintilla/src/EditView.cxx',
386         'scintilla/src/EditView.h',
387         'scintilla/src/ElapsedPeriod.h',
388         'scintilla/src/FontQuality.h',
389         'scintilla/src/Geometry.cxx',
390         'scintilla/src/Geometry.h',
391         'scintilla/src/Indicator.cxx',
392         'scintilla/src/Indicator.h',
393         'scintilla/src/KeyMap.cxx',
394         'scintilla/src/KeyMap.h',
395         'scintilla/src/LineMarker.cxx',
396         'scintilla/src/LineMarker.h',
397         'scintilla/src/MarginView.cxx',
398         'scintilla/src/MarginView.h',
399         'scintilla/src/Partitioning.h',
400         'scintilla/src/PerLine.cxx',
401         'scintilla/src/PerLine.h',
402         'scintilla/src/Platform.h',
403         'scintilla/src/PositionCache.cxx',
404         'scintilla/src/PositionCache.h',
405         'scintilla/src/Position.h',
406         'scintilla/src/RESearch.cxx',
407         'scintilla/src/RESearch.h',
408         'scintilla/src/RunStyles.cxx',
409         'scintilla/src/RunStyles.h',
410         'scintilla/src/ScintillaBase.cxx',
411         'scintilla/src/ScintillaBase.h',
412         'scintilla/src/Selection.cxx',
413         'scintilla/src/Selection.h',
414         'scintilla/src/SparseVector.h',
415         'scintilla/src/SplitVector.h',
416         'scintilla/src/Style.cxx',
417         'scintilla/src/Style.h',
418         'scintilla/src/UniConversion.cxx',
419         'scintilla/src/UniConversion.h',
420         'scintilla/src/UniqueString.cxx',
421         'scintilla/src/UniqueString.h',
422         'scintilla/src/ViewStyle.cxx',
423         'scintilla/src/ViewStyle.h',
424         'scintilla/src/XPM.cxx',
425         'scintilla/src/XPM.h',
426         cpp_args: sci_cflags,
427         dependencies: deps + [ dep_lexilla ],
428         include_directories: [
429                 iscintilla,
430                 include_directories('scintilla/include', 'scintilla/src')
431         ]
433 dep_scintilla = declare_dependency(
434         link_with: scintilla,
435         include_directories: include_directories('scintilla/include')
438 if cdata.get('HAVE_FNMATCH', 0) == 1
439         dep_fnmatch = dependency('', required: false)
440 else
441         # use fnmatch bundled with ctags
442         fnmatch = static_library('fnmatch',
443                 'ctags/fnmatch/fnmatch.c',
444                 'ctags/fnmatch/fnmatch.h',
445                 include_directories: [ifnmatch],
446                 c_args: basic_cflags
447         )
448         dep_fnmatch = declare_dependency(link_with: [fnmatch], include_directories: [ifnmatch])
449 endif
451 if cdata.get('HAVE_REGCOMP', 0) == 1
452         dep_regex = dependency('', required: false)
453 else
454         # use regcomp bundled with ctags
455         regex = static_library('regex',
456                 'ctags/gnu_regex/regex.c',
457                 'ctags/gnu_regex/regex.h',
458                 dependencies: [dep_fnmatch],
459                 c_args: basic_cflags + [ '-D__USE_GNU' ]
460         )
461         dep_regex = declare_dependency(link_with: [regex], include_directories: [iregex])
462 endif
464 ctags = static_library('ctags',
465         'ctags/dsl/es.c',
466         'ctags/dsl/es.h',
467         'ctags/dsl/optscript.c',
468         'ctags/dsl/optscript.h',
469         'ctags/libreadtags/readtags.c',
470         'ctags/libreadtags/readtags.h',
471         'ctags/main/args.c',
472         'ctags/main/args_p.h',
473         'ctags/main/colprint.c',
474         'ctags/main/colprint_p.h',
475         'ctags/main/CommonPrelude.c',
476         'ctags/main/ctags.h',
477         'ctags/main/debug.c',
478         'ctags/main/debug.h',
479         'ctags/main/dependency.c',
480         'ctags/main/dependency.h',
481         'ctags/main/dependency_p.h',
482         'ctags/main/e_msoft.h',
483         'ctags/main/entry.c',
484         'ctags/main/entry.h',
485         'ctags/main/entry_p.h',
486         'ctags/main/entry_private.c',
487         'ctags/main/error.c',
488         'ctags/main/error_p.h',
489         'ctags/main/field.c',
490         'ctags/main/field.h',
491         'ctags/main/field_p.h',
492         'ctags/main/flags.c',
493         'ctags/main/flags_p.h',
494         'ctags/main/fmt.c',
495         'ctags/main/fmt_p.h',
496         'ctags/main/gcc-attr.h',
497         'ctags/main/general.h',
498         'ctags/main/gvars.h',
499         'ctags/main/htable.c',
500         'ctags/main/htable.h',
501         'ctags/main/inline.h',
502         'ctags/main/interactive_p.h',
503         'ctags/main/interval_tree_generic.h',
504         'ctags/main/keyword.c',
505         'ctags/main/keyword.h',
506         'ctags/main/keyword_p.h',
507         'ctags/main/kind.c',
508         'ctags/main/kind.h',
509         'ctags/main/kind_p.h',
510         'ctags/main/lregex.c',
511         'ctags/main/lregex-default.c',
512         'ctags/main/lregex.h',
513         'ctags/main/lregex_p.h',
514         'ctags/main/lxpath.c',
515         'ctags/main/lxpath.h',
516         'ctags/main/lxpath_p.h',
517         'ctags/main/main.c',
518         'ctags/main/main_p.h',
519         'ctags/main/mbcs.c',
520         'ctags/main/mbcs.h',
521         'ctags/main/mbcs_p.h',
522         'ctags/main/mio.c',
523         'ctags/main/mio.h',
524         'ctags/main/nestlevel.c',
525         'ctags/main/nestlevel.h',
526         'ctags/main/numarray.c',
527         'ctags/main/numarray.h',
528         'ctags/main/objpool.c',
529         'ctags/main/objpool.h',
530         'ctags/main/options.c',
531         'ctags/main/options.h',
532         'ctags/main/options_p.h',
533         'ctags/main/param.c',
534         'ctags/main/param.h',
535         'ctags/main/param_p.h',
536         'ctags/main/parse.c',
537         'ctags/main/parse.h',
538         'ctags/main/parse_p.h',
539         'ctags/main/parsers_p.h',
540         'ctags/main/portable-dirent_p.h',
541         'ctags/main/portable-scandir.c',
542         'ctags/main/promise.c',
543         'ctags/main/promise.h',
544         'ctags/main/promise_p.h',
545         'ctags/main/ptag.c',
546         'ctags/main/ptag_p.h',
547         'ctags/main/ptrarray.c',
548         'ctags/main/ptrarray.h',
549         'ctags/main/rbtree.c',
550         'ctags/main/rbtree.h',
551         'ctags/main/rbtree_augmented.h',
552         'ctags/main/read.c',
553         'ctags/main/read.h',
554         'ctags/main/read_p.h',
555         'ctags/main/repoinfo.c',
556         'ctags/main/repoinfo.h',
557         'ctags/main/routines.c',
558         'ctags/main/routines.h',
559         'ctags/main/routines_p.h',
560         'ctags/main/script.c',
561         'ctags/main/script_p.h',
562         'ctags/main/seccomp.c',
563         'ctags/main/selectors.c',
564         'ctags/main/selectors.h',
565         'ctags/main/sort.c',
566         'ctags/main/sort_p.h',
567         'ctags/main/stats.c',
568         'ctags/main/stats_p.h',
569         'ctags/main/strlist.c',
570         'ctags/main/strlist.h',
571         'ctags/main/subparser.h',
572         'ctags/main/subparser_p.h',
573         'ctags/main/tokeninfo.c',
574         'ctags/main/tokeninfo.h',
575         'ctags/main/trace.c',
576         'ctags/main/trace.h',
577         'ctags/main/trashbox.c',
578         'ctags/main/trashbox.h',
579         'ctags/main/trashbox_p.h',
580         'ctags/main/types.h',
581         'ctags/main/unwindi.c',
582         'ctags/main/unwindi.h',
583         'ctags/main/utf8_str.c',
584         'ctags/main/utf8_str.h',
585         'ctags/main/vstring.c',
586         'ctags/main/vstring.h',
587         'ctags/main/writer.c',
588         'ctags/main/writer-ctags.c',
589         'ctags/main/writer-etags.c',
590         'ctags/main/writer-json.c',
591         'ctags/main/writer_p.h',
592         'ctags/main/writer-xref.c',
593         'ctags/main/xtag.c',
594         'ctags/main/xtag.h',
595         'ctags/main/xtag_p.h',
596         'ctags/parsers/abaqus.c',
597         'ctags/parsers/abc.c',
598         'ctags/parsers/ada.c',
599         'ctags/parsers/asciidoc.c',
600         'ctags/parsers/asm.c',
601         'ctags/parsers/autoit.c',
602         'ctags/parsers/basic.c',
603         'ctags/parsers/bibtex.c',
604         'ctags/parsers/bibtex.h',
605         'ctags/parsers/clojure.c',
606         'ctags/parsers/cobol.c',
607         'ctags/parsers/cpreprocessor.c',
608         'ctags/parsers/cpreprocessor.h',
609         'ctags/parsers/css.c',
610         'ctags/parsers/cxx/cxx.c',
611         'ctags/parsers/cxx/cxx_debug.c',
612         'ctags/parsers/cxx/cxx_debug.h',
613         'ctags/parsers/cxx/cxx_debug_type.c',
614         'ctags/parsers/cxx/cxx_keyword.c',
615         'ctags/parsers/cxx/cxx_keyword.h',
616         'ctags/parsers/cxx/cxx_parser_block.c',
617         'ctags/parsers/cxx/cxx_parser.c',
618         'ctags/parsers/cxx/cxx_parser_function.c',
619         'ctags/parsers/cxx/cxx_parser.h',
620         'ctags/parsers/cxx/cxx_parser_internal.h',
621         'ctags/parsers/cxx/cxx_parser_lambda.c',
622         'ctags/parsers/cxx/cxx_parser_module.c',
623         'ctags/parsers/cxx/cxx_parser_namespace.c',
624         'ctags/parsers/cxx/cxx_parser_template.c',
625         'ctags/parsers/cxx/cxx_parser_tokenizer.c',
626         'ctags/parsers/cxx/cxx_parser_typedef.c',
627         'ctags/parsers/cxx/cxx_parser_using.c',
628         'ctags/parsers/cxx/cxx_parser_variable.c',
629         'ctags/parsers/cxx/cxx_qtmoc.c',
630         'ctags/parsers/cxx/cxx_scope.c',
631         'ctags/parsers/cxx/cxx_scope.h',
632         'ctags/parsers/cxx/cxx_side_chain.c',
633         'ctags/parsers/cxx/cxx_side_chain.h',
634         'ctags/parsers/cxx/cxx_subparser.c',
635         'ctags/parsers/cxx/cxx_subparser.h',
636         'ctags/parsers/cxx/cxx_subparser_internal.h',
637         'ctags/parsers/cxx/cxx_tag.c',
638         'ctags/parsers/cxx/cxx_tag.h',
639         'ctags/parsers/cxx/cxx_token.c',
640         'ctags/parsers/cxx/cxx_token_chain.c',
641         'ctags/parsers/cxx/cxx_token_chain.h',
642         'ctags/parsers/cxx/cxx_token.h',
643         'ctags/parsers/diff.c',
644         'ctags/parsers/dosbatch.c',
645         'ctags/parsers/erlang.c',
646         'ctags/parsers/flex.c',
647         'ctags/parsers/fortran.c',
648         'ctags/parsers/gdscript.c',
649         'ctags/parsers/geany_c.c',
650         'ctags/parsers/geany_docbook.c',
651         'ctags/parsers/geany_lcpp.c',
652         'ctags/parsers/geany_lcpp.h',
653         'ctags/parsers/matlab.c',
654         'ctags/parsers/go.c',
655         'ctags/parsers/haskell.c',
656         'ctags/parsers/haxe.c',
657         'ctags/parsers/html.c',
658         'ctags/parsers/iniconf.c',
659         'ctags/parsers/iniconf.h',
660         'ctags/parsers/jscript.c',
661         'ctags/parsers/jscript.h',
662         'ctags/parsers/json.c',
663         'ctags/parsers/julia.c',
664         'ctags/parsers/ldscript.c',
665         'ctags/parsers/lisp.c',
666         'ctags/parsers/lua.c',
667         'ctags/parsers/make.c',
668         'ctags/parsers/make.h',
669         'ctags/parsers/markdown.c',
670         'ctags/parsers/markdown.h',
671         'ctags/parsers/nsis.c',
672         'ctags/parsers/objc.c',
673         'ctags/parsers/ocaml.c',
674         'ctags/parsers/pascal.c',
675         'ctags/parsers/perl.c',
676         'ctags/parsers/perl.h',
677         'ctags/parsers/php.c',
678         'ctags/parsers/powershell.c',
679         'ctags/parsers/python.c',
680         'ctags/parsers/r.c',
681         'ctags/parsers/r.h',
682         'ctags/parsers/raku.c',
683         'ctags/parsers/rst.c',
684         'ctags/parsers/ruby.c',
685         'ctags/parsers/ruby.h',
686         'ctags/parsers/rust.c',
687         'ctags/parsers/sh.c',
688         'ctags/parsers/sh.h',
689         'ctags/parsers/sql.c',
690         'ctags/parsers/tcl.c',
691         'ctags/parsers/tcl.h',
692         'ctags/parsers/tcloo.c',
693         'ctags/parsers/tex.c',
694         'ctags/parsers/tex.h',
695         'ctags/parsers/txt2tags.c',
696         'ctags/parsers/typescript.c',
697         'ctags/parsers/verilog.c',
698         'ctags/parsers/vhdl.c',
699         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="CTags"',
700                                  '-DEXTERNAL_PARSER_LIST_FILE="src/tagmanager/tm_parsers.h"' ],
701         dependencies: deps + [dep_fnmatch, dep_regex],
702         include_directories: [ictags]
704 dep_ctags = declare_dependency(link_with: [ctags], include_directories: [ictags])
706 install_headers(
707         'src/tagmanager/tm_source_file.h',
708         'src/tagmanager/tm_tag.h',
709         'src/tagmanager/tm_workspace.h',
710         'src/tagmanager/tm_parser.h',
711         subdir: 'geany/tagmanager'
714 tagmanager = static_library('tagmanager',
715         'src/tagmanager/tm_ctags.h',
716         'src/tagmanager/tm_ctags.c',
717         'src/tagmanager/tm_parser.h',
718         'src/tagmanager/tm_parser.c',
719         'src/tagmanager/tm_parsers.h',
720         'src/tagmanager/tm_source_file.h',
721         'src/tagmanager/tm_source_file.c',
722         'src/tagmanager/tm_tag.h',
723         'src/tagmanager/tm_tag.c',
724         'src/tagmanager/tm_workspace.h',
725         'src/tagmanager/tm_workspace.c',
726         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Tagmanager"' ],
727         dependencies: [dep_ctags, glib]
729 dep_tagmanager = declare_dependency(
730         link_with: tagmanager,
731         include_directories: [itagmanager]
734 # Generate signallist.i
735 gen_src = custom_target('gen-signallist',
736         input : [ 'data/geany.glade' ],
737         output : [ 'signallist.i' ],
738         command : [find_program('scripts/gen-signallist.sh'), '@INPUT@', '@OUTPUT@' ]
741 win_src = []
742 win_deps = []
743 win_resc = []
744 if (host_machine.system() == 'windows')
745         windows = import('windows')
746         win_resc = windows.compile_resources('geany_private.rc')
747         win_src += [ 'src/win32.c', 'src/win32.h' ]
748         foreach lib : ['ole32', 'wsock32', 'comdlg32']
749                 win_deps += cc.find_library(lib)
750         endforeach
751 endif
753 osx_src = []
754 osx_deps = []
755 if host_machine.system() == 'darwin'
756         dep_mac_integration = dependency('gtk-mac-integration', version: '>= 3.0.1',
757                 required: get_option('mac-integration'))
758         if dep_mac_integration.found()
759                 osx_src += ['src/osx.c', 'src/osx.h']
760                 osx_deps += [dep_mac_integration]
761         endif
762 endif
764 vte_src = ['src/vte.c', 'src/vte.h']
765 if host_machine.system() == 'windows'
766         # No VTE support on Windows
767         vte_src = []
768 endif
770 install_headers(
771         'plugins/geanyfunctions.h',
772         'plugins/geanyplugin.h',
773         'src/app.h',
774         'src/build.h',
775         'src/dialogs.h',
776         'src/document.h',
777         'src/editor.h',
778         'src/encodings.h',
779         'src/filetypes.h',
780         'src/geany.h',
781         'src/gtkcompat.h',
782         'src/highlighting.h',
783         'src/keybindings.h',
784         'src/main.h',
785         'src/msgwindow.h',
786         'src/navqueue.h',
787         'src/plugindata.h',
788         'src/pluginutils.h',
789         'src/prefs.h',
790         'src/project.h',
791         'src/sciwrappers.h',
792         'src/search.h',
793         'src/spawn.h',
794         'src/stash.h',
795         'src/support.h',
796         'src/symbols.h',
797         'src/templates.h',
798         'src/toolbar.h',
799         'src/ui_utils.h',
800         'src/utils.h',
801         subdir: 'geany'
804 libgeany = shared_library('geany',
805         'src/about.c',
806         'src/about.h',
807         'src/app.h',
808         'src/build.c',
809         'src/build.h',
810         'src/callbacks.c',
811         'src/callbacks.h',
812         'src/dialogs.c',
813         'src/dialogs.h',
814         'src/document.c',
815         'src/document.h',
816         'src/editor.c',
817         'src/editor.h',
818         'src/encodings.c',
819         'src/encodings.h',
820         'src/filetypes.c',
821         'src/filetypes.h',
822         'src/geanyentryaction.c',
823         'src/geanyentryaction.h',
824         'src/geanymenubuttonaction.c',
825         'src/geanymenubuttonaction.h',
826         'src/geanyobject.c',
827         'src/geanyobject.h',
828         'src/geanywraplabel.c',
829         'src/geanywraplabel.h',
830         'src/gtkcompat.h',
831         'src/highlighting.c',
832         'src/highlighting.h',
833         'src/highlightingmappings.h',
834         'src/keybindings.c',
835         'src/keybindings.h',
836         'src/keyfile.c',
837         'src/keyfile.h',
838         'src/log.c',
839         'src/log.h',
840         'src/libmain.c',
841         'src/main.h',
842         'src/geany.h',
843         'src/msgwindow.c',
844         'src/msgwindow.h',
845         'src/navqueue.c',
846         'src/navqueue.h',
847         'src/notebook.c',
848         'src/notebook.h',
849         'src/plugins.c',
850         'src/plugins.h',
851         'src/pluginutils.c',
852         'src/pluginutils.h',
853         'src/prefs.c',
854         'src/prefs.h',
855         'src/printing.c',
856         'src/printing.h',
857         'src/project.c',
858         'src/project.h',
859         'src/sciwrappers.c',
860         'src/sciwrappers.h',
861         'src/search.c',
862         'src/search.h',
863         'src/socket.c',
864         'src/socket.h',
865         'src/spawn.c',
866         'src/spawn.h',
867         'src/stash.c',
868         'src/stash.h',
869         'src/support.h',
870         'src/symbols.c',
871         'src/symbols.h',
872         'src/templates.c',
873         'src/templates.h',
874         'src/toolbar.c',
875         'src/toolbar.h',
876         'src/tools.c',
877         'src/tools.h',
878         'src/sidebar.c',
879         'src/sidebar.h',
880         'src/ui_utils.c',
881         'src/ui_utils.h',
882         'src/utils.c',
883         'src/utils.h',
884         vte_src,
885         gen_src,
886         win_src,
887         osx_src,
888         soversion: '0',
889         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Geany"' ],
890         include_directories: [iscintilla],
891         dependencies: [dep_tagmanager, dep_ctags, dep_scintilla] + deps + win_deps + osx_deps,
892         install: true
894 dep_libgeany = declare_dependency(
895         link_with: libgeany,
896         include_directories: [iscintilla, itagmanager, igeany]
899 executable('geany',
900         win_resc,
901         'src/main.c',
902         link_with: libgeany,
903         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Geany"' ],
904         dependencies: deps,
905         build_rpath: meson.build_root(),
906         install_rpath: '$ORIGIN/../' + get_option('libdir'),
907         install: true
910 i18n = import('i18n')
912 desktop_file = 'geany.desktop'
913 desktop_output_file = i18n.merge_file(
914         type: 'desktop',
915         input: desktop_file + '.in',
916         output: desktop_file,
917         po_dir: 'po',
918         install: true,
919         install_dir: join_paths(get_option('datadir'), 'applications')
922 subdir('po')
923 subdir('data')
924 subdir('doc')
925 subdir('icons')
926 subdir('plugins')
927 subdir('tests')
929 install_data('COPYING', rename: 'GPL-2')
930 install_data(
931         'scintilla/License.txt',
932         'scintilla/lexilla/License.txt',
933         rename: [
934                 'ScintillaLicense.txt',
935                 'LexillaLicense.txt'
936         ],
937         install_dir: cdata.get('GEANY_DOC_DIR')
939 misc = [
940         'AUTHORS',
941         'COPYING',
942         'ChangeLog',
943         'NEWS',
944         'README',
945         'THANKS',
946         'TODO'
948 install_data(misc, install_dir: cdata.get('GEANY_DOC_DIR'))
949 if host_machine.system() == 'windows'
950 misc_rename = [
951         'Authors.txt',
952         'Changelog.txt',
953         'Copying.txt',
954         'Readme.txt',
955         'News.txt',
956         'Thanks.txt',
957         'Todo.txt'
959 install_data(misc, install_dir: prefix, rename: misc_rename)
960 endif