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