Skip to content

Commit

Permalink
Use ANDROID_NDK_ROOT instead of ANDROID_NDK_HOME (#448)
Browse files Browse the repository at this point in the history
ANDROID_NDK_ROOT seems to be the more common environment variable
nowadays.
  • Loading branch information
mrobinson committed May 16, 2024
1 parent 8603cbf commit 89121ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
targets: armv7-linux-androideabi
- name: Build
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
./android-build cargo build --target="armv7-linux-androideabi"
Expand Down
8 changes: 4 additions & 4 deletions android-build
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ def set_toolchain_binaries_in_env(toolchain_dir: str, env: Dict[str, str]):

def create_environment_for_build() -> Dict[str, str]:
env = os.environ.copy()
if "ANDROID_NDK_HOME" not in env:
raise Exception("Please set the ANDROID_NDK_HOME environment variable.")
if "ANDROID_NDK_ROOT" not in env:
raise Exception("Please set the ANDROID_NDK_ROOT environment variable.")

ndk_home_dir = env["ANDROID_NDK_HOME"]
ndk_home_dir = env["ANDROID_NDK_ROOT"]

# Check if the NDK version is 21
if not os.path.isfile(os.path.join(ndk_home_dir, 'source.properties')):
raise Exception(
"ANDROID_NDK should have file `source.properties`.\n" +
"The environment variable ANDROID_NDK_HOME may be set at a wrong path."
"The environment variable ANDROID_NDK_ROOT may be set at a wrong path."
)

with open(os.path.join(ndk_home_dir, 'source.properties'), encoding="utf8") as ndk_properties:
Expand Down
2 changes: 1 addition & 1 deletion mozjs-sys/makefile.cargo
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ifneq ($(HOST),$(TARGET))
# non-developer builds, but NDK r25c ships with only lld.
CONFIGURE_FLAGS += \
--without-system-zlib \
--with-android-ndk=$(ANDROID_NDK_HOME) \
--with-android-ndk=$(ANDROID_NDK_ROOT) \
--with-android-version=$(ANDROID_API_LEVEL) \
--enable-linker=lld \
$(NULL)
Expand Down

0 comments on commit 89121ff

Please sign in to comment.