File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 11use std:: env;
22
3+ // backtrace-rs requires a feature check on Android targets, so
4+ // we need to run its build.rs as well. Note that we use an
5+ // include! rather than #[path = ""] because backtrace-rs's main
6+ // function is private.
7+ #[ allow( unused_extern_crates) ]
8+ mod backtrace_rs_build_rs {
9+ include ! ( "../backtrace/build.rs" ) ;
10+
11+ #[ inline]
12+ pub fn call_main ( ) {
13+ main ( ) ;
14+ }
15+ }
16+
317fn main ( ) {
418 println ! ( "cargo:rerun-if-changed=build.rs" ) ;
519 let target = env:: var ( "TARGET" ) . expect ( "TARGET was not set" ) ;
@@ -49,4 +63,6 @@ fn main() {
4963 }
5064 println ! ( "cargo:rustc-env=STD_ENV_ARCH={}" , env:: var( "CARGO_CFG_TARGET_ARCH" ) . unwrap( ) ) ;
5165 println ! ( "cargo:rustc-cfg=backtrace_in_libstd" ) ;
66+
67+ backtrace_rs_build_rs:: call_main ( ) ;
5268}
Original file line number Diff line number Diff line change 1+ // Used from backtrace-rs' build script to detect the value of the `__ANDROID_API__`
2+ // builtin #define
3+
4+ APIVERSION __ANDROID_API__
You can’t perform that action at this time.
0 commit comments