Merge pull request #3334 from eht16/show_d_python_global_class_calltips
[geany-mirror.git] / meson.build
blob154a5919dcead7bd4b747172bbba08252d4a461b
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.0']
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')
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/LexBash.cxx',
257         'scintilla/lexilla/lexers/LexBasic.cxx',
258         'scintilla/lexilla/lexers/LexBatch.cxx',
259         'scintilla/lexilla/lexers/LexCaml.cxx',
260         'scintilla/lexilla/lexers/LexCmake.cxx',
261         'scintilla/lexilla/lexers/LexCOBOL.cxx',
262         'scintilla/lexilla/lexers/LexCoffeeScript.cxx',
263         'scintilla/lexilla/lexers/LexCPP.cxx',
264         'scintilla/lexilla/lexers/LexCSS.cxx',
265         'scintilla/lexilla/lexers/LexD.cxx',
266         'scintilla/lexilla/lexers/LexDiff.cxx',
267         'scintilla/lexilla/lexers/LexErlang.cxx',
268         'scintilla/lexilla/lexers/LexForth.cxx',
269         'scintilla/lexilla/lexers/LexGDScript.cxx',
270         'scintilla/lexilla/lexers/LexFortran.cxx',
271         'scintilla/lexilla/lexers/LexHaskell.cxx',
272         'scintilla/lexilla/lexers/LexHTML.cxx',
273         'scintilla/lexilla/lexers/LexJulia.cxx',
274         'scintilla/lexilla/lexers/LexLaTeX.cxx',
275         'scintilla/lexilla/lexers/LexLisp.cxx',
276         'scintilla/lexilla/lexers/LexLua.cxx',
277         'scintilla/lexilla/lexers/LexMake.cxx',
278         'scintilla/lexilla/lexers/LexMarkdown.cxx',
279         'scintilla/lexilla/lexers/LexMatlab.cxx',
280         'scintilla/lexilla/lexers/LexNsis.cxx',
281         'scintilla/lexilla/lexers/LexNull.cxx',
282         'scintilla/lexilla/lexers/LexPascal.cxx',
283         'scintilla/lexilla/lexers/LexPerl.cxx',
284         'scintilla/lexilla/lexers/LexPO.cxx',
285         'scintilla/lexilla/lexers/LexPowerShell.cxx',
286         'scintilla/lexilla/lexers/LexProps.cxx',
287         'scintilla/lexilla/lexers/LexPython.cxx',
288         'scintilla/lexilla/lexers/LexR.cxx',
289         'scintilla/lexilla/lexers/LexRuby.cxx',
290         'scintilla/lexilla/lexers/LexRust.cxx',
291         'scintilla/lexilla/lexers/LexSmalltalk.cxx',
292         'scintilla/lexilla/lexers/LexSQL.cxx',
293         'scintilla/lexilla/lexers/LexTCL.cxx',
294         'scintilla/lexilla/lexers/LexTxt2tags.cxx',
295         'scintilla/lexilla/lexers/LexVerilog.cxx',
296         'scintilla/lexilla/lexers/LexVHDL.cxx',
297         'scintilla/lexilla/lexers/LexYAML.cxx',
298         'scintilla/lexilla/lexlib/Accessor.cxx',
299         'scintilla/lexilla/lexlib/Accessor.h',
300         'scintilla/lexilla/lexlib/CatalogueModules.h',
301         'scintilla/lexilla/lexlib/CharacterCategory.cxx',
302         'scintilla/lexilla/lexlib/CharacterCategory.h',
303         'scintilla/lexilla/lexlib/CharacterSet.cxx',
304         'scintilla/lexilla/lexlib/CharacterSet.h',
305         'scintilla/lexilla/lexlib/DefaultLexer.cxx',
306         'scintilla/lexilla/lexlib/DefaultLexer.h',
307         'scintilla/lexilla/lexlib/LexAccessor.cxx',
308         'scintilla/lexilla/lexlib/LexAccessor.h',
309         'scintilla/lexilla/lexlib/LexerBase.cxx',
310         'scintilla/lexilla/lexlib/LexerBase.h',
311         'scintilla/lexilla/lexlib/LexerModule.cxx',
312         'scintilla/lexilla/lexlib/LexerModule.h',
313         'scintilla/lexilla/lexlib/LexerNoExceptions.cxx',
314         'scintilla/lexilla/lexlib/LexerNoExceptions.h',
315         'scintilla/lexilla/lexlib/LexerSimple.cxx',
316         'scintilla/lexilla/lexlib/LexerSimple.h',
317         'scintilla/lexilla/lexlib/OptionSet.h',
318         'scintilla/lexilla/lexlib/PropSetSimple.cxx',
319         'scintilla/lexilla/lexlib/PropSetSimple.h',
320         'scintilla/lexilla/lexlib/SparseState.h',
321         'scintilla/lexilla/lexlib/StringCopy.h',
322         'scintilla/lexilla/lexlib/StyleContext.cxx',
323         'scintilla/lexilla/lexlib/StyleContext.h',
324         'scintilla/lexilla/lexlib/SubStyles.h',
325         'scintilla/lexilla/lexlib/WordList.cxx',
326         'scintilla/lexilla/lexlib/WordList.h',
327         'scintilla/lexilla/src/Lexilla.cxx',
328         cpp_args: sci_cflags,
329         dependencies: deps,
330         include_directories: [
331                 iscintilla,
332                 include_directories('scintilla/lexilla/lexlib', 'scintilla/lexilla/include')
333         ]
335 dep_lexilla = declare_dependency(
336         link_with: lexilla,
337         include_directories: include_directories('scintilla/lexilla/include')
340 scintilla = static_library('scintilla',
341         'scintilla/gtk/Converter.h',
342         'scintilla/gtk/PlatGTK.cxx',
343         'scintilla/gtk/ScintillaGTKAccessible.cxx',
344         'scintilla/gtk/ScintillaGTKAccessible.h',
345         'scintilla/gtk/ScintillaGTK.cxx',
346         'scintilla/gtk/ScintillaGTK.h',
347         'scintilla/gtk/scintilla-marshal.c',
348         'scintilla/gtk/scintilla-marshal.h',
349         'scintilla/include/ILexer.h',
350         'scintilla/include/ILoader.h',
351         'scintilla/include/ScintillaCall.h',
352         'scintilla/include/Scintilla.h',
353         'scintilla/include/ScintillaMessages.h',
354         'scintilla/include/ScintillaStructures.h',
355         'scintilla/include/ScintillaTypes.h',
356         'scintilla/include/ScintillaWidget.h',
357         'scintilla/include/Sci_Position.h',
358         'scintilla/src/AutoComplete.cxx',
359         'scintilla/src/AutoComplete.h',
360         'scintilla/src/CallTip.cxx',
361         'scintilla/src/CallTip.h',
362         'scintilla/src/CaseConvert.cxx',
363         'scintilla/src/CaseConvert.h',
364         'scintilla/src/CaseFolder.cxx',
365         'scintilla/src/CaseFolder.h',
366         'scintilla/src/CellBuffer.cxx',
367         'scintilla/src/CellBuffer.h',
368         'scintilla/src/CharacterCategoryMap.cxx',
369         'scintilla/src/CharacterCategoryMap.h',
370         'scintilla/src/CharacterType.cxx',
371         'scintilla/src/CharacterType.h',
372         'scintilla/src/CharClassify.cxx',
373         'scintilla/src/CharClassify.h',
374         'scintilla/src/ContractionState.cxx',
375         'scintilla/src/ContractionState.h',
376         'scintilla/src/DBCS.cxx',
377         'scintilla/src/DBCS.h',
378         'scintilla/src/Debugging.h',
379         'scintilla/src/Decoration.cxx',
380         'scintilla/src/Decoration.h',
381         'scintilla/src/Document.cxx',
382         'scintilla/src/Document.h',
383         'scintilla/src/EditModel.cxx',
384         'scintilla/src/EditModel.h',
385         'scintilla/src/Editor.cxx',
386         'scintilla/src/Editor.h',
387         'scintilla/src/EditView.cxx',
388         'scintilla/src/EditView.h',
389         'scintilla/src/ElapsedPeriod.h',
390         'scintilla/src/FontQuality.h',
391         'scintilla/src/Geometry.cxx',
392         'scintilla/src/Geometry.h',
393         'scintilla/src/Indicator.cxx',
394         'scintilla/src/Indicator.h',
395         'scintilla/src/KeyMap.cxx',
396         'scintilla/src/KeyMap.h',
397         'scintilla/src/LineMarker.cxx',
398         'scintilla/src/LineMarker.h',
399         'scintilla/src/MarginView.cxx',
400         'scintilla/src/MarginView.h',
401         'scintilla/src/Partitioning.h',
402         'scintilla/src/PerLine.cxx',
403         'scintilla/src/PerLine.h',
404         'scintilla/src/Platform.h',
405         'scintilla/src/PositionCache.cxx',
406         'scintilla/src/PositionCache.h',
407         'scintilla/src/Position.h',
408         'scintilla/src/RESearch.cxx',
409         'scintilla/src/RESearch.h',
410         'scintilla/src/RunStyles.cxx',
411         'scintilla/src/RunStyles.h',
412         'scintilla/src/ScintillaBase.cxx',
413         'scintilla/src/ScintillaBase.h',
414         'scintilla/src/Selection.cxx',
415         'scintilla/src/Selection.h',
416         'scintilla/src/SparseVector.h',
417         'scintilla/src/SplitVector.h',
418         'scintilla/src/Style.cxx',
419         'scintilla/src/Style.h',
420         'scintilla/src/UniConversion.cxx',
421         'scintilla/src/UniConversion.h',
422         'scintilla/src/UniqueString.cxx',
423         'scintilla/src/UniqueString.h',
424         'scintilla/src/ViewStyle.cxx',
425         'scintilla/src/ViewStyle.h',
426         'scintilla/src/XPM.cxx',
427         'scintilla/src/XPM.h',
428         cpp_args: sci_cflags,
429         dependencies: deps + [ dep_lexilla ],
430         include_directories: [
431                 iscintilla,
432                 include_directories('scintilla/include', 'scintilla/src')
433         ]
435 dep_scintilla = declare_dependency(
436         link_with: scintilla,
437         include_directories: include_directories('scintilla/include')
440 if cdata.get('HAVE_FNMATCH') == 1
441         dep_fnmatch = dependency('', required: false)
442 else
443         # use fnmatch bundled with ctags
444         fnmatch = static_library('fnmatch',
445                 'ctags/fnmatch/fnmatch.c',
446                 'ctags/fnmatch/fnmatch.h',
447                 include_directories: [ifnmatch],
448                 c_args: basic_cflags
449         )
450         dep_fnmatch = declare_dependency(link_with: [fnmatch], include_directories: [ifnmatch])
451 endif
453 if cdata.get('HAVE_REGCOMP') == 1
454         dep_regex = dependency('', required: false)
455 else
456         # use regcomp bundled with ctags
457         regex = static_library('regex',
458                 'ctags/gnu_regex/regex.c',
459                 'ctags/gnu_regex/regex.h',
460                 dependencies: [dep_fnmatch],
461                 c_args: basic_cflags + [ '-D__USE_GNU' ]
462         )
463         dep_regex = declare_dependency(link_with: [regex], include_directories: [iregex])
464 endif
466 ctags = static_library('ctags',
467         'ctags/dsl/es.c',
468         'ctags/dsl/es.h',
469         'ctags/dsl/optscript.c',
470         'ctags/dsl/optscript.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/keyword.c',
504         'ctags/main/keyword.h',
505         'ctags/main/keyword_p.h',
506         'ctags/main/kind.c',
507         'ctags/main/kind.h',
508         'ctags/main/kind_p.h',
509         'ctags/main/lregex.c',
510         'ctags/main/lregex-default.c',
511         'ctags/main/lregex.h',
512         'ctags/main/lregex_p.h',
513         'ctags/main/lxpath.c',
514         'ctags/main/lxpath.h',
515         'ctags/main/lxpath_p.h',
516         'ctags/main/main.c',
517         'ctags/main/main_p.h',
518         'ctags/main/mbcs.c',
519         'ctags/main/mbcs.h',
520         'ctags/main/mbcs_p.h',
521         'ctags/main/mio.c',
522         'ctags/main/mio.h',
523         'ctags/main/nestlevel.c',
524         'ctags/main/nestlevel.h',
525         'ctags/main/numarray.c',
526         'ctags/main/numarray.h',
527         'ctags/main/objpool.c',
528         'ctags/main/objpool.h',
529         'ctags/main/options.c',
530         'ctags/main/options.h',
531         'ctags/main/options_p.h',
532         'ctags/main/param.c',
533         'ctags/main/param.h',
534         'ctags/main/param_p.h',
535         'ctags/main/parse.c',
536         'ctags/main/parse.h',
537         'ctags/main/parse_p.h',
538         'ctags/main/parsers_p.h',
539         'ctags/main/portable-dirent_p.h',
540         'ctags/main/portable-scandir.c',
541         'ctags/main/promise.c',
542         'ctags/main/promise.h',
543         'ctags/main/promise_p.h',
544         'ctags/main/ptag.c',
545         'ctags/main/ptag_p.h',
546         'ctags/main/ptrarray.c',
547         'ctags/main/ptrarray.h',
548         'ctags/main/rbtree.c',
549         'ctags/main/rbtree.h',
550         'ctags/main/read.c',
551         'ctags/main/read.h',
552         'ctags/main/read_p.h',
553         'ctags/main/repoinfo.c',
554         'ctags/main/repoinfo.h',
555         'ctags/main/routines.c',
556         'ctags/main/routines.h',
557         'ctags/main/routines_p.h',
558         'ctags/main/script.c',
559         'ctags/main/script_p.h',
560         'ctags/main/seccomp.c',
561         'ctags/main/selectors.c',
562         'ctags/main/selectors.h',
563         'ctags/main/sort.c',
564         'ctags/main/sort_p.h',
565         'ctags/main/stats.c',
566         'ctags/main/stats_p.h',
567         'ctags/main/strlist.c',
568         'ctags/main/strlist.h',
569         'ctags/main/subparser.h',
570         'ctags/main/subparser_p.h',
571         'ctags/main/tokeninfo.c',
572         'ctags/main/tokeninfo.h',
573         'ctags/main/trace.c',
574         'ctags/main/trace.h',
575         'ctags/main/trashbox.c',
576         'ctags/main/trashbox.h',
577         'ctags/main/trashbox_p.h',
578         'ctags/main/types.h',
579         'ctags/main/unwindi.c',
580         'ctags/main/unwindi.h',
581         'ctags/main/vstring.c',
582         'ctags/main/vstring.h',
583         'ctags/main/writer.c',
584         'ctags/main/writer-ctags.c',
585         'ctags/main/writer-etags.c',
586         'ctags/main/writer-json.c',
587         'ctags/main/writer_p.h',
588         'ctags/main/writer-xref.c',
589         'ctags/main/xtag.c',
590         'ctags/main/xtag.h',
591         'ctags/main/xtag_p.h',
592         'ctags/parsers/abaqus.c',
593         'ctags/parsers/abc.c',
594         'ctags/parsers/ada.c',
595         'ctags/parsers/asciidoc.c',
596         'ctags/parsers/asm.c',
597         'ctags/parsers/basic.c',
598         'ctags/parsers/bibtex.c',
599         'ctags/parsers/clojure.c',
600         'ctags/parsers/cobol.c',
601         'ctags/parsers/cpreprocessor.c',
602         'ctags/parsers/cpreprocessor.h',
603         'ctags/parsers/css.c',
604         'ctags/parsers/cxx/cxx.c',
605         'ctags/parsers/cxx/cxx_debug.c',
606         'ctags/parsers/cxx/cxx_debug.h',
607         'ctags/parsers/cxx/cxx_debug_type.c',
608         'ctags/parsers/cxx/cxx_keyword.c',
609         'ctags/parsers/cxx/cxx_keyword.h',
610         'ctags/parsers/cxx/cxx_parser_block.c',
611         'ctags/parsers/cxx/cxx_parser.c',
612         'ctags/parsers/cxx/cxx_parser_function.c',
613         'ctags/parsers/cxx/cxx_parser.h',
614         'ctags/parsers/cxx/cxx_parser_internal.h',
615         'ctags/parsers/cxx/cxx_parser_lambda.c',
616         'ctags/parsers/cxx/cxx_parser_namespace.c',
617         'ctags/parsers/cxx/cxx_parser_template.c',
618         'ctags/parsers/cxx/cxx_parser_tokenizer.c',
619         'ctags/parsers/cxx/cxx_parser_typedef.c',
620         'ctags/parsers/cxx/cxx_parser_using.c',
621         'ctags/parsers/cxx/cxx_parser_variable.c',
622         'ctags/parsers/cxx/cxx_qtmoc.c',
623         'ctags/parsers/cxx/cxx_scope.c',
624         'ctags/parsers/cxx/cxx_scope.h',
625         'ctags/parsers/cxx/cxx_subparser.c',
626         'ctags/parsers/cxx/cxx_subparser.h',
627         'ctags/parsers/cxx/cxx_subparser_internal.h',
628         'ctags/parsers/cxx/cxx_tag.c',
629         'ctags/parsers/cxx/cxx_tag.h',
630         'ctags/parsers/cxx/cxx_token.c',
631         'ctags/parsers/cxx/cxx_token_chain.c',
632         'ctags/parsers/cxx/cxx_token_chain.h',
633         'ctags/parsers/cxx/cxx_token.h',
634         'ctags/parsers/diff.c',
635         'ctags/parsers/erlang.c',
636         'ctags/parsers/flex.c',
637         'ctags/parsers/fortran.c',
638         'ctags/parsers/gdscript.c',
639         'ctags/parsers/geany_c.c',
640         'ctags/parsers/geany_docbook.c',
641         'ctags/parsers/geany_lcpp.c',
642         'ctags/parsers/geany_lcpp.h',
643         'ctags/parsers/geany_matlab.c',
644         'ctags/parsers/go.c',
645         'ctags/parsers/haskell.c',
646         'ctags/parsers/haxe.c',
647         'ctags/parsers/html.c',
648         'ctags/parsers/iniconf.c',
649         'ctags/parsers/iniconf.h',
650         'ctags/parsers/jscript.c',
651         'ctags/parsers/json.c',
652         'ctags/parsers/julia.c',
653         'ctags/parsers/lisp.c',
654         'ctags/parsers/lua.c',
655         'ctags/parsers/make.c',
656         'ctags/parsers/make.h',
657         'ctags/parsers/markdown.c',
658         'ctags/parsers/markdown.h',
659         'ctags/parsers/nsis.c',
660         'ctags/parsers/objc.c',
661         'ctags/parsers/pascal.c',
662         'ctags/parsers/perl.c',
663         'ctags/parsers/perl.h',
664         'ctags/parsers/php.c',
665         'ctags/parsers/powershell.c',
666         'ctags/parsers/python.c',
667         'ctags/parsers/r.c',
668         'ctags/parsers/r.h',
669         'ctags/parsers/rst.c',
670         'ctags/parsers/ruby.c',
671         'ctags/parsers/rust.c',
672         'ctags/parsers/sh.c',
673         'ctags/parsers/sql.c',
674         'ctags/parsers/tcl.c',
675         'ctags/parsers/tcl.h',
676         'ctags/parsers/tcloo.c',
677         'ctags/parsers/tex.c',
678         'ctags/parsers/tex.h',
679         'ctags/parsers/txt2tags.c',
680         'ctags/parsers/typescript.c',
681         'ctags/parsers/verilog.c',
682         'ctags/parsers/vhdl.c',
683         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="CTags"',
684                                  '-DEXTERNAL_PARSER_LIST_FILE="src/tagmanager/tm_parsers.h"' ],
685         dependencies: deps + [dep_fnmatch, dep_regex],
686         include_directories: [ictags]
688 dep_ctags = declare_dependency(link_with: [ctags], include_directories: [ictags])
690 install_headers(
691         'src/tagmanager/tm_source_file.h',
692         'src/tagmanager/tm_tag.h',
693         'src/tagmanager/tm_workspace.h',
694         'src/tagmanager/tm_parser.h',
695         subdir: 'geany/tagmanager'
698 tagmanager = static_library('tagmanager',
699         'src/tagmanager/tm_ctags.h',
700         'src/tagmanager/tm_ctags.c',
701         'src/tagmanager/tm_parser.h',
702         'src/tagmanager/tm_parser.c',
703         'src/tagmanager/tm_parsers.h',
704         'src/tagmanager/tm_source_file.h',
705         'src/tagmanager/tm_source_file.c',
706         'src/tagmanager/tm_tag.h',
707         'src/tagmanager/tm_tag.c',
708         'src/tagmanager/tm_workspace.h',
709         'src/tagmanager/tm_workspace.c',
710         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Tagmanager"' ],
711         dependencies: [dep_ctags, glib]
713 dep_tagmanager = declare_dependency(
714         link_with: tagmanager,
715         include_directories: [itagmanager]
718 # Generate signallist.i
719 gen_src = custom_target('gen-signallist',
720         input : [ 'data/geany.glade' ],
721         output : [ 'signallist.i' ],
722         command : [find_program('scripts/gen-signallist.sh'), '@INPUT@', '@OUTPUT@' ]
725 win_src = []
726 win_deps = []
727 if (host_machine.system() == 'windows')
728         win_src += [ 'src/win32.c', 'src/win32.h' ]
729         foreach lib : ['ole32', 'wsock32', 'comdlg32']
730                 win_deps += cc.find_library(lib)
731         endforeach
732 endif
734 install_headers(
735         'plugins/geanyfunctions.h',
736         'plugins/geanyplugin.h',
737         'src/app.h',
738         'src/build.h',
739         'src/dialogs.h',
740         'src/document.h',
741         'src/editor.h',
742         'src/encodings.h',
743         'src/filetypes.h',
744         'src/geany.h',
745         'src/gtkcompat.h',
746         'src/highlighting.h',
747         'src/keybindings.h',
748         'src/main.h',
749         'src/msgwindow.h',
750         'src/navqueue.h',
751         'src/plugindata.h',
752         'src/pluginutils.h',
753         'src/prefs.h',
754         'src/project.h',
755         'src/sciwrappers.h',
756         'src/search.h',
757         'src/spawn.h',
758         'src/stash.h',
759         'src/support.h',
760         'src/symbols.h',
761         'src/templates.h',
762         'src/toolbar.h',
763         'src/ui_utils.h',
764         'src/utils.h',
765         subdir: 'geany'
768 libgeany = shared_library('geany',
769         'src/about.c',
770         'src/about.h',
771         'src/app.h',
772         'src/build.c',
773         'src/build.h',
774         'src/callbacks.c',
775         'src/callbacks.h',
776         'src/dialogs.c',
777         'src/dialogs.h',
778         'src/document.c',
779         'src/document.h',
780         'src/editor.c',
781         'src/editor.h',
782         'src/encodings.c',
783         'src/encodings.h',
784         'src/filetypes.c',
785         'src/filetypes.h',
786         'src/geanyentryaction.c',
787         'src/geanyentryaction.h',
788         'src/geanymenubuttonaction.c',
789         'src/geanymenubuttonaction.h',
790         'src/geanyobject.c',
791         'src/geanyobject.h',
792         'src/geanywraplabel.c',
793         'src/geanywraplabel.h',
794         'src/gtkcompat.h',
795         'src/highlighting.c',
796         'src/highlighting.h',
797         'src/highlightingmappings.h',
798         'src/keybindings.c',
799         'src/keybindings.h',
800         'src/keyfile.c',
801         'src/keyfile.h',
802         'src/log.c',
803         'src/log.h',
804         'src/libmain.c',
805         'src/main.h',
806         'src/geany.h',
807         'src/msgwindow.c',
808         'src/msgwindow.h',
809         'src/navqueue.c',
810         'src/navqueue.h',
811         'src/notebook.c',
812         'src/notebook.h',
813         'src/plugins.c',
814         'src/plugins.h',
815         'src/pluginutils.c',
816         'src/pluginutils.h',
817         'src/prefs.c',
818         'src/prefs.h',
819         'src/printing.c',
820         'src/printing.h',
821         'src/project.c',
822         'src/project.h',
823         'src/sciwrappers.c',
824         'src/sciwrappers.h',
825         'src/search.c',
826         'src/search.h',
827         'src/socket.c',
828         'src/socket.h',
829         'src/spawn.c',
830         'src/spawn.h',
831         'src/stash.c',
832         'src/stash.h',
833         'src/support.h',
834         'src/symbols.c',
835         'src/symbols.h',
836         'src/templates.c',
837         'src/templates.h',
838         'src/toolbar.c',
839         'src/toolbar.h',
840         'src/tools.c',
841         'src/tools.h',
842         'src/sidebar.c',
843         'src/sidebar.h',
844         'src/ui_utils.c',
845         'src/ui_utils.h',
846         'src/utils.c',
847         'src/utils.h',
848         gen_src,
849         win_src,
850         dep_mac_integration.found() ? ['src/osx.c', 'src/osx.h'] : [],
851         host_machine.system() == 'windows' ? ['src/win32.c',  'src/win32.h'] : [ 'src/vte.c', 'src/vte.h' ],
852         soversion: '0',
853         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Geany"' ],
854         include_directories: [iscintilla],
855         dependencies: [dep_tagmanager, dep_ctags, dep_scintilla, dep_mac_integration] + deps + win_deps,
856         install: true
858 dep_libgeany = declare_dependency(
859         link_with: libgeany,
860         include_directories: [iscintilla, itagmanager, igeany]
863 executable('geany',
864         'src/main.c',
865         link_with: libgeany,
866         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Geany"' ],
867         dependencies: deps,
868         build_rpath: meson.build_root(),
869         install_rpath: '$ORIGIN/../' + get_option('libdir'),
870         install: true
873 i18n = import('i18n')
875 desktop_file = 'geany.desktop'
876 desktop_output_file = i18n.merge_file(
877         type: 'desktop',
878         input: desktop_file + '.in',
879         output: desktop_file,
880         po_dir: 'po',
881         install: true,
882         install_dir: join_paths(get_option('datadir'), 'applications')
885 subdir('po')
886 subdir('data')
887 subdir('doc')
888 subdir('icons')
889 subdir('plugins')
890 subdir('tests')
892 install_data('COPYING', rename: 'GPL-2')
893 install_data(
894         'scintilla/License.txt',
895         'scintilla/lexilla/License.txt',
896         rename: [
897                 'ScintillaLicense.txt',
898                 'LexillaLicense.txt'
899         ],
900         install_dir: cdata.get('GEANY_DOC_DIR')
902 misc = [
903         'AUTHORS',
904         'COPYING',
905         'ChangeLog',
906         'NEWS',
907         'README',
908         'THANKS',
909         'TODO'
911 install_data(misc, install_dir: cdata.get('GEANY_DOC_DIR'))
912 if host_machine.system() == 'windows'
913 misc_rename = [
914         'Authors.txt',
915         'Changelog.txt',
916         'Copying.txt',
917         'Readme.txt',
918         'News.txt',
919         'Thanks.txt',
920         'Todo.txt'
922 install_data(misc, install_dir: prefix, rename: misc_rename)
923 endif