aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2018-05-19 19:17:47 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2018-05-19 19:17:47 +0200
commit75f5f3f34e32c35638743f0f5a68fc4e44316f54 (patch)
tree38a722fea4f2dc30c5602a1653e8984c333ad6e4
parent846e2c5c044f7fe23462fbc7a5ac703e350bed7a (diff)
downloadcross_clock-75f5f3f34e32c35638743f0f5a68fc4e44316f54.tar.xz
initial migration to meson.
-rw-r--r--.gitignore1
-rw-r--r--.gitlab-ci.yml60
-rw-r--r--README.md13
-rw-r--r--VERSION1
-rw-r--r--meson.build25
-rw-r--r--test/Makefile14
6 files changed, 99 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index df1022f..0000000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-test/cross_clock_test
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..817a610
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,60 @@
+stages:
+ - test
+
+.variables_template: &variables_definition
+ variables:
+ BASE_NAME: "cross_clock"
+ PKG_CONFIG_PATH: "/opt/lv2/lib/pkgconfig:/opt/${CI_BUILD_NAME}/lib/pkgconfig:/usr/lib/${CI_BUILD_NAME}/pkgconfig"
+
+.common_template: &common_definition
+ <<: *variables_definition
+ stage: test
+
+.build_template: &build_definition
+ <<: *common_definition
+ script:
+ - meson --cross-file "${CI_BUILD_NAME}" build
+ - ninja -C build
+
+.test_template: &test_definition
+ <<: *common_definition
+ script:
+ - meson --cross-file "${CI_BUILD_NAME}" build
+ - ninja -C build
+ - cd build
+ - meson test --verbose --wrap "${CI_BUILD_NAME}.wrap"
+
+.universal_linux_template: &universal_linux_definition
+ image: ventosus/universal-linux-gnu
+ <<: *test_definition
+
+.arm_linux_template: &arm_linux_definition
+ image: ventosus/arm-linux-gnueabihf
+ <<: *test_definition
+
+.universal_w64_template: &universal_w64_definition
+ image: ventosus/universal-w64-mingw32
+ <<: *test_definition
+
+.universal_apple_template: &universal_apple_definition
+ image: ventosus/universal-apple-darwin
+ <<: *build_definition
+
+# building in docker
+x86_64-linux-gnu:
+ <<: *universal_linux_definition
+
+i686-linux-gnu:
+ <<: *universal_linux_definition
+
+arm-linux-gnueabihf:
+ <<: *arm_linux_definition
+
+#x86_64-w64-mingw32:
+# <<: *universal_w64_definition
+#
+#i686-w64-mingw32:
+# <<: *universal_w64_definition
+
+universal-apple-darwin:
+ <<: *universal_apple_definition
diff --git a/README.md b/README.md
index 74a9f46..fddfddb 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,19 @@
## Crossplatform header-only library for clock\_gettime
+### Build Status
+
+[![build status](https://gitlab.com/OpenMusicKontrollers/cross_clock/badges/master/build.svg)](https://gitlab.com/OpenMusicKontrollers/cross_clock/commits/master)
+
+### Build / test
+
+ git clone https://git.open-music-kontrollers.ch/lad/cross_clock
+ cd cross_clock
+ meson build
+ cd build
+ ninja -j4
+ ninja test
+
### License
Copyright (c) 2018 Hanspeter Portner (dev@open-music-kontrollers.ch)
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..17e51c3
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.1.1
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..c6fa29a
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,25 @@
+project('cross_clock', 'c', default_options : [
+ 'buildtype=release',
+ 'warning_level=3',
+ 'werror=true',
+ 'b_lto=true',
+ 'c_std=c11'])
+
+version = run_command('cat', 'VERSION').stdout().strip()
+
+add_project_arguments('-D_GNU_SOURCE', language : 'c')
+
+conf_data = configuration_data()
+cc = meson.get_compiler('c')
+
+c_args = []
+deps = []
+
+test_cross_clock = executable('test_cross_clock',
+ join_paths('test', 'cross_clock_test.c'),
+ c_args : c_args,
+ dependencies : deps,
+ install : false)
+
+test('Test', test_cross_clock,
+ timeout : 180) # seconds
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644
index 97e856c..0000000
--- a/test/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-CC ?= clang
-
-TAR := cross_clock_test
-
-all: $(TAR)
-
-cross_clock_test: cross_clock_test.c ../cross_clock/cross_clock.h
- $(CC) -std=gnu11 -O0 -g -Wall -Wextra -Wpedantic -o $@ $< -I../
-
-test: cross_clock_test
- ./$<
-
-clean: $(TAR)
- rm $(TAR)