Skip to content

Commit d35fa2d

Browse files
committed
Explicitly define __ANDROID_API__ when the api level is provided.
Signed-off-by: Josh Matthews <[email protected]>
1 parent c62fe31 commit d35fa2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mozjs-sys/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ fn build(build_dir: &Path, target: BuildTarget) {
262262
build.flag_if_supported(flag);
263263
}
264264

265+
if let Ok(android_api) = env::var("ANDROID_API_LEVEL").as_deref() {
266+
build.define("__ANDROID_API__", android_api);
267+
}
268+
265269
build.flag(include_file_flag(build.get_compiler().is_like_msvc()));
266270
build.flag(&js_config_path(build_dir));
267271

0 commit comments

Comments
 (0)