From 04b26d18765611b256c7d15568d7605412ffcd11 Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 3 Apr 2025 18:13:16 +0200 Subject: WIP: web: Add meson build system TODO: Make sure ninja re-calls hugo if hugo.toml or one of the HTML files are touched. CMake has some disadvantages when building subprojects like with `ExternalProject`. Furthermore the language is sometimes hard to read, hard to write and not so much appreciated. This is a little test if meson might perform better. If successful this project might switch to meson for all parts except the Zephyr builds. --- meson.build | 3 +++ web/layouts/meson.build | 12 ++++++++++++ web/meson.build | 21 +++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 meson.build create mode 100644 web/layouts/meson.build create mode 100644 web/meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..537d067 --- /dev/null +++ b/meson.build @@ -0,0 +1,3 @@ +project('iot-contact') + +subdir('web') diff --git a/web/layouts/meson.build b/web/layouts/meson.build new file mode 100644 index 0000000..e582474 --- /dev/null +++ b/web/layouts/meson.build @@ -0,0 +1,12 @@ +sources = [ + 'baseof.html', + 'home.html', +] + +foreach source : sources + configure_file( + input: source, + output: source, + copy: true, + ) +endforeach diff --git a/web/meson.build b/web/meson.build new file mode 100644 index 0000000..743aa77 --- /dev/null +++ b/web/meson.build @@ -0,0 +1,21 @@ +hugo_toml = 'hugo.toml' + +configure_file( + input: hugo_toml, + output: hugo_toml, + copy: true, +) + +subdir('layouts') + +custom_target('website', + output: ['public'], + command: [ + 'hugo', + '--source', + meson.current_build_dir(), + '--destination', + meson.current_build_dir() / 'public', + ], + build_by_default: true, +) -- cgit v1.2.3-70-g09d2