commit 26693a06d61ef0aa1c2ea6b1462a6ee209665f10
parent f3947228c46bcd49b18f7e05a85a9a3767086d24
Author: Fabian Wermelinger <fabianw@mavt.ethz.ch>
Date: Fri, 18 Dec 2020 20:39:12 +0100
Add meson build scripts
Diffstat:
6 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -2,3 +2,4 @@
*.bak
*.swp
*.swo
+/build
diff --git a/include/meson.build b/include/meson.build
@@ -0,0 +1,7 @@
+common_headers= [
+ 'common.h',
+ 'ArgumentParser.h',
+ 'GnuplotDump.h'
+ ]
+install_headers(common_headers)
+install_subdir('TimeStepper', install_dir : get_option('includedir'))
diff --git a/meson.build b/meson.build
@@ -0,0 +1,38 @@
+project('ode_toolbox', 'cpp',
+ version:
+ '1.0',
+ default_options: ['cpp_std=c++11']
+)
+
+deps = []
+cpp_args = ['-D_ALIGN_=16']
+if get_option('openmp')
+ deps += [dependency('openmp')]
+endif
+if get_option('precision') == 'single'
+ cpp_args += ['-D_FLOAT_PRECISION_']
+endif
+
+subdir('include')
+
+includes = include_directories('include')
+header_deps = declare_dependency(
+ include_directories: includes)
+lib_ode = library('ode_toolbox',
+ include_directories : includes,
+ install : true,
+ dependencies : deps,
+ cpp_args : cpp_args,
+)
+
+subdir('test')
+
+# Needed to be discoverable when installed.
+pkg_mod = import('pkgconfig')
+pkg_mod.generate(
+ name: 'ODE Toolbox',
+ filebase: 'ode_toolbox',
+ description: 'ODE integrator toolbox for C++',
+ libraries: lib_ode,
+)
+
diff --git a/meson_options.txt b/meson_options.txt
@@ -0,0 +1,2 @@
+option('openmp', type : 'boolean', value : true, description : 'OpenMP support', yield: true)
+option('precision', type : 'combo', choices : ['single', 'double'], value : 'double', description : 'Floating point precision', yield: true)
diff --git a/test/meson.build b/test/meson.build
@@ -0,0 +1 @@
+subdir('orderVerification')
diff --git a/test/orderVerification/meson.build b/test/orderVerification/meson.build
@@ -0,0 +1,3 @@
+executable('orderVerification', 'orderVerification.cpp',
+ dependencies: header_deps,
+ cpp_args: cpp_args)