meson.build 2.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
dia_sources = [
    'confirm.c',
    'exit_dialog.c',
    'diagram.c',
    'preferences.c',
    'load_save.c',
    'properties-dialog.c',
    'defaults.c',
    'undo.c',
    'object_ops.c',
    'layer_dialog.c',
    'commands.c',
    'app_procs.c',
    'connectionpoint_ops.c',
    'disp_callbacks.c',
    'display.c',
    'select.c',
18 19
    'dia-colour-area.c',
    'dia-line-width-area.c',
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    'grid.c',
    'handle_ops.c',
    'interface.c',
    'toolbox.c',
    'modify_tool.c',
    'scroll_tool.c',
    'create_object.c',
    'magnify.c',
    'menus.c',
    'cut_n_paste.c',
    'ruler.c',
    'tool.c',
    'diapagelayout.c',
    'pagesetup.c',
    'filedlg.c',
    'find-and-replace.c',
    'plugin-manager.c',
    'dia-props.c',
    'gtkwrapbox.c',
    'gtkhwrapbox.c',
    'cursor.c',
    'splash.c',
    'recent_files.c',

    'dia-application.c',

    'diagram_tree_model.c',
    'diagram_tree_view.c',

    'sheets.c',
    'sheets_dialog.c',
    'sheets_dialog_callbacks.c',
    'autosave.c',
    'dynamic_refresh.c',
    'navigation.c',
    'highlight.c',
    'textedit.c',
    'textedit_tool.c',

    'main.c'
]

62
#TODO: this is workaround for openbsd where libraries are in /usr/lib/local
63 64
# Potential parent issues: https://github.com/mesonbuild/meson/issues/3570
# https://github.com/mesonbuild/meson/issues/4468
65 66 67 68 69 70 71 72
pkg_config = find_program('pkg-config')
pkg_config_libdir = run_command(pkg_config, '--libs-only-L', 'libxml-2.0').stdout().strip()

dia_link_args = []
if pkg_config_libdir != ''
    dia_link_args += pkg_config_libdir
endif

Eduard's avatar
Eduard committed
73 74
diaapp_inc = include_directories('.')

75 76 77 78
resources = gnome.compile_resources('dia-resources', 'dia.gresource.xml',
                                    source_dir : '.',
                                    c_name : 'dia')

79
diaapp = executable('dia',
Zander's avatar
Zander committed
80
    dia_sources + [resources, diamarshal_h, config_h],
Zander's avatar
Zander committed
81
    dependencies: [libgtk_dep, libxml_dep, libm_dep, libdia_dep],
82
    link_args: dia_link_args,
83
    export_dynamic: true,  # some plugins require this.
Zander's avatar
Zander committed
84
    include_directories: [configuration_inc],
85 86
    gui_app: true,
    install: true,
Eduard's avatar
Eduard committed
87
)
Eduard's avatar
Eduard committed
88 89 90 91 92 93 94 95 96 97 98

if build_machine.system() == 'windows'
    dia_win_remote = executable(
        'dia-win-remote',
        ['dia-win-remote.c'],
        dependencies: [libgtk_dep],
        link_args: ['-lshlwapi'],
        gui_app: true,
        install: true,
    )
endif