Skip to content

Commit

Permalink
build.rs: emit rerun-if-changed lines for compiled C/C++ code
Browse files Browse the repository at this point in the history
  • Loading branch information
rib committed Jul 30, 2023
1 parent a84a7b5 commit ab2606a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions android-activity/build.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
#![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")
.file("game-activity-csrc/game-activity/GameActivity.cpp")
.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")
Expand Down

0 comments on commit ab2606a

Please sign in to comment.