summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzhuyaliang <[email protected]>2021-07-25 11:52:47 +0800
committerraveit65 <[email protected]>2021-07-30 19:02:49 +0200
commit8dca108a6a4bed0b3411e41cb04b143c71036b67 (patch)
tree35632a66e2d50c89a690e5202a2e0ff56e7285b6 /src
parenta1216168706c08384154d3cea579d223fdc9e81d (diff)
downloadmate-calc-8dca108a6a4bed0b3411e41cb04b143c71036b67.tar.bz2
mate-calc-8dca108a6a4bed0b3411e41cb04b143c71036b67.tar.xz
Add build support for meson
Diffstat (limited to 'src')
-rw-r--r--src/meson.build120
-rw-r--r--src/utility.h1
2 files changed, 121 insertions, 0 deletions
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..bb183cd
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,120 @@
+src = []
+src_cmd = []
+test_mp_src = []
+test_mp_eq_src = []
+
+enums = []
+
+enums += gnome.mkenums('types',
+ sources: 'mp-serializer.h',
+ c_template: 'mp-enums.c.template',
+ h_template: 'mp-enums.h.template')
+
+ui_files = files(
+ 'buttons-advanced.ui',
+ 'buttons-basic.ui',
+ 'buttons-financial.ui',
+ 'preferences.ui'
+)
+
+ui_resources = gnome.compile_resources(
+ 'ui_resources',
+ 'org.mate.calculator.gresource.xml',
+ source_dir: 'src'
+)
+
+src += [
+ 'mate-calc.c',
+ 'currency-manager.c',
+ 'currency.c',
+ 'financial.c',
+ 'lexer.c',
+ 'math-buttons.c',
+ 'math-converter.c',
+ 'math-display.c',
+ 'math-equation.c',
+ 'math-history.c',
+ 'math-history-entry.c',
+ 'math-preferences.c',
+ 'math-variable-popup.c',
+ 'math-variables.c',
+ 'math-window.c',
+ 'mp-binary.c',
+ 'mp-convert.c',
+ 'mp-equation.c',
+ 'mp-trigonometric.c',
+ 'mp-serializer.c',
+ 'mp.c',
+ 'parser.c',
+ 'parserfunc.c',
+ 'prelexer.c',
+ 'unit-category.c',
+ 'unit-manager.c',
+ 'unit.c',
+ enums,
+ ui_resources
+]
+
+src_cmd += [
+ 'mate-calc-cmd.c',
+ 'currency.c',
+ 'currency-manager.c',
+ 'mp.c',
+ 'mp-binary.c',
+ 'mp-convert.c',
+ 'mp-equation.c',
+ 'mp-serializer.c',
+ 'mp-trigonometric.c',
+ 'unit.c',
+ 'unit-category.c',
+ 'unit-manager.c',
+ 'prelexer.c',
+ 'lexer.c',
+ 'parserfunc.c',
+ 'parser.c',
+ enums
+]
+
+test_mp_src += [
+ 'test-mp.c',
+ 'mp.c',
+ 'mp-convert.c',
+ 'mp-trigonometric.c'
+]
+
+test_mp_eq_src += [
+ 'test-mp-equation.c',
+ 'currency.c',
+ 'currency-manager.c',
+ 'mp.c',
+ 'mp-convert.c',
+ 'mp-binary.c',
+ enums,
+ 'mp-equation.c',
+ 'mp-serializer.c',
+ 'mp-trigonometric.c',
+ 'unit.c',
+ 'unit-category.c',
+ 'unit-manager.c',
+ 'prelexer.c',
+ 'lexer.c',
+ 'parserfunc.c',
+ 'parser.c',
+]
+
+executable('mate-calc', src, include_directories: top_inc,
+ dependencies : [gio, glib, gobject,gtk, libxml, mpc, mpfr],
+ link_args: '-rdynamic',
+ install : true,
+ install_dir : get_option('bindir'))
+
+executable('mate-calc-cmd', src_cmd, include_directories: top_inc,
+ dependencies : [gio, libxml, mpc, mpfr],
+ install : true,
+ install_dir : get_option('bindir'))
+
+executable('test-mp', test_mp_src, include_directories: top_inc,
+ dependencies : [gio, libxml, mpc, mpfr])
+
+executable('test-mp-equation', test_mp_eq_src, include_directories: top_inc,
+ dependencies: [gio, libxml, mpc, mpfr])
diff --git a/src/utility.h b/src/utility.h
index 91745ed..15d40b2 100644
--- a/src/utility.h
+++ b/src/utility.h
@@ -2,6 +2,7 @@
#define UTILITY_H
#include <glib/gi18n.h>
+#include "config.h"
extern GSettings *g_settings_var;