[gnome-calculator/60-split-out-a-backend-library: 11/47] gcalc: improved build
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator/60-split-out-a-backend-library: 11/47] gcalc: improved build
- Date: Fri, 4 Jan 2019 16:43:19 +0000 (UTC)
commit c9f2bd999e6fc29cc4fa4c9bafebc772859783f3
Author: Daniel Espinosa <esodan gmail com>
Date: Wed Dec 5 17:33:06 2018 -0600
gcalc: improved build
gcalc/meson.build | 37 ++++++++++++++++++++++++++++++++++---
gcalc/mpfr-glue.vala | 28 ++++++++++++++++++++++++++++
lib/meson.build | 4 ++--
lib/mpfr-glue.vala | 5 +++--
vapi/mpc.vapi | 4 ++--
5 files changed, 69 insertions(+), 9 deletions(-)
---
diff --git a/gcalc/meson.build b/gcalc/meson.build
index 02708877..64ab6b71 100644
--- a/gcalc/meson.build
+++ b/gcalc/meson.build
@@ -41,11 +41,37 @@ configure_file(output : 'config.h',
sources = files([
'gcalc-solver.vala',
'gcalc-result.vala'
- ])
+])
+
inc_libh = include_directories ('.')
inc_libh_dep = declare_dependency (include_directories : inc_libh)
+deps = [
+ gio,
+ namespaceinfo_dep,
+ inc_libh_dep,
+ inc_rooth_dep,
+]
+
+
+
+lib_mpfrg_sources = files([
+ 'mpfr-glue.vala'
+])
+
+lib_mpfrg = static_library ('mpfrg',
+ lib_mpfrg_sources,
+ vala_header: 'mpfrg.h',
+ vala_vapi: 'mpfrg.vapi',
+ dependencies: [
+ gio,
+ mpc,
+ mpfr,
+ ],
+ install: false,
+)
+
# LT_VERSION for ABI related changes
# From: https://autotools.io/libtool/version.html
# This rules applies to Meson 0.43
@@ -65,11 +91,16 @@ lib = library(VERSIONED_PROJECT_NAME,
vala_header : PROJECT_NAME+'.h',
vala_vapi : VAPI_NAME,
vala_gir : GIR_NAME,
- dependencies : [ gio, namespaceinfo_dep, inc_libh_dep, inc_rooth_dep ],
+ dependencies : deps,
+ vala_args: [
+ '--vapidir='+vapi_dir,
+ '--pkg=mpfr'
+ ],
c_args : [
'-include',
- meson.current_build_dir() + '/config.h'
+ meson.current_build_dir() + '/config.h',
],
+ link_with: [ lib_mpfrg ],
install : true,
install_dir : [
true,
diff --git a/gcalc/mpfr-glue.vala b/gcalc/mpfr-glue.vala
new file mode 100644
index 00000000..9e801748
--- /dev/null
+++ b/gcalc/mpfr-glue.vala
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2016 Phillip Wood <phillip wood dunelm org uk>
+ *
+ * GNOME Calculator - mpfr-glue.vala
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Phillip Wood <phillip wood dunelm org uk>
+ */
+
+namespace MPFRG
+{
+ [Compact]
+ public class RealRef {
+ public MPFR.Real val;
+ }
+}
diff --git a/lib/meson.build b/lib/meson.build
index bc1b9792..ffbe3f3f 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,4 +1,4 @@
-libcalculator_sources = [
+libcalculator_sources = files ([
'mpfr-glue.vala',
'currency.vala',
'equation.vala',
@@ -12,7 +12,7 @@ libcalculator_sources = [
'number.vala',
'serializer.vala',
'unit.vala',
-]
+])
libcalculator_vala_flags = [
'--target-glib', glib_min_version,
diff --git a/lib/mpfr-glue.vala b/lib/mpfr-glue.vala
index e52c0f6f..cea34916 100644
--- a/lib/mpfr-glue.vala
+++ b/lib/mpfr-glue.vala
@@ -18,11 +18,12 @@
*
* Authors: Phillip Wood <phillip wood dunelm org uk>
*/
+using MPFR;
-namespace MPFR
+namespace MPFRG
{
[Compact]
public class RealRef {
- public MPFR.Real val;
+ public Real val;
}
}
diff --git a/vapi/mpc.vapi b/vapi/mpc.vapi
index d34521bb..985da93b 100644
--- a/vapi/mpc.vapi
+++ b/vapi/mpc.vapi
@@ -66,9 +66,9 @@ namespace MPC {
[CCode (cname="mpc_set_d_d")]
public int set_double (double re, double im = 0, Round rnd = Round.NEAREST);
[CCode (cname="mpc_realref")]
- public unowned MPFR.RealRef get_real ();
+ public unowned MPFRG.RealRef get_real ();
[CCode (cname="mpc_imagref")]
- public unowned MPFR.RealRef get_imag ();
+ public unowned MPFRG.RealRef get_imag ();
public bool is_zero () { var res = cmp_si_si (0, 0); return inex_re (res) == 0 && inex_im (res) ==
0; }
public bool is_equal (Complex c) { var res = cmp (c); return inex_re (res) == 0 && inex_im (res) ==
0; }
public int cmp (Complex op2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]