From ab2606a73d85b00ec86ff2eafae28c1516aea86b Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 22 Jul 2023 18:09:18 +0100 Subject: [PATCH] build.rs: emit rerun-if-changed lines for compiled C/C++ code --- android-activity/build.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/android-activity/build.rs b/android-activity/build.rs index 6b08f62..110859b 100644 --- a/android-activity/build.rs +++ b/android-activity/build.rs @@ -1,6 +1,12 @@ #![allow(dead_code)] fn build_glue_for_game_activity() { + for f in [ + "GameActivity.h", + "GameActivity.cpp", + ] { + println!("cargo:rerun-if-changed=game-activity-csrc/game-activity/{f}"); + } cc::Build::new() .cpp(true) .include("game-activity-csrc") @@ -8,12 +14,20 @@ fn build_glue_for_game_activity() { .extra_warnings(false) .cpp_link_stdlib("c++_static") .compile("libgame_activity.a"); + + for f in ["gamecommon.h", "gametextinput.h", "gametextinput.cpp"] { + println!("cargo:rerun-if-changed=game-activity-csrc/game-text-input/{f}"); + } cc::Build::new() .cpp(true) .include("game-activity-csrc") .file("game-activity-csrc/game-text-input/gametextinput.cpp") .cpp_link_stdlib("c++_static") .compile("libgame_text_input.a"); + + for f in ["android_native_app_glue.h", "android_native_app_glue.c"] { + println!("cargo:rerun-if-changed=game-activity-csrc/native_app_glue/{f}"); + } cc::Build::new() .include("game-activity-csrc") .include("game-activity-csrc/game-activity/native_app_glue")