From 4ee544a88d54c9e83b0e80ca2d4172b9fa8c3800 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Wed, 30 Oct 2024 09:05:10 +0100 Subject: [PATCH] try better meson_config.rs handling --- .gitignore | 1 - meson.build | 1 + src/meson.build | 9 +-------- src/meson_config.rs | 1 + 4 files changed, 3 insertions(+), 9 deletions(-) create mode 100644 src/meson_config.rs diff --git a/.gitignore b/.gitignore index 0c91a83..2f7896d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ target/ -src/meson_config.rs diff --git a/meson.build b/meson.build index c87f414..5841d70 100644 --- a/meson.build +++ b/meson.build @@ -65,6 +65,7 @@ custom_target( build_by_default: true, build_always_stale: true, depends: [audrey_c, blueprints], + input: config_rs, console: true, # means nothing (always stale and uncopied), we can't cp since env: drops the /bin/sh wrapper output: meson.project_name(), diff --git a/src/meson.build b/src/meson.build index 6b60e1d..ad7aa18 100644 --- a/src/meson.build +++ b/src/meson.build @@ -22,18 +22,11 @@ audrey_deps = [ audrey_sources += removeme -configure_file( +config_rs = configure_file( output: 'meson_config.rs', input: 'meson_config.rs.in', configuration: config_h, ) -# awful hack to put the configured file back in source -run_command( - 'cp', - meson.project_build_root() / 'src' / 'meson_config.rs', - meson.project_source_root() / 'src' / 'meson_config.rs', - check: true, -) audrey_c = static_library( 'audrey', diff --git a/src/meson_config.rs b/src/meson_config.rs new file mode 100644 index 0000000..16ff09c --- /dev/null +++ b/src/meson_config.rs @@ -0,0 +1 @@ +include!(concat!(env!("MESON_BUILD_ROOT"), "/src/meson_config.rs"));