summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tomasz Wasilczyk <twasilczyk@google.com> 2024-06-20 15:29:09 -0700
committer Tomasz Wasilczyk <twasilczyk@google.com> 2024-06-20 15:30:09 -0700
commit2493fcc7b5d1066567c620fcbd98207304f64df2 (patch)
tree17df5ef52b3a1113427473dd5eb1d16030fc3f9c
parentc3177e0ffc9ab16e637300df30595b9ae1534ccc (diff)
Minor cc_cmake_snapshot touch-ups
- Partial support for arm64 hosts (no prebuilts yet) - Replace incorrect template function use MATCHES with STREQUAL - Add more ignored system libs - No need to explicitly add libc++ prebuilt Bug: 285204695 Test: m binder_sdk Change-Id: Id6508cc9f9ee6328c95c2821c325629f84eda138
-rw-r--r--cc/cmake_ext_add_aidl_library.txt4
-rw-r--r--cc/cmake_main.txt6
-rw-r--r--cc/cmake_snapshot.go11
3 files changed, 17 insertions, 4 deletions
diff --git a/cc/cmake_ext_add_aidl_library.txt b/cc/cmake_ext_add_aidl_library.txt
index af5bdf6c0..aa3235e30 100644
--- a/cc/cmake_ext_add_aidl_library.txt
+++ b/cc/cmake_ext_add_aidl_library.txt
@@ -25,7 +25,7 @@ function(add_aidl_library NAME LANG AIDLROOT SOURCES AIDLFLAGS)
endif()
set(DEPFILE_ARG)
- if (NOT ${CMAKE_GENERATOR} MATCHES "Unix Makefiles")
+ if (NOT ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(DEPFILE_ARG DEPFILE "${GEN_SOURCE}.d")
endif()
@@ -57,7 +57,7 @@ function(add_aidl_library NAME LANG AIDLROOT SOURCES AIDLFLAGS)
"${GEN_DIR}/include"
)
- if (${LANG} MATCHES "ndk")
+ if (${LANG} STREQUAL "ndk")
set(BINDER_LIB_NAME "libbinder_ndk_sdk")
else()
set(BINDER_LIB_NAME "libbinder_sdk")
diff --git a/cc/cmake_main.txt b/cc/cmake_main.txt
index e9177d6e2..f6e21a6c6 100644
--- a/cc/cmake_main.txt
+++ b/cc/cmake_main.txt
@@ -11,7 +11,11 @@ if (NOT ANDROID_BUILD_TOP)
set(ANDROID_BUILD_TOP "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
-set(PREBUILTS_BIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/prebuilts/host/linux-x86/bin")
+if ("${CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "^(arm|aarch)")
+ set(PREBUILTS_BIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/prebuilts/host/linux_musl-arm64/bin")
+else()
+ set(PREBUILTS_BIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/prebuilts/host/linux-x86/bin")
+endif()
if (NOT AIDL_BIN)
find_program(AIDL_BIN aidl REQUIRED HINTS "${PREBUILTS_BIN_DIR}")
endif()
diff --git a/cc/cmake_snapshot.go b/cc/cmake_snapshot.go
index ad7beedab..18c01803d 100644
--- a/cc/cmake_snapshot.go
+++ b/cc/cmake_snapshot.go
@@ -61,8 +61,13 @@ var defaultUnportableFlags []string = []string{
}
var ignoredSystemLibs []string = []string{
+ "crtbegin_dynamic",
+ "crtend_android",
+ "libc",
"libc++",
"libc++_static",
+ "libdl",
+ "libm",
"prebuilt_libclang_rt.builtins",
"prebuilt_libclang_rt.ubsan_minimal",
}
@@ -267,7 +272,11 @@ func (m *CmakeSnapshot) DepsMutator(ctx android.BottomUpMutatorContext) {
{"arch", "x86_64"},
}
ctx.AddVariationDependencies(variations, cmakeSnapshotModuleTag, m.Properties.Modules...)
- ctx.AddVariationDependencies(variations, cmakeSnapshotPrebuiltTag, m.Properties.Prebuilts...)
+
+ if len(m.Properties.Prebuilts) > 0 {
+ prebuilts := append(m.Properties.Prebuilts, "libc++")
+ ctx.AddVariationDependencies(variations, cmakeSnapshotPrebuiltTag, prebuilts...)
+ }
}
func (m *CmakeSnapshot) GenerateAndroidBuildActions(ctx android.ModuleContext) {