Remove unused variable
[geany-mirror.git] / meson.build
blobeacb73cb6b15abe80de540deb2eeaadbb6d61eb9
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 revision = '-1'
170 if git.found()
171         ret = run_command(git, 'rev-parse', '--short', '--revs-only', 'HEAD', check: false)
172         if ret.returncode() == 0
173                 revision = ret.stdout().strip()
174         endif
175 endif
176 cdata.set_quoted('REVISION', revision)
178 python_command = get_option('python-command')
179 if python_command == '' or python_command == 'auto'
180         if target_machine.system() == 'windows'
181                 python_command = 'py'
182         else
183                 python_command = 'python'
184         endif
185 endif
186 cdata.set('PYTHON_COMMAND', python_command)
188 configure_file(
189         output : 'config.h',
190         configuration : cdata
193 configure_file(
194         input: 'geany.pc.in',
195         install: true,
196         install_dir: join_paths(prefix, get_option('libdir'), 'pkgconfig'),
197         output: 'geany.pc',
198         configuration: pcconf
201 # CFLAGS for basic stuff that only depends on libc
202 basic_cflags  = [ '-DHAVE_CONFIG_H=1', '-O2' ]
203 if (gnu_source)
204         basic_cflags += '-D_GNU_SOURCE'
205 endif
207 # CFLAGS common between Geany and bundled plugins
208 def_cflags = basic_cflags + [
209         '-DGTK',
210 # we're using lots of deprecated stuff with gtk3 (often because there is no proper alternative!)
211         '-Wno-deprecated-declarations',
212         '-DGDK_DISABLE_DEPRECATION_WARNINGS',
213         '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32',
214         '-DGEANY_PREFIX="@0@"'.format(get_option('prefix')),
215         '-DGEANY_DOCDIR="@0@"'.format(join_paths(prefix, get_option('datadir'), 'doc'))
217 foreach d : [ 'includedir', 'libdir', 'libexecdir', 'datadir', 'localedir' ]
218         def_cflags += '-DGEANY_@0@="@1@"'.format(d.underscorify().to_upper(), join_paths(prefix, get_option(d)))
219 endforeach
221 # CFLAGS for everything else, i.e. most of Geany
222 geany_cflags = def_cflags
223 have_gcc4_visibility = cc.has_argument('-fvisibility=hidden')
224 geany_cflags += '-DGEANY_PRIVATE'
225 if target_machine.system() == 'windows'
226         geany_cflags += '-DGEANY_EXPORT_SYMBOL=__declspec(dllexport)'
227 elif have_gcc4_visibility
228         geany_cflags += '-fvisibility=hidden'
229         geany_cflags += '-DGEANY_EXPORT_SYMBOL=__attribute__((visibility("default")))'
230 endif
231 geany_cflags += '-DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL'
232 sci_cflags = geany_cflags
233 sci_cflags += [ '-std=c++17', '-Wno-non-virtual-dtor', '-DNDEBUG', '-DSCI_LEXER', '-DNO_CXX11_REGEX' ]
235 iregex = include_directories('ctags/gnu_regex')
236 ifnmatch = include_directories('ctags/fnmatch')
237 ictags = include_directories('ctags/main', 'ctags/parsers', 'ctags/dsl')
238 itagmanager = include_directories('src/tagmanager')
239 iscintilla = include_directories('scintilla/include', 'scintilla/lexilla/include')
240 igeany = include_directories('src')
242 install_headers(
243         'scintilla/include/Scintilla.h',
244         'scintilla/include/Scintilla.iface',
245         'scintilla/include/ScintillaWidget.h',
246         'scintilla/include/Sci_Position.h',
247         'scintilla/lexilla/include/SciLexer.h',
248         subdir: 'geany/scintilla'
251 lexilla = static_library('lexilla',
252         'scintilla/lexilla/include/Lexilla.h',
253         'scintilla/lexilla/include/SciLexer.h',
254         'scintilla/lexilla/lexers/LexAbaqus.cxx',
255         'scintilla/lexilla/lexers/LexAda.cxx',
256         'scintilla/lexilla/lexers/LexAsciidoc.cxx',
257         'scintilla/lexilla/lexers/LexAsm.cxx',
258         'scintilla/lexilla/lexers/LexAU3.cxx',
259         'scintilla/lexilla/lexers/LexBash.cxx',
260         'scintilla/lexilla/lexers/LexBasic.cxx',
261         'scintilla/lexilla/lexers/LexBatch.cxx',
262         'scintilla/lexilla/lexers/LexCaml.cxx',
263         'scintilla/lexilla/lexers/LexCmake.cxx',
264         'scintilla/lexilla/lexers/LexCOBOL.cxx',
265         'scintilla/lexilla/lexers/LexCoffeeScript.cxx',
266         'scintilla/lexilla/lexers/LexCPP.cxx',
267         'scintilla/lexilla/lexers/LexCSS.cxx',
268         'scintilla/lexilla/lexers/LexD.cxx',
269         'scintilla/lexilla/lexers/LexDiff.cxx',
270         'scintilla/lexilla/lexers/LexErlang.cxx',
271         'scintilla/lexilla/lexers/LexForth.cxx',
272         'scintilla/lexilla/lexers/LexGDScript.cxx',
273         'scintilla/lexilla/lexers/LexFortran.cxx',
274         'scintilla/lexilla/lexers/LexHaskell.cxx',
275         'scintilla/lexilla/lexers/LexHTML.cxx',
276         'scintilla/lexilla/lexers/LexJulia.cxx',
277         'scintilla/lexilla/lexers/LexLaTeX.cxx',
278         'scintilla/lexilla/lexers/LexLisp.cxx',
279         'scintilla/lexilla/lexers/LexLua.cxx',
280         'scintilla/lexilla/lexers/LexMake.cxx',
281         'scintilla/lexilla/lexers/LexMarkdown.cxx',
282         'scintilla/lexilla/lexers/LexMatlab.cxx',
283         'scintilla/lexilla/lexers/LexNsis.cxx',
284         'scintilla/lexilla/lexers/LexNull.cxx',
285         'scintilla/lexilla/lexers/LexPascal.cxx',
286         'scintilla/lexilla/lexers/LexPerl.cxx',
287         'scintilla/lexilla/lexers/LexPO.cxx',
288         'scintilla/lexilla/lexers/LexPowerShell.cxx',
289         'scintilla/lexilla/lexers/LexProps.cxx',
290         'scintilla/lexilla/lexers/LexPython.cxx',
291         'scintilla/lexilla/lexers/LexR.cxx',
292         'scintilla/lexilla/lexers/LexRuby.cxx',
293         'scintilla/lexilla/lexers/LexRust.cxx',
294         'scintilla/lexilla/lexers/LexSmalltalk.cxx',
295         'scintilla/lexilla/lexers/LexSQL.cxx',
296         'scintilla/lexilla/lexers/LexTCL.cxx',
297         'scintilla/lexilla/lexers/LexTxt2tags.cxx',
298         'scintilla/lexilla/lexers/LexVerilog.cxx',
299         'scintilla/lexilla/lexers/LexVHDL.cxx',
300         'scintilla/lexilla/lexers/LexYAML.cxx',
301         'scintilla/lexilla/lexlib/Accessor.cxx',
302         'scintilla/lexilla/lexlib/Accessor.h',
303         'scintilla/lexilla/lexlib/CatalogueModules.h',
304         'scintilla/lexilla/lexlib/CharacterCategory.cxx',
305         'scintilla/lexilla/lexlib/CharacterCategory.h',
306         'scintilla/lexilla/lexlib/CharacterSet.cxx',
307         'scintilla/lexilla/lexlib/CharacterSet.h',
308         'scintilla/lexilla/lexlib/DefaultLexer.cxx',
309         'scintilla/lexilla/lexlib/DefaultLexer.h',
310         'scintilla/lexilla/lexlib/LexAccessor.cxx',
311         'scintilla/lexilla/lexlib/LexAccessor.h',
312         'scintilla/lexilla/lexlib/LexerBase.cxx',
313         'scintilla/lexilla/lexlib/LexerBase.h',
314         'scintilla/lexilla/lexlib/LexerModule.cxx',
315         'scintilla/lexilla/lexlib/LexerModule.h',
316         'scintilla/lexilla/lexlib/LexerNoExceptions.cxx',
317         'scintilla/lexilla/lexlib/LexerNoExceptions.h',
318         'scintilla/lexilla/lexlib/LexerSimple.cxx',
319         'scintilla/lexilla/lexlib/LexerSimple.h',
320         'scintilla/lexilla/lexlib/OptionSet.h',
321         'scintilla/lexilla/lexlib/PropSetSimple.cxx',
322         'scintilla/lexilla/lexlib/PropSetSimple.h',
323         'scintilla/lexilla/lexlib/SparseState.h',
324         'scintilla/lexilla/lexlib/StringCopy.h',
325         'scintilla/lexilla/lexlib/StyleContext.cxx',
326         'scintilla/lexilla/lexlib/StyleContext.h',
327         'scintilla/lexilla/lexlib/SubStyles.h',
328         'scintilla/lexilla/lexlib/WordList.cxx',
329         'scintilla/lexilla/lexlib/WordList.h',
330         'scintilla/lexilla/src/Lexilla.cxx',
331         cpp_args: sci_cflags,
332         dependencies: deps,
333         include_directories: [
334                 iscintilla,
335                 include_directories('scintilla/lexilla/lexlib', 'scintilla/lexilla/include')
336         ]
338 dep_lexilla = declare_dependency(
339         link_with: lexilla,
340         include_directories: include_directories('scintilla/lexilla/include')
343 scintilla = static_library('scintilla',
344         'scintilla/gtk/Converter.h',
345         'scintilla/gtk/PlatGTK.cxx',
346         'scintilla/gtk/ScintillaGTKAccessible.cxx',
347         'scintilla/gtk/ScintillaGTKAccessible.h',
348         'scintilla/gtk/ScintillaGTK.cxx',
349         'scintilla/gtk/ScintillaGTK.h',
350         'scintilla/gtk/scintilla-marshal.c',
351         'scintilla/gtk/scintilla-marshal.h',
352         'scintilla/gtk/Wrappers.h',
353         'scintilla/include/ILexer.h',
354         'scintilla/include/ILoader.h',
355         'scintilla/include/ScintillaCall.h',
356         'scintilla/include/Scintilla.h',
357         'scintilla/include/ScintillaMessages.h',
358         'scintilla/include/ScintillaStructures.h',
359         'scintilla/include/ScintillaTypes.h',
360         'scintilla/include/ScintillaWidget.h',
361         'scintilla/include/Sci_Position.h',
362         'scintilla/src/AutoComplete.cxx',
363         'scintilla/src/AutoComplete.h',
364         'scintilla/src/CallTip.cxx',
365         'scintilla/src/CallTip.h',
366         'scintilla/src/CaseConvert.cxx',
367         'scintilla/src/CaseConvert.h',
368         'scintilla/src/CaseFolder.cxx',
369         'scintilla/src/CaseFolder.h',
370         'scintilla/src/CellBuffer.cxx',
371         'scintilla/src/CellBuffer.h',
372         'scintilla/src/ChangeHistory.cxx',
373         'scintilla/src/ChangeHistory.h',
374         'scintilla/src/CharacterCategoryMap.cxx',
375         'scintilla/src/CharacterCategoryMap.h',
376         'scintilla/src/CharacterType.cxx',
377         'scintilla/src/CharacterType.h',
378         'scintilla/src/CharClassify.cxx',
379         'scintilla/src/CharClassify.h',
380         'scintilla/src/ContractionState.cxx',
381         'scintilla/src/ContractionState.h',
382         'scintilla/src/DBCS.cxx',
383         'scintilla/src/DBCS.h',
384         'scintilla/src/Debugging.h',
385         'scintilla/src/Decoration.cxx',
386         'scintilla/src/Decoration.h',
387         'scintilla/src/Document.cxx',
388         'scintilla/src/Document.h',
389         'scintilla/src/EditModel.cxx',
390         'scintilla/src/EditModel.h',
391         'scintilla/src/Editor.cxx',
392         'scintilla/src/Editor.h',
393         'scintilla/src/EditView.cxx',
394         'scintilla/src/EditView.h',
395         'scintilla/src/ElapsedPeriod.h',
396         'scintilla/src/FontQuality.h',
397         'scintilla/src/Geometry.cxx',
398         'scintilla/src/Geometry.h',
399         'scintilla/src/Indicator.cxx',
400         'scintilla/src/Indicator.h',
401         'scintilla/src/KeyMap.cxx',
402         'scintilla/src/KeyMap.h',
403         'scintilla/src/LineMarker.cxx',
404         'scintilla/src/LineMarker.h',
405         'scintilla/src/MarginView.cxx',
406         'scintilla/src/MarginView.h',
407         'scintilla/src/Partitioning.h',
408         'scintilla/src/PerLine.cxx',
409         'scintilla/src/PerLine.h',
410         'scintilla/src/Platform.h',
411         'scintilla/src/PositionCache.cxx',
412         'scintilla/src/PositionCache.h',
413         'scintilla/src/Position.h',
414         'scintilla/src/RESearch.cxx',
415         'scintilla/src/RESearch.h',
416         'scintilla/src/RunStyles.cxx',
417         'scintilla/src/RunStyles.h',
418         'scintilla/src/ScintillaBase.cxx',
419         'scintilla/src/ScintillaBase.h',
420         'scintilla/src/Selection.cxx',
421         'scintilla/src/Selection.h',
422         'scintilla/src/SparseVector.h',
423         'scintilla/src/SplitVector.h',
424         'scintilla/src/Style.cxx',
425         'scintilla/src/Style.h',
426         'scintilla/src/UniConversion.cxx',
427         'scintilla/src/UniConversion.h',
428         'scintilla/src/UniqueString.cxx',
429         'scintilla/src/UniqueString.h',
430         'scintilla/src/ViewStyle.cxx',
431         'scintilla/src/ViewStyle.h',
432         'scintilla/src/XPM.cxx',
433         'scintilla/src/XPM.h',
434         cpp_args: sci_cflags,
435         dependencies: deps + [ dep_lexilla ],
436         include_directories: [
437                 iscintilla,
438                 include_directories('scintilla/include', 'scintilla/src')
439         ]
441 dep_scintilla = declare_dependency(
442         link_with: scintilla,
443         include_directories: include_directories('scintilla/include')
446 if cdata.get('HAVE_FNMATCH') == 1
447         dep_fnmatch = dependency('', required: false)
448 else
449         # use fnmatch bundled with ctags
450         fnmatch = static_library('fnmatch',
451                 'ctags/fnmatch/fnmatch.c',
452                 'ctags/fnmatch/fnmatch.h',
453                 include_directories: [ifnmatch],
454                 c_args: basic_cflags
455         )
456         dep_fnmatch = declare_dependency(link_with: [fnmatch], include_directories: [ifnmatch])
457 endif
459 if cdata.get('HAVE_REGCOMP') == 1
460         dep_regex = dependency('', required: false)
461 else
462         # use regcomp bundled with ctags
463         regex = static_library('regex',
464                 'ctags/gnu_regex/regex.c',
465                 'ctags/gnu_regex/regex.h',
466                 dependencies: [dep_fnmatch],
467                 c_args: basic_cflags + [ '-D__USE_GNU' ]
468         )
469         dep_regex = declare_dependency(link_with: [regex], include_directories: [iregex])
470 endif
472 ctags = static_library('ctags',
473         'ctags/dsl/es.c',
474         'ctags/dsl/es.h',
475         'ctags/dsl/optscript.c',
476         'ctags/dsl/optscript.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