Merge pull request #3522 from lucasvieites/patch-2
[geany-mirror.git] / meson.build
blob15a37704ea874bfe7a7549edd91da999f01959e9
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/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/include/ILexer.h',
351         'scintilla/include/ILoader.h',
352         'scintilla/include/ScintillaCall.h',
353         'scintilla/include/Scintilla.h',
354         'scintilla/include/ScintillaMessages.h',
355         'scintilla/include/ScintillaStructures.h',
356         'scintilla/include/ScintillaTypes.h',
357         'scintilla/include/ScintillaWidget.h',
358         'scintilla/include/Sci_Position.h',
359         'scintilla/src/AutoComplete.cxx',
360         'scintilla/src/AutoComplete.h',
361         'scintilla/src/CallTip.cxx',
362         'scintilla/src/CallTip.h',
363         'scintilla/src/CaseConvert.cxx',
364         'scintilla/src/CaseConvert.h',
365         'scintilla/src/CaseFolder.cxx',
366         'scintilla/src/CaseFolder.h',
367         'scintilla/src/CellBuffer.cxx',
368         'scintilla/src/CellBuffer.h',
369         'scintilla/src/CharacterCategoryMap.cxx',
370         'scintilla/src/CharacterCategoryMap.h',
371         'scintilla/src/CharacterType.cxx',
372         'scintilla/src/CharacterType.h',
373         'scintilla/src/CharClassify.cxx',
374         'scintilla/src/CharClassify.h',
375         'scintilla/src/ContractionState.cxx',
376         'scintilla/src/ContractionState.h',
377         'scintilla/src/DBCS.cxx',
378         'scintilla/src/DBCS.h',
379         'scintilla/src/Debugging.h',
380         'scintilla/src/Decoration.cxx',
381         'scintilla/src/Decoration.h',
382         'scintilla/src/Document.cxx',
383         'scintilla/src/Document.h',
384         'scintilla/src/EditModel.cxx',
385         'scintilla/src/EditModel.h',
386         'scintilla/src/Editor.cxx',
387         'scintilla/src/Editor.h',
388         'scintilla/src/EditView.cxx',
389         'scintilla/src/EditView.h',
390         'scintilla/src/ElapsedPeriod.h',
391         'scintilla/src/FontQuality.h',
392         'scintilla/src/Geometry.cxx',
393         'scintilla/src/Geometry.h',
394         'scintilla/src/Indicator.cxx',
395         'scintilla/src/Indicator.h',
396         'scintilla/src/KeyMap.cxx',
397         'scintilla/src/KeyMap.h',
398         'scintilla/src/LineMarker.cxx',
399         'scintilla/src/LineMarker.h',
400         'scintilla/src/MarginView.cxx',
401         'scintilla/src/MarginView.h',
402         'scintilla/src/Partitioning.h',
403         'scintilla/src/PerLine.cxx',
404         'scintilla/src/PerLine.h',
405         'scintilla/src/Platform.h',
406         'scintilla/src/PositionCache.cxx',
407         'scintilla/src/PositionCache.h',
408         'scintilla/src/Position.h',
409         'scintilla/src/RESearch.cxx',
410         'scintilla/src/RESearch.h',
411         'scintilla/src/RunStyles.cxx',
412         'scintilla/src/RunStyles.h',
413         'scintilla/src/ScintillaBase.cxx',
414         'scintilla/src/ScintillaBase.h',
415         'scintilla/src/Selection.cxx',
416         'scintilla/src/Selection.h',
417         'scintilla/src/SparseVector.h',
418         'scintilla/src/SplitVector.h',
419         'scintilla/src/Style.cxx',
420         'scintilla/src/Style.h',
421         'scintilla/src/UniConversion.cxx',
422         'scintilla/src/UniConversion.h',
423         'scintilla/src/UniqueString.cxx',
424         'scintilla/src/UniqueString.h',
425         'scintilla/src/ViewStyle.cxx',
426         'scintilla/src/ViewStyle.h',
427         'scintilla/src/XPM.cxx',
428         'scintilla/src/XPM.h',
429         cpp_args: sci_cflags,
430         dependencies: deps + [ dep_lexilla ],
431         include_directories: [
432                 iscintilla,
433                 include_directories('scintilla/include', 'scintilla/src')
434         ]
436 dep_scintilla = declare_dependency(
437         link_with: scintilla,
438         include_directories: include_directories('scintilla/include')
441 if cdata.get('HAVE_FNMATCH') == 1
442         dep_fnmatch = dependency('', required: false)
443 else
444         # use fnmatch bundled with ctags
445         fnmatch = static_library('fnmatch',
446                 'ctags/fnmatch/fnmatch.c',
447                 'ctags/fnmatch/fnmatch.h',
448                 include_directories: [ifnmatch],
449                 c_args: basic_cflags
450         )
451         dep_fnmatch = declare_dependency(link_with: [fnmatch], include_directories: [ifnmatch])
452 endif
454 if cdata.get('HAVE_REGCOMP') == 1
455         dep_regex = dependency('', required: false)
456 else
457         # use regcomp bundled with ctags
458         regex = static_library('regex',
459                 'ctags/gnu_regex/regex.c',
460                 'ctags/gnu_regex/regex.h',
461                 dependencies: [dep_fnmatch],
462                 c_args: basic_cflags + [ '-D__USE_GNU' ]
463         )
464         dep_regex = declare_dependency(link_with: [regex], include_directories: [iregex])
465 endif
467 ctags = static_library('ctags',
468         'ctags/dsl/es.c',
469         'ctags/dsl/es.h',
470         'ctags/dsl/optscript.c',
471         'ctags/dsl/optscript.h',
472         'ctags/main/args.c',
473         'ctags/main/args_p.h',
474         'ctags/main/colprint.c',
475         'ctags/main/colprint_p.h',
476         'ctags/main/CommonPrelude.c',
477         'ctags/main/ctags.h',
478         'ctags/main/debug.c',
479         'ctags/main/debug.h',
480         'ctags/main/dependency.c',
481         'ctags/main/dependency.h',
482         'ctags/main/dependency_p.h',
483         'ctags/main/e_msoft.h',
484         'ctags/main/entry.c',
485         'ctags/main/entry.h',
486         'ctags/main/entry_p.h',
487         'ctags/main/entry_private.c',
488         'ctags/main/error.c',
489         'ctags/main/error_p.h',
490         'ctags/main/field.c',
491         'ctags/main/field.h',
492         'ctags/main/field_p.h',
493         'ctags/main/flags.c',
494         'ctags/main/flags_p.h',
495         'ctags/main/fmt.c',
496         'ctags/main/fmt_p.h',
497         'ctags/main/gcc-attr.h',
498         'ctags/main/general.h',
499         'ctags/main/gvars.h',
500         'ctags/main/htable.c',
501         'ctags/main/htable.h',
502         'ctags/main/inline.h',
503         'ctags/main/interactive_p.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/read.c',
552         'ctags/main/read.h',
553         'ctags/main/read_p.h',
554         'ctags/main/repoinfo.c',
555         'ctags/main/repoinfo.h',
556         'ctags/main/routines.c',
557         'ctags/main/routines.h',
558         'ctags/main/routines_p.h',
559         'ctags/main/script.c',
560         'ctags/main/script_p.h',
561         'ctags/main/seccomp.c',
562         'ctags/main/selectors.c',
563         'ctags/main/selectors.h',
564         'ctags/main/sort.c',
565         'ctags/main/sort_p.h',
566         'ctags/main/stats.c',
567         'ctags/main/stats_p.h',
568         'ctags/main/strlist.c',
569         'ctags/main/strlist.h',
570         'ctags/main/subparser.h',
571         'ctags/main/subparser_p.h',
572         'ctags/main/tokeninfo.c',
573         'ctags/main/tokeninfo.h',
574         'ctags/main/trace.c',
575         'ctags/main/trace.h',
576         'ctags/main/trashbox.c',
577         'ctags/main/trashbox.h',
578         'ctags/main/trashbox_p.h',
579         'ctags/main/types.h',
580         'ctags/main/unwindi.c',
581         'ctags/main/unwindi.h',
582         'ctags/main/vstring.c',
583         'ctags/main/vstring.h',
584         'ctags/main/writer.c',
585         'ctags/main/writer-ctags.c',
586         'ctags/main/writer-etags.c',
587         'ctags/main/writer-json.c',
588         'ctags/main/writer_p.h',
589         'ctags/main/writer-xref.c',
590         'ctags/main/xtag.c',
591         'ctags/main/xtag.h',
592         'ctags/main/xtag_p.h',
593         'ctags/parsers/abaqus.c',
594         'ctags/parsers/abc.c',
595         'ctags/parsers/ada.c',
596         'ctags/parsers/asciidoc.c',
597         'ctags/parsers/asm.c',
598         'ctags/parsers/autoit.c',
599         'ctags/parsers/basic.c',
600         'ctags/parsers/bibtex.c',
601         'ctags/parsers/clojure.c',
602         'ctags/parsers/cobol.c',
603         'ctags/parsers/cpreprocessor.c',
604         'ctags/parsers/cpreprocessor.h',
605         'ctags/parsers/css.c',
606         'ctags/parsers/cxx/cxx.c',
607         'ctags/parsers/cxx/cxx_debug.c',
608         'ctags/parsers/cxx/cxx_debug.h',
609         'ctags/parsers/cxx/cxx_debug_type.c',
610         'ctags/parsers/cxx/cxx_keyword.c',
611         'ctags/parsers/cxx/cxx_keyword.h',
612         'ctags/parsers/cxx/cxx_parser_block.c',
613         'ctags/parsers/cxx/cxx_parser.c',
614         'ctags/parsers/cxx/cxx_parser_function.c',
615         'ctags/parsers/cxx/cxx_parser.h',
616         'ctags/parsers/cxx/cxx_parser_internal.h',
617         'ctags/parsers/cxx/cxx_parser_lambda.c',
618         'ctags/parsers/cxx/cxx_parser_namespace.c',
619         'ctags/parsers/cxx/cxx_parser_template.c',
620         'ctags/parsers/cxx/cxx_parser_tokenizer.c',
621         'ctags/parsers/cxx/cxx_parser_typedef.c',
622         'ctags/parsers/cxx/cxx_parser_using.c',
623         'ctags/parsers/cxx/cxx_parser_variable.c',
624         'ctags/parsers/cxx/cxx_qtmoc.c',
625         'ctags/parsers/cxx/cxx_scope.c',
626         'ctags/parsers/cxx/cxx_scope.h',
627         'ctags/parsers/cxx/cxx_subparser.c',
628         'ctags/parsers/cxx/cxx_subparser.h',
629         'ctags/parsers/cxx/cxx_subparser_internal.h',
630         'ctags/parsers/cxx/cxx_tag.c',
631         'ctags/parsers/cxx/cxx_tag.h',
632         'ctags/parsers/cxx/cxx_token.c',
633         'ctags/parsers/cxx/cxx_token_chain.c',
634         'ctags/parsers/cxx/cxx_token_chain.h',
635         'ctags/parsers/cxx/cxx_token.h',
636         'ctags/parsers/diff.c',
637         'ctags/parsers/dosbatch.c',
638         'ctags/parsers/erlang.c',
639         'ctags/parsers/flex.c',
640         'ctags/parsers/fortran.c',
641         'ctags/parsers/gdscript.c',
642         'ctags/parsers/geany_c.c',
643         'ctags/parsers/geany_docbook.c',
644         'ctags/parsers/geany_lcpp.c',
645         'ctags/parsers/geany_lcpp.h',
646         'ctags/parsers/geany_matlab.c',
647         'ctags/parsers/go.c',
648         'ctags/parsers/haskell.c',
649         'ctags/parsers/haxe.c',
650         'ctags/parsers/html.c',
651         'ctags/parsers/iniconf.c',
652         'ctags/parsers/iniconf.h',
653         'ctags/parsers/jscript.c',
654         'ctags/parsers/json.c',
655         'ctags/parsers/julia.c',
656         'ctags/parsers/lisp.c',
657         'ctags/parsers/lua.c',
658         'ctags/parsers/make.c',
659         'ctags/parsers/make.h',
660         'ctags/parsers/markdown.c',
661         'ctags/parsers/markdown.h',
662         'ctags/parsers/nsis.c',
663         'ctags/parsers/objc.c',
664         'ctags/parsers/pascal.c',
665         'ctags/parsers/perl.c',
666         'ctags/parsers/perl.h',
667         'ctags/parsers/php.c',
668         'ctags/parsers/powershell.c',
669         'ctags/parsers/python.c',
670         'ctags/parsers/r.c',
671         'ctags/parsers/r.h',
672         'ctags/parsers/rst.c',
673         'ctags/parsers/ruby.c',
674         'ctags/parsers/rust.c',
675         'ctags/parsers/sh.c',
676         'ctags/parsers/sql.c',
677         'ctags/parsers/tcl.c',
678         'ctags/parsers/tcl.h',
679         'ctags/parsers/tcloo.c',
680         'ctags/parsers/tex.c',
681         'ctags/parsers/tex.h',
682         'ctags/parsers/txt2tags.c',
683         'ctags/parsers/typescript.c',
684         'ctags/parsers/verilog.c',
685         'ctags/parsers/vhdl.c',
686         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="CTags"',
687                                  '-DEXTERNAL_PARSER_LIST_FILE="src/tagmanager/tm_parsers.h"' ],
688         dependencies: deps + [dep_fnmatch, dep_regex],
689         include_directories: [ictags]
691 dep_ctags = declare_dependency(link_with: [ctags], include_directories: [ictags])
693 install_headers(
694         'src/tagmanager/tm_source_file.h',
695         'src/tagmanager/tm_tag.h',
696         'src/tagmanager/tm_workspace.h',
697         'src/tagmanager/tm_parser.h',
698         subdir: 'geany/tagmanager'
701 tagmanager = static_library('tagmanager',
702         'src/tagmanager/tm_ctags.h',
703         'src/tagmanager/tm_ctags.c',
704         'src/tagmanager/tm_parser.h',
705         'src/tagmanager/tm_parser.c',
706         'src/tagmanager/tm_parsers.h',
707         'src/tagmanager/tm_source_file.h',
708         'src/tagmanager/tm_source_file.c',
709         'src/tagmanager/tm_tag.h',
710         'src/tagmanager/tm_tag.c',
711         'src/tagmanager/tm_workspace.h',
712         'src/tagmanager/tm_workspace.c',
713         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Tagmanager"' ],
714         dependencies: [dep_ctags, glib]
716 dep_tagmanager = declare_dependency(
717         link_with: tagmanager,
718         include_directories: [itagmanager]
721 # Generate signallist.i
722 gen_src = custom_target('gen-signallist',
723         input : [ 'data/geany.glade' ],
724         output : [ 'signallist.i' ],
725         command : [find_program('scripts/gen-signallist.sh'), '@INPUT@', '@OUTPUT@' ]
728 win_src = []
729 win_deps = []
730 if (host_machine.system() == 'windows')
731         win_src += [ 'src/win32.c', 'src/win32.h' ]
732         foreach lib : ['ole32', 'wsock32', 'comdlg32']
733                 win_deps += cc.find_library(lib)
734         endforeach
735 endif
737 install_headers(
738         'plugins/geanyfunctions.h',
739         'plugins/geanyplugin.h',
740         'src/app.h',
741         'src/build.h',
742         'src/dialogs.h',
743         'src/document.h',
744         'src/editor.h',
745         'src/encodings.h',
746         'src/filetypes.h',
747         'src/geany.h',
748         'src/gtkcompat.h',
749         'src/highlighting.h',
750         'src/keybindings.h',
751         'src/main.h',
752         'src/msgwindow.h',
753         'src/navqueue.h',
754         'src/plugindata.h',
755         'src/pluginutils.h',
756         'src/prefs.h',
757         'src/project.h',
758         'src/sciwrappers.h',
759         'src/search.h',
760         'src/spawn.h',
761         'src/stash.h',
762         'src/support.h',
763         'src/symbols.h',
764         'src/templates.h',
765         'src/toolbar.h',
766         'src/ui_utils.h',
767         'src/utils.h',
768         subdir: 'geany'
771 libgeany = shared_library('geany',
772         'src/about.c',
773         'src/about.h',
774         'src/app.h',
775         'src/build.c',
776         'src/build.h',
777         'src/callbacks.c',
778         'src/callbacks.h',
779         'src/dialogs.c',
780         'src/dialogs.h',
781         'src/document.c',
782         'src/document.h',
783         'src/editor.c',
784         'src/editor.h',
785         'src/encodings.c',
786         'src/encodings.h',
787         'src/filetypes.c',
788         'src/filetypes.h',
789         'src/geanyentryaction.c',
790         'src/geanyentryaction.h',
791         'src/geanymenubuttonaction.c',
792         'src/geanymenubuttonaction.h',
793         'src/geanyobject.c',
794         'src/geanyobject.h',
795         'src/geanywraplabel.c',
796         'src/geanywraplabel.h',
797         'src/gtkcompat.h',
798         'src/highlighting.c',
799         'src/highlighting.h',
800         'src/highlightingmappings.h',
801         'src/keybindings.c',
802         'src/keybindings.h',
803         'src/keyfile.c',
804         'src/keyfile.h',
805         'src/log.c',
806         'src/log.h',
807         'src/libmain.c',
808         'src/main.h',
809         'src/geany.h',
810         'src/msgwindow.c',
811         'src/msgwindow.h',
812         'src/navqueue.c',
813         'src/navqueue.h',
814         'src/notebook.c',
815         'src/notebook.h',
816         'src/plugins.c',
817         'src/plugins.h',
818         'src/pluginutils.c',
819         'src/pluginutils.h',
820         'src/prefs.c',
821         'src/prefs.h',
822         'src/printing.c',
823         'src/printing.h',
824         'src/project.c',
825         'src/project.h',
826         'src/sciwrappers.c',
827         'src/sciwrappers.h',
828         'src/search.c',
829         'src/search.h',
830         'src/socket.c',
831         'src/socket.h',
832         'src/spawn.c',
833         'src/spawn.h',
834         'src/stash.c',
835         'src/stash.h',
836         'src/support.h',
837         'src/symbols.c',
838         'src/symbols.h',
839         'src/templates.c',
840         'src/templates.h',
841         'src/toolbar.c',
842         'src/toolbar.h',
843         'src/tools.c',
844         'src/tools.h',
845         'src/sidebar.c',
846         'src/sidebar.h',
847         'src/ui_utils.c',
848         'src/ui_utils.h',
849         'src/utils.c',
850         'src/utils.h',
851         gen_src,
852         win_src,
853         dep_mac_integration.found() ? ['src/osx.c', 'src/osx.h'] : [],
854         host_machine.system() == 'windows' ? ['src/win32.c',  'src/win32.h'] : [ 'src/vte.c', 'src/vte.h' ],
855         soversion: '0',
856         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Geany"' ],
857         include_directories: [iscintilla],
858         dependencies: [dep_tagmanager, dep_ctags, dep_scintilla, dep_mac_integration] + deps + win_deps,
859         install: true
861 dep_libgeany = declare_dependency(
862         link_with: libgeany,
863         include_directories: [iscintilla, itagmanager, igeany]
866 executable('geany',
867         'src/main.c',
868         link_with: libgeany,
869         c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Geany"' ],
870         dependencies: deps,
871         build_rpath: meson.build_root(),
872         install_rpath: '$ORIGIN/../' + get_option('libdir'),
873         install: true
876 i18n = import('i18n')
878 desktop_file = 'geany.desktop'
879 desktop_output_file = i18n.merge_file(
880         type: 'desktop',
881         input: desktop_file + '.in',
882         output: desktop_file,
883         po_dir: 'po',
884         install: true,
885         install_dir: join_paths(get_option('datadir'), 'applications')
888 subdir('po')
889 subdir('data')
890 subdir('doc')
891 subdir('icons')
892 subdir('plugins')
893 subdir('tests')
895 install_data('COPYING', rename: 'GPL-2')
896 install_data(
897         'scintilla/License.txt',
898         'scintilla/lexilla/License.txt',
899         rename: [
900                 'ScintillaLicense.txt',
901                 'LexillaLicense.txt'
902         ],
903         install_dir: cdata.get('GEANY_DOC_DIR')
905 misc = [
906         'AUTHORS',
907         'COPYING',
908         'ChangeLog',
909         'NEWS',
910         'README',
911         'THANKS',
912         'TODO'
914 install_data(misc, install_dir: cdata.get('GEANY_DOC_DIR'))
915 if host_machine.system() == 'windows'
916 misc_rename = [
917         'Authors.txt',
918         'Changelog.txt',
919         'Copying.txt',
920         'Readme.txt',
921         'News.txt',
922         'Thanks.txt',
923         'Todo.txt'
925 install_data(misc, install_dir: prefix, rename: misc_rename)
926 endif