Skip to content

Commit

Permalink
Upgrade CMake version for android builds
Browse files Browse the repository at this point in the history
Summary:
The Android SDK also ships with CMake 3.10.2. This lets us delete the
special case for it in our CMake files.

More importantly, we need the newer version of CMake in order to use
the prebuilt libfbjni.so from maven.

Reviewed By: tmikov

Differential Revision: D28791953

fbshipit-source-id: 11828d660350a497d189c3a5d95afb1c40470b01
  • Loading branch information
neildhar authored and facebook-github-bot committed Jun 2, 2021
1 parent 1986e4b commit dfef1ab
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- run:
name: Set up workspace and install dependencies
command: |
yes | sdkmanager "cmake;3.6.4111459" &
yes | sdkmanager "cmake;3.10.2.4988404" &
mkdir -p "$HERMES_WS_DIR" "$HERMES_WS_DIR/output"
ln -sf "$PWD" "$HERMES_WS_DIR/hermes"
sudo apt-get update
Expand All @@ -79,7 +79,7 @@ jobs:
sudo cp /usr/bin/ninja /usr/bin/ninja.real
# See top comment
printf '%s\n' '#!/bin/sh' 'ninja.real -j4 "$@" || ninja.real -j1 "$@"' | sudo tee /usr/bin/ninja
ln -sf /usr/bin/ninja /opt/android/sdk/cmake/3.6.4111459/bin/ninja
ln -sf /usr/bin/ninja /opt/android/sdk/cmake/3.10.2.4988404/bin/ninja
- run:
name: Build Hermes Compiler
command: |
Expand Down
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

if(NOT HERMES_IS_ANDROID)
# We need FindICU from 3.7
cmake_minimum_required(VERSION 3.7.0)
else()
# We'll be using ICU through Java, so we don't need FindICU.
# 3.6.0 is the minimum version shipped with the Android SDK.
cmake_minimum_required(VERSION 3.6.0)
endif()
cmake_minimum_required(VERSION 3.7.0)

# Set the VERSION variables based on the project command
if (POLICY CMP0048)
Expand Down
2 changes: 1 addition & 1 deletion android/cppruntime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {

externalNativeBuild {
cmake {
version "3.6.0"
version "3.10.2"
path "src/main/cpp/CMakeLists.txt"
buildStagingDirectory = "${rootProject.ext.hermes_ws}/staging/cppruntime"
buildStagingDirectory.mkdirs()
Expand Down
2 changes: 1 addition & 1 deletion android/cppruntime/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

cmake_minimum_required(VERSION 3.6.0)
cmake_minimum_required(VERSION 3.7.0)

add_library(stub SHARED stub.cpp)
2 changes: 1 addition & 1 deletion android/hermes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {

externalNativeBuild {
cmake {
version "3.6.0"
version "3.10.2"
path "../../CMakeLists.txt"
buildStagingDirectory = "${rootProject.ext.hermes_ws}/staging/hermes"
buildStagingDirectory.mkdirs()
Expand Down
2 changes: 1 addition & 1 deletion android/intltest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ android {

externalNativeBuild {
cmake {
version "3.6.0"
version "3.10.2"
path "../../CMakeLists.txt"
buildStagingDirectory = "${rootProject.ext.hermes_ws}/staging/intl"
buildStagingDirectory.mkdirs()
Expand Down

0 comments on commit dfef1ab

Please sign in to comment.