Commit 9991f289 authored by Kjell Ahlstedt's avatar Kjell Ahlstedt

Add meson.build files and auxiliary scripts for meson builds

This is experimental and incomplete, but hopefully useful.
See the README file for instructions how to use it.
parent 29aa097a
This is the documentation for gtkmm, a C++ API for GTK+.
This is the documentation for gtkmm, a C++ API for GTK.
See http://www.gtkmm.org/
Building with meson
-------------------
This is experimental and incomplete.
Use autotools for production builds.
Create a build directory:
$ cd gtkmm-documentation
$ meson <build-dir>
Do not call the build-dir gtkmm-documenation/build. There is already such a
directory, used when building with autotools.
Create the html files of the tutorial:
$ cd <build-dir>
$ ninja
Install them:
$ ninja install
Build the example programs:
$ ninja examples
Print a list of configuration options:
$ meson configure
Example of changing options:
$ meson configure --prefix=/opt/gnome -Dwarnings=fatal
Make a tarball:
$ ninja dist
This tarball is not identical to one made with "make dist" or "make distcheck".
There is e.g. no "configure" file. If you want to use a tarball made with
"ninja dist" for building with autotools, you have to start with ./autogen.sh.
# docs/tutorial
# input: gtkmm_datadir, gtkmm_pcname, tutorial_custom_cmd_sh
# output: tutorial_languages
xsltproc = find_program('xsltproc', required: true)
perl = find_program('perl', required: true)
xmllint = find_program('xmllint', required: false)
can_build_translations = find_program('msgfmt', required: false).found() and \
find_program('itstool', required: false).found()
build_translations_by_default = get_option('build-translations')
tutorial_languages = ['cs', 'de', 'el', 'es', 'fr', 'pt_BR', 'sl', 'zh_CN']
# Installation directories
tutorialdir = join_paths(gtkmm_datadir, 'doc', gtkmm_pcname, 'tutorial')
tutorial_htmldir = join_paths(tutorialdir, 'html')
tutorial_figuresdir = join_paths(tutorial_htmldir, 'figures')
tutorial_iconsdir = join_paths(tutorial_htmldir, 'icons')
tutorial_figurefiles = [
'aspectframe.png',
'assistant.png',
'box_packing1.png',
'box_packing2.png',
'box_packing3.png',
'buildapp_app_menu.png',
'buildapp_header_bar.png',
'buildapp_opening_files.png',
'buildapp_populating_window.png',
'buildapp_pref_dialog.png',
'buildapp_properties.png',
'buildapp_search_bar.png',
'buildapp_side_bar.png',
'buildapp_trivial_app.png',
'buttons.png',
'cairo_clock.png',
'cairo_joins.png',
'checkbutton.png',
'clipboard_ideal.png',
'clipboard_simple.png',
'combo.png',
'combobox_complex.png',
'combobox_text.png',
'comboboxentry_complex.png',
'comboboxentry_text.png',
'custom_container.png',
'custom_widget.png',
'dialogs_about.png',
'dialogs_colorchooserdialog.png',
'dialogs_filechooser.png',
'dialogs_fontchooserdialog.png',
'dialogs_messagedialog.png',
'dialogs_simple.png',
'drag_and_drop.png',
'drawingarea_arcs.png',
'drawingarea_curve.png',
'drawingarea_image.png',
'drawingarea_lines.png',
'drawingarea_pango_text.png',
'drawingarea_text.png',
'drawingarea_thin_lines.png',
'entry.png',
'entry_completion.png',
'entry_icon.png',
'entry_progress.png',
'expander.png',
'filechooserbutton.png',
'frame.png',
'grid.png',
'helloworld.png',
'helloworld2.png',
'idle.png',
'infobar.png',
'keyboardevents_simple.png',
'keyboardevents_propagation.png',
'label.png',
'main_menu.png',
'menu_popup.png',
'menus_and_toolbars.png',
'menus_menu.png',
'menus_menubar.png',
'multithread.png',
'notebook.png',
'paned.png',
'printing.png',
'progressbar.png',
'radiobuttons.png',
'range_widgets.png',
'recentfiles.png',
'scrolledwindow.png',
'spinbutton.png',
'textview.png',
'toolbar.png',
'tooltip.png',
'treeview_combo_renderer.png',
'treeview_draganddrop.png',
'treeview_editablecells.png',
'treeview_list.png',
'treeview_popup.png',
'treeview_tree.png',
'update_ui.png',
]
tutorial_figures = []
foreach f : tutorial_figurefiles
tutorial_figures += join_paths('C', 'figures', f)
endforeach
tutorial_iconfiles = [
'caution.png',
'home.png',
'important.png',
'next.png',
'note.png',
'prev.png',
'tip.png',
'up.png',
'warning.png',
]
tutorial_icons = []
foreach i : tutorial_iconfiles
tutorial_icons += join_paths('icons', i)
endforeach
# Set the use.id.as.filename param so that we don't use the chapter / section
# number as the filename, otherwise the url will change every time anything is
# re-ordered or inserted in the documentation
xslt_params = [
'--param', 'toc.section.depth', '1',
'--stringparam', 'html.stylesheet', 'style.css',
'--stringparam', 'admon.graphics', '1',
'--stringparam', 'admon.graphics.path', 'icons/',
'--stringparam', 'admon.graphics.extension', '.png',
'--stringparam', 'chunker.output.indent', 'yes',
'--stringparam', 'chunker.output.encoding', 'UTF-8',
'--stringparam', 'navig.graphics', 'yes',
'--stringparam', 'navig.graphics.extension', '.png',
'--stringparam', 'navig.graphics.path', 'icons/',
'--stringparam', 'toc.list.type', 'ul',
'--stringparam', 'use.id.as.filename', '1',
]
index_docbook = custom_target('index.docbook',
input: join_paths('C', 'index-in.docbook'),
output: 'index.docbook',
command: [
perl, '--',
join_paths(meson.current_source_dir(), 'insert_example_code.pl'),
join_paths(meson.source_root(), 'examples', 'book'),
'@INPUT@',
],
capture: true,
build_by_default: true
)
custom_target('html_index.html',
input: index_docbook,
output: 'html',
command: [
xsltproc,
xslt_params,
'-o', '@OUTPUT@/',
'--xinclude',
'--catalogs',
'http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl',
'@INPUT@',
],
build_by_default: true,
install: true,
install_dir: tutorialdir
)
if xmllint.found()
custom_target('C-xmllint',
input: index_docbook,
output: 'C_xmllint.stamp',
command: [
tutorial_custom_cmd_sh,
'xmllint',
'@INPUT@',
'@OUTPUT@'
],
build_by_default: true,
)
endif
if can_build_translations
foreach lang : tutorial_languages
po2mo = custom_target(lang + '-po2mo',
input: join_paths(lang, lang + '.po'),
output: lang + '_mo.stamp',
command: [
tutorial_custom_cmd_sh,
'po2mo',
lang,
meson.current_build_dir(),
'@INPUT@',
join_paths(meson.current_build_dir(), lang, lang + '.mo'),
'@OUTPUT@'
],
build_by_default: build_translations_by_default,
)
lang_index_docbook = custom_target(lang + '-index.docbook',
input: [po2mo, index_docbook],
output: lang + '_docbook.stamp',
command: [
tutorial_custom_cmd_sh,
'docbook',
join_paths(meson.current_build_dir(), lang, lang + '.mo'),
'@INPUT1@',
join_paths(meson.current_build_dir(), lang),
'@OUTPUT@'
],
build_by_default: build_translations_by_default,
)
if xmllint.found()
custom_target(lang + '-xmllint',
input: lang_index_docbook,
output: lang + '_xmllint.stamp',
command: [
tutorial_custom_cmd_sh,
'xmllint',
join_paths(meson.current_build_dir(), lang, 'index.docbook'),
'@OUTPUT@'
],
build_by_default: build_translations_by_default,
)
endif
endforeach # lang
endif # can_build_translations
install_data('style.css', install_dir: tutorial_htmldir)
install_data(tutorial_figures, install_dir: tutorial_figuresdir)
install_data(tutorial_icons, install_dir: tutorial_iconsdir)
# examples/book/buildapp
# input: gnome, gtkmm_dep, build_examples_by_default, compile_schemas_sh,
# copy_to_subdir_sh
# input and output: examples_targets
exapp_main = ['exampleapplication.cc', 'exampleappwindow.cc', 'main.cc']
exapp_prefs = exapp_main + \
['exampleappprefs.cc', 'exampleapp.gresource.xml', 'org.gtkmm.exampleapp.gschema.xml']
examples_book_buildapp = [
# [[dir-name], exe-name, [sources]]
[['step1'], 'exampleapp', exapp_main],
[['step2'], 'exampleapp', exapp_main + ['exampleapp.gresource.xml']],
[['step3'], 'exampleapp', exapp_main + ['exampleapp.gresource.xml']],
[['step4'], 'exampleapp', exapp_main + ['exampleapp.gresource.xml']],
[['step5'], 'exampleapp', exapp_prefs],
[['step6'], 'exampleapp', exapp_prefs],
[['step7'], 'exampleapp', exapp_prefs],
[['step8'], 'exampleapp', exapp_prefs],
[['step9'], 'exampleapp', exapp_prefs],
]
glib_compile_schemas = find_program('glib-compile-schemas', required: false)
foreach ex : examples_book_buildapp
dir = ''
foreach dir_part : ex[0]
dir = join_paths(dir, dir_part)
endforeach
ex_name = join_paths(dir, ex[1]).underscorify()
ex_sources = []
resources = []
schemas = []
foreach src : ex[2]
if src.endswith('.gresource.xml')
resources = gnome.compile_resources(dir.underscorify() + '_resources',
join_paths(dir, src),
source_dir: dir
)
elif src.endswith('.gschema.xml')
if glib_compile_schemas.found()
schemas = custom_target(dir.underscorify() + '_schemas',
input: join_paths(dir, src),
output: dir.underscorify() + '_gschemas.compiled',
command: [
compile_schemas_sh,
dir,
meson.current_source_dir(),
meson.current_build_dir(),
'@OUTPUT@'
]
)
endif
else
ex_sources += join_paths(dir, src)
endif
endforeach
exe_file = executable(ex_name, ex_sources, resources, schemas,
dependencies: gtkmm_dep,
gui_app: true,
build_by_default: build_examples_by_default
)
stamp_file_name = ex_name + '_copy.stamp'
custom_target(stamp_file_name,
input: exe_file,
output: stamp_file_name,
command: [
copy_to_subdir_sh,
'@INPUT@',
dir,
ex[1],
'@OUTPUT@',
],
build_by_default: build_examples_by_default
)
examples_targets += join_paths('examples', 'book', 'buildapp', stamp_file_name)
endforeach
# examples/book/giomm
# input: gnome, giomm_dep, build_examples_by_default, copy_to_subdir_sh
# input and output: examples_targets
examples_book_giomm = [
# [[dir-name], exe-name, [sources]]
[['directory_list'], 'example', ['main.cc']],
[['getline'], 'example', ['getline.cc']],
[['monitor_directory'], 'monitor_directory', ['monitor_directory.cc']],
[['read_file'], 'example', ['main.cc']],
[['read_file_async'], 'example', ['main.cc']],
[['usage'], 'usage', ['usage.cc']],
[['volumes'], 'example', ['main.cc']],
[['write_file'], 'example', ['main.cc']],
]
foreach ex : examples_book_giomm
dir = ''
foreach dir_part : ex[0]
dir = join_paths(dir, dir_part)
endforeach
ex_name = join_paths(dir, ex[1]).underscorify()
ex_sources = []
resources = []
foreach src : ex[2]
if src.endswith('.gresource.xml')
resources = gnome.compile_resources(dir.underscorify() + '_resources',
join_paths(dir, src),
source_dir: dir
)
else
ex_sources += join_paths(dir, src)
endif
endforeach
exe_file = executable(ex_name, ex_sources, resources,
dependencies: giomm_dep,
build_by_default: build_examples_by_default
)
stamp_file_name = ex_name + '_copy.stamp'
custom_target(stamp_file_name,
input: exe_file,
output: stamp_file_name,
command: [
copy_to_subdir_sh,
'@INPUT@',
dir,
ex[1],
'@OUTPUT@',
],
build_by_default: build_examples_by_default
)
examples_targets += join_paths('examples', 'book', 'giomm', stamp_file_name)
endforeach
# examples/book
# input: gnome, gtkmm_dep, giomm_dep, build_examples_by_default,
# compile_schemas_sh, copy_to_subdir_sh, config_include_dir
# input and output: examples_targets
subdir('buildapp')
subdir('giomm')
subdir('treeview')
exwindow_main = ['examplewindow.cc', 'main.cc']
examples_book = [
# [[dir-name], exe-name, [sources]]
[['actionbar'], 'example', exwindow_main],
[['application', 'simple'], 'example', ['exampleapplication.cc'] + exwindow_main],
[['application', 'command_line_handling'], 'example', ['exampleapplication.cc'] + exwindow_main],
[['application', 'app_and_win_menus'], 'example', ['exampleapplication.cc'] + exwindow_main],
[['aspectframe'], 'example', exwindow_main],
[['assistant'], 'example', ['exampleassistant.cc'] + exwindow_main],
[['base'], 'base', ['base.cc']],
[['box'], 'example', exwindow_main + ['packbox.cc']],
[['builder', 'basic'], 'example', ['main.cc']],
[['builder', 'derived'], 'example', ['deriveddialog.cc', 'main.cc']],
[['buttons', 'button'], 'buttons', ['buttons.cc', 'main.cc']],
[['buttons', 'checkbutton'], 'example', exwindow_main],
[['buttons', 'filechooserbutton'], 'example', exwindow_main],
[['buttons', 'radiobutton'], 'radiobuttons', ['main.cc', 'radiobuttons.cc']],
[['buttons', 'scalebutton'], 'example', exwindow_main],
[['buttons', 'togglebutton'], 'example', exwindow_main],
[['buttons', 'volumebutton'], 'example', exwindow_main],
[['clipboard', 'ideal'], 'example', exwindow_main],
[['clipboard', 'simple'], 'example', exwindow_main],
[['combobox', 'complex'], 'example', exwindow_main],
[['combobox', 'text'], 'example', exwindow_main],
[['combobox', 'entry_complex'], 'example', exwindow_main],
[['combobox', 'entry_text'], 'example', exwindow_main],
[['custom', 'custom_container'], 'example', exwindow_main + ['mycontainer.cc']],
[['custom', 'custom_widget'], 'example', exwindow_main + ['myextrainit.cc', 'mywidget.cc']],
[['dialogs', 'aboutdialog'], 'example', exwindow_main + ['aboutdialog.gresource.xml']],
[['dialogs', 'colorchooserdialog'], 'example', exwindow_main],
[['dialogs', 'filechooserdialog'], 'example', exwindow_main],
[['dialogs', 'filechoosernative'], 'example', exwindow_main],
[['dialogs', 'fontchooserdialog'], 'example', exwindow_main],
[['dialogs', 'messagedialog'], 'example', exwindow_main],
[['dialogs', 'simple'], 'example', exwindow_main],
[['drag_and_drop'], 'drag_and_drop', ['dndwindow.cc', 'main.cc']],
[['drawingarea', 'arcs'], 'drawingareaarcs', ['main.cc', 'myarea.cc']],
[['drawingarea', 'clock'], 'cairoclock', ['clock.cc', 'main.cc']],
[['drawingarea', 'curve'], 'drawingareacurve', ['main.cc', 'myarea.cc']],
[['drawingarea', 'image'], 'drawingareaimage', ['main.cc', 'myarea.cc', 'image.gresource.xml']],
[['drawingarea', 'joins'], 'cairojoins', ['main.cc', 'myarea.cc']],
[['drawingarea', 'pango_text'], 'example', ['main.cc', 'myarea.cc']],
[['drawingarea', 'simple'], 'drawingarea', ['main.cc', 'myarea.cc']],
[['drawingarea', 'thin_lines'], 'example', exwindow_main + ['myarea.cc']],
[['entry', 'completion'], 'example', exwindow_main],
[['entry', 'icon'], 'example', exwindow_main],
[['entry', 'progress'], 'example', exwindow_main],
[['entry', 'simple'], 'example', exwindow_main],
[['expander'], 'example', exwindow_main],
[['flowbox'], 'example', exwindow_main],
[['frame'], 'example', exwindow_main],
[['headerbar'], 'example', exwindow_main],
[['grid'], 'example', exwindow_main],
[['helloworld'], 'helloworld', ['helloworld.cc', 'main.cc']],
[['helloworld2'], 'helloworld2', ['helloworld.cc', 'main.cc']],
[['iconview'], 'example', exwindow_main],
[['idle'], 'idle', ['idleexample.cc', 'main.cc']],
[['infobar'], 'example', exwindow_main],
[['input'], 'example', ['main.cc']],
[['keyboard_events', 'simple'], 'example', exwindow_main],
[['keyboard_events', 'propagation'], 'example', exwindow_main],
[['label'], 'example', exwindow_main],
[['listbox'], 'example', exwindow_main + ['examplerow.cc']],
[['listmodel'], 'example', exwindow_main + ['myobject.cc']],
[['menus', 'main_menu'], 'main_menu', ['exampleapplication.cc'] + exwindow_main],
[['menus', 'popup'], 'example', exwindow_main],
[['menus_and_toolbars'], 'example', exwindow_main + ['toolbar.gresource.xml']],
[['multithread'], 'example', exwindow_main + ['exampleworker.cc']],
[['notebook'], 'example', exwindow_main],
[['paned'], 'example', exwindow_main + ['messageslist.cc', 'messagetext.cc']],
[['popover'], 'example', exwindow_main],
[['printing', 'advanced'], 'example', exwindow_main + ['previewdialog.cc', 'printformoperation.cc']],
[['printing', 'simple'], 'example', exwindow_main + ['printformoperation.cc']],
[['progressbar'], 'example', exwindow_main],
[['range_widgets'], 'example', exwindow_main],
[['recent_files'], 'example', exwindow_main],
[['revealer'], 'example', exwindow_main],
[['scrolledwindow'], 'example', exwindow_main],
[['searchbar'], 'example', exwindow_main],
[['signals', 'custom'], 'example', ['client.cc', 'main.cc', 'server.cc']],
[['spinbutton'], 'example', exwindow_main],
[['timeout'], 'timeout', ['main.cc', 'timerexample.cc']],
[['toolbar'], 'example', exwindow_main],
[['tooltips'], 'example', exwindow_main],
[['update_ui'], 'example', exwindow_main],
]
thread_dep = dependency('threads')
foreach ex : examples_book
dir = ''
foreach dir_part : ex[0]
dir = join_paths(dir, dir_part)
endforeach
ex_name = join_paths(dir, ex[1]).underscorify()
ex_sources = []
resources = []
foreach src : ex[2]
if src.endswith('.gresource.xml')
resources = gnome.compile_resources(dir.underscorify() + '_resources',
join_paths(dir, src),
source_dir: dir
)
else
ex_sources += join_paths(dir, src)
endif
endforeach
# multi-threaded programs need thread support
deps = (ex[0][0] == 'multithread') ? [gtkmm_dep, thread_dep] : gtkmm_dep
exe_file = executable(ex_name, ex_sources, resources,
dependencies: deps,
gui_app: true,
include_directories: config_include_dir, # only input/example needs this
build_by_default: build_examples_by_default
)
stamp_file_name = ex_name + '_copy.stamp'
custom_target(stamp_file_name,
input: exe_file,
output: stamp_file_name,
command: [
copy_to_subdir_sh,
'@INPUT@',
dir,
ex[1],
'@OUTPUT@',
],
build_by_default: build_examples_by_default
)
examples_targets += join_paths('examples', 'book', stamp_file_name)
endforeach
# examples/book/treeview
# input: gnome, gtkmm_dep, build_examples_by_default,
# compile_schemas_sh, copy_to_subdir_sh
# input and output: examples_targets
exwindow_main = ['examplewindow.cc', 'main.cc']
examples_book = [
# [[dir-name], exe-name, [sources]]
[['combo_renderer'], 'example', exwindow_main],
[['drag_and_drop'], 'example', exwindow_main + ['treemodel_dnd.cc']],
[['editable_cells'], 'example', exwindow_main],
[['filter'], 'example', exwindow_main],
[['filter_modify'], 'example', exwindow_main],
[['list'], 'example', exwindow_main],
[['listviewtext'], 'example', exwindow_main],
[['modelsort'], 'example', exwindow_main],
[['popup'], 'example', exwindow_main + ['treeview_withpopup.cc']],
[['tree'], 'example', exwindow_main],
]
foreach ex : examples_book
dir = ''
foreach dir_part : ex[0]
dir = join_paths(dir, dir_part)
endforeach
ex_name = join_paths(dir, ex[1]).underscorify()
ex_sources = []
resources = []
foreach src : ex[2]
if src.endswith('.gresource.xml')
resources = gnome.compile_resources(dir.underscorify() + '_resources',
join_paths(dir, src),
source_dir: dir
)
else
ex_sources += join_paths(dir, src)
endif
endforeach
exe_file = executable(ex_name, ex_sources, resources,
dependencies: gtkmm_dep,
gui_app: true,
build_by_default: build_examples_by_default
)
stamp_file_name = ex_name + '_copy.stamp'
custom_target(stamp_file_name,
input: exe_file,
output: stamp_file_name,
command: [
copy_to_subdir_sh,
'@INPUT@',
dir,
ex[1],
'@OUTPUT@',
],
build_by_default: build_examples_by_default
)
examples_targets += join_paths('examples', 'book', 'treeview', stamp_file_name)
endforeach
# examples
# input: gnome, gtkmm_dep, giomm_dep, compile_schemas_sh, copy_to_subdir_sh,
# config_include_dir
build_examples_by_default = get_option('build-examples')
examples_targets = []
subdir('book')
subdir('others')
run_target('examples',
command: ['bash', '-c', 'cd ' + meson.build_root() + '; ' + meson.backend() + ' ' + ' '.join(examples_targets)]
)
# examples/others
# input: gnome, gtkmm_dep, build_examples_by_default, copy_to_subdir_sh
# input and output: examples_targets
examples_others = [
# [[dir-name], exe-name, [sources]]
[['arrow'], 'arrow', ['arrow.cc']],
[['calendar'], 'calendar', ['calendar.cc']],
[['cellrenderercustom'], 'cellrenderertoggle', ['cellrenderertoggle.cc']],
[['cellrenderercustom'], 'testpopup',
['cellrendererlist.cc', 'cellrendererpopup.cc', 'popupentry.cc', 'testpopup.cc']],
[['dnd'], 'testdnd', ['dndwindow.cc', 'main.cc']],
[['exception'], 'exceptiontest', ['exceptiontest.cc']],
[['idle'], 'idle', ['idle.cc']],
[['statusbar'], 'statusbar', ['statusbar.cc']],
[['tictactoe'], 'ttt_test', ['tictactoe.cc', 'ttt_test.cc']],
[['treemodelcustom'], 'example', ['exampletreemodel.cc', 'examplewindow.cc', 'main.cc']],
# Waiting for a gdk_cairo_region_from_surface():
# [['window'], 'wheelbarrow', ['wheelbarrow.cc']],
]
foreach ex : examples_others
dir = ''
foreach dir_part : ex[0]
dir = join_paths(dir, dir_part)
endforeach
ex_name = join_paths(dir, ex[1]).underscorify()
ex_sources = []
resources = []
foreach src : ex[2]
if src.endswith('.gresource.xml')
resources = gnome.compile_resources(dir.underscorify() + '_resources',
join_paths(dir, src),
source_dir: dir
)
else
ex_sources += join_paths(dir, src)
endif
endforeach
exe_file = executable(ex_name, ex_sources, resources,
dependencies: gtkmm_dep,
gui_app: true,
build_by_default: build_examples_by_default
)
stamp_file_name = ex_name + '_copy.stamp'
custom_target(stamp_file_name,
input: exe_file,
output: stamp_file_name,
command: [
copy_to_subdir_sh,
'@INPUT@',
dir,
ex[1],
'@OUTPUT@',
],
build_by_default: build_examples_by_default
)
examples_targets += join_paths('examples', 'others', stamp_file_name)
endforeach
# Building gtkmm-documentation with meson is experimental.
# Use autotools for production builds.
project('gtkmm-documentation', 'c', 'cpp',
version: '3.89.0',
default_options: [
'cpp_std=c++17'
],
meson_version: '>= 0.49.0',
license: 'GPLv2'
)
gtkmm_pcname = 'gtkmm-4.0'
gtkmm_dep = dependency(gtkmm_pcname, version: '>=3.93.0')
giomm_dep = dependency('giomm-2.62', version: '>=2.61.1')
gnome = import('gnome')
gtkmm_prefix = get_option('prefix')
gtkmm_datadir = join_paths(gtkmm_prefix, get_option('datadir'))
compile_schemas_sh = files(join_paths('tools', 'meson_aux', 'compile-schemas.sh'))
copy_to_subdir_sh = files(join_paths('tools', 'meson_aux', 'copy-to-subdir.sh'))
tutorial_custom_cmd_sh = files(join_paths('tools', 'meson_aux', 'tutorial-custom-cmd.sh'))
cpp_compiler = meson.get_compiler('cpp')
warning_level = get_option('warnings')
warning_flags = []
if warning_level == 'min'
warning_flags = [ '-Wall' ]
elif warning_level == 'max' or warning_level == 'fatal'
warning_flags = '-pedantic -Wall -Wextra -Wformat-security -Wsuggest-override -Wshadow -Wno-long-long'.split()
if warning_level == 'fatal'
warning_flags += [ '-Werror' ]
deprecations = 'G PANGO ATK GDK GDK_PIXBUF GTK GLIBMM GIOMM GDKMM ATKMM PANGOMM GTKMM SIGCXX'.split()
foreach d : deprecations
warning_flags += '-D@0@_DISABLED_DEPRECATED'.format(d)
endforeach
endif
endif
warning_flags = cpp_compiler.get_supported_arguments(warning_flags)
add_project_arguments(warning_flags, language: 'cpp')
# This fix is necessary to make examples/book/input/example compile.
# TODO: Improve it.
has_mkfifo = cpp_compiler.has_function('mkfifo')
conf_data = configuration_data()
conf_data.set('HAVE_MKFIFO', has_mkfifo)
conf_file = configure_file(
output: 'config.h',
configuration: conf_data
)
custom_target('build_config',
input: conf_file,
output: 'config.stamp',
command: [
copy_to_subdir_sh,
'@INPUT@',
'build',
'config.h',
'@OUTPUT@',
],
build_by_default: true
)
config_include_dir = include_directories('.')
# end of examples/book/input/example fix
subdir('docs/tutorial')
subdir('examples')
meson.add_dist_script(
join_paths('tools', 'meson_aux', 'extra-dist-cmd.sh'),
meson.current_build_dir(),
join_paths('meson-dist', meson.project_name() + '-' + meson.project_version()),