From 0d7c74fb805837c30c60fa14ade7c42eedfdef16 Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 9 Dec 2025 21:10:55 +0100 Subject: Add Meson build system This adds a familiar and simple method to build, test and run the software of this repository. --- .gitignore | 1 + homematic/meson.build | 4 ++++ meson.build | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .gitignore create mode 100644 homematic/meson.build create mode 100644 meson.build diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/homematic/meson.build b/homematic/meson.build new file mode 100644 index 0000000..5a35437 --- /dev/null +++ b/homematic/meson.build @@ -0,0 +1,4 @@ +homematic = [ + meson.current_source_dir() / 'xmlrpc.go', + meson.current_source_dir() / 'device.go', +] diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..4de00bd --- /dev/null +++ b/meson.build @@ -0,0 +1,37 @@ +project('homematic-go') + +go = find_program('go', required : true) + +subdir('homematic') + +homematic_go = custom_target( + input : [ + meson.current_source_dir() / 'main.go', + ], + output : 'homematic-go', + command : [ + go, + 'build', + '-o', + '@OUTPUT@', + '@INPUT@', + ], + depend_files : [ + homematic, + ], + build_by_default : true, +) + +run_target( + 'run', + command : [ + homematic_go, + ], +) + +test( + 'unit-tests', + go, + args: ['test', './...'], + workdir: meson.current_source_dir() +) -- cgit v1.2.3-70-g09d2