Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Commit ccb19e4

Browse files
Fixes unable to find static library when crate names have a hyphen.
1 parent 8e56c20 commit ccb19e4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cargo-apk/src/ops/build.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ fn build_manifest(
308308
.map_or(String::new(), |a| a.replace("\n", "\n "))
309309
);
310310

311-
// Buidling activity attributes
311+
// Build activity attributes
312312
let activity_attrs = format!(
313313
r#"
314314
android:name="android.app.NativeActivity"
@@ -406,7 +406,7 @@ fn build_makefiles(
406406
# Define module for static library built by rustc
407407
include $(CLEAR_VARS)
408408
LOCAL_MODULE := rustlib
409-
LOCAL_SRC_FILES := ../../../$(TARGET_ARCH_ABI)/build/lib{target_name}.a
409+
LOCAL_SRC_FILES := ../../../$(TARGET_ARCH_ABI)/build/lib{target_library_name}.a
410410
include $(PREBUILT_STATIC_LIBRARY)
411411
412412
# Build the application
@@ -421,6 +421,7 @@ NDK_LIBS_OUT := ./lib
421421
include $(BUILD_SHARED_LIBRARY)
422422
423423
$(call import-module,android/native_app_glue)"#,
424+
target_library_name = target.name().replace("-", "_"),
424425
target_name = target.name()
425426
)?;
426427

0 commit comments

Comments
 (0)