blob: 8e8fe52e7634946149fadb135df4d058ce6d2e37 [file] [log] [blame]
Andrew Top193dc3d2019-01-23 09:57:23 -08001# Copyright 2016 The Cobalt Authors. All Rights Reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14"""Utilities to use the toolchain from the Android NDK."""
15
Andrew Top193dc3d2019-01-23 09:57:23 -080016import os
Andrew Top193dc3d2019-01-23 09:57:23 -080017from starboard.tools import build
18
Yavor Goulishev9c08e842020-04-29 14:03:33 -070019# Which version of the Android NDK and CMake to install and build with.
20# Note that build.gradle parses these out of this file too.
Kaido Kertb48d5d32023-06-30 09:59:25 -070021_NDK_VERSION = '25.2.9519653'
22_CMAKE_VERSION = '3.22.1'
Yavor Goulishev9c08e842020-04-29 14:03:33 -070023
Andrew Top193dc3d2019-01-23 09:57:23 -080024_STARBOARD_TOOLCHAINS_DIR = build.GetToolchainsDir()
25
26# The path to the Android SDK, if placed inside of starboard-toolchains.
27_STARBOARD_TOOLCHAINS_SDK_DIR = os.path.join(_STARBOARD_TOOLCHAINS_DIR,
28 'AndroidSdk')
29
30_ANDROID_HOME = os.environ.get('ANDROID_HOME')
31if _ANDROID_HOME:
Kaido Kertda45c042022-05-09 11:08:54 -070032 SDK_PATH = _ANDROID_HOME
Andrew Top193dc3d2019-01-23 09:57:23 -080033else:
Kaido Kertda45c042022-05-09 11:08:54 -070034 SDK_PATH = _STARBOARD_TOOLCHAINS_SDK_DIR