Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMake to 3.9 #837

Merged
merged 26 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
name: ARM (${{ matrix.arch }})
runs-on: ubuntu-22.04 # latest
strategy:
fail-fast: false
matrix:
arch: [armv6, armv7, arm64]
steps:
Expand Down Expand Up @@ -150,7 +151,6 @@ jobs:
raspberry:
runs-on: ubuntu-22.04 # latest
strategy:
fail-fast: false
matrix:
image:
- raspbian-bullseye
Expand Down
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.13)

project(aws-crt-jni C)
option(BUILD_DEPS "Builds aws common runtime dependencies as part of build" ON)
option(CRT_FIPS "Whether to build aws-lc with FIPS compliance" OFF)

if (POLICY CMP0069)
cmake_policy(SET CMP0069 NEW) # Enable LTO/IPO if available in the compiler, see AwsCFlags
endif()

if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW) # Enable options to get their values from normal variables
endif()

if (DEFINED CMAKE_PREFIX_PATH)
file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This library is licensed under the Apache 2.0 License.
### Linux/Unix
Requirements:
* Clang 3.9+ or GCC 4.4+
* cmake 3.1+
* cmake 3.13+
* Java: Any JDK8 or above, ensure `JAVA_HOME` is set
* Maven

Expand All @@ -43,7 +43,7 @@ Building:

### OSX
Requirements:
* cmake 3.1
* cmake 3.13+
* ninja
* Java: Any JDK8 or above, ensure `JAVA_HOME` is set
* Maven
Expand All @@ -58,7 +58,7 @@ Building:
### Windows
Requirements:
* Visual Studio 2015 or above
* CMake 3.1
* CMake 3.13+
* Java: Any JDK8 or above, ensure `JAVA_HOME` is set
* Maven

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath 'com.android.tools.build:gradle:7.4.2'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradle 7.0 had a bug with multiple object files which we were running into. Updating to 7.4 seems to work. 7.4 was chosen randomly.

}
}

Expand Down
7 changes: 3 additions & 4 deletions android/crt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ ext {
}

android {
compileSdkVersion 30
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compileSdkVersion is deprecated and replaced by compileSdk

buildToolsVersion "30.0.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildToolsVersion is deprecated and we don't need to specify it.

compileSdk 33
ndkVersion "21.4.7075529" // LTS version

useLibrary 'android.test.runner'
Expand All @@ -53,7 +52,8 @@ android {

defaultConfig {
minSdkVersion 24 // TODO - dictated by CompletableFuture which is API 24+
targetSdkVersion 30
targetSdkVersion 33
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was complaining that targetSDK 30 is not supported, and the minimum version should be 33 if you want to submit apps to Google Play. While we don't need to submit it to Google Play, 33 seems to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not updating the minSdkVersion, so we should be fine.


versionCode = gitVersionCode()
versionName = gitVersionName()

Expand Down Expand Up @@ -103,7 +103,6 @@ android {
cmake {
path "../../CMakeLists.txt"
buildStagingDirectory "../../target/cmake-build"
version "3.10.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work without an explicit version. If we face any issues, we can revert back to an explicit version.

}
}

Expand Down
2 changes: 1 addition & 1 deletion codebuild/cd/deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ phases:
# This weird path needed for cmd tool to work
- mv $ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/latest
# install android build tools
- echo y | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "build-tools;30.0.3" "platforms;android-30" "ndk;21.4.7075529"
- echo y | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "build-tools;30.0.3" "platforms;android-33" "ndk;21.4.7075529"

pre_build:
commands:
Expand Down
2 changes: 1 addition & 1 deletion crt/aws-c-cal
Submodule aws-c-cal updated 2 files
+2 −6 CMakeLists.txt
+1 −1 README.md
2 changes: 1 addition & 1 deletion crt/aws-c-compression
2 changes: 1 addition & 1 deletion crt/aws-c-event-stream
2 changes: 1 addition & 1 deletion crt/aws-c-http
2 changes: 1 addition & 1 deletion crt/aws-c-mqtt
2 changes: 1 addition & 1 deletion crt/aws-c-sdkutils
2 changes: 1 addition & 1 deletion crt/aws-checksums
Submodule aws-checksums updated 1 files
+1 −6 CMakeLists.txt
2 changes: 1 addition & 1 deletion crt/aws-lc
2 changes: 1 addition & 1 deletion crt/s2n
Submodule s2n updated from 08d413 to ffe0bf
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed Oct 16 16:47:56 PDT 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was automatically updated by Android Studio after updating Gradle to 7.4

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading