From 7cfd1e0d7843881407ba2ddb070e1315ffd6cb5f Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu, 2 Nov 2023 23:59:20 +0800 Subject: [PATCH] Rerun build script only when necessary --- build/syntax_mapping.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/syntax_mapping.rs b/build/syntax_mapping.rs index e06d97f7..73d2c04e 100644 --- a/build/syntax_mapping.rs +++ b/build/syntax_mapping.rs @@ -199,6 +199,8 @@ fn read_all_mappings() -> anyhow::Result { /// Build the static syntax mappings defined in /src/syntax_mapping/builtins/ /// into a .rs source file, which is to be inserted with `include!`. pub fn build_static_mappings() -> anyhow::Result<()> { + println!("cargo:rerun-if-changed=src/syntax_mapping/builtins/"); + let mappings = read_all_mappings()?; let codegen_path = Path::new(&env::var_os("OUT_DIR").ok_or(anyhow!("OUT_DIR is unset"))?)