2021-02-04 10:08:28 +08:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
bootstrap_go_package {
|
|
|
|
name: "soong-cc",
|
|
|
|
pkgPath: "android/soong/cc",
|
|
|
|
deps: [
|
|
|
|
"blueprint",
|
|
|
|
"blueprint-pathtools",
|
|
|
|
"soong",
|
|
|
|
"soong-android",
|
2021-03-25 17:06:03 +08:00
|
|
|
"soong-bazel",
|
2020-06-02 01:45:49 +08:00
|
|
|
"soong-cc-config",
|
|
|
|
"soong-etc",
|
|
|
|
"soong-genrule",
|
|
|
|
"soong-tradefed",
|
|
|
|
],
|
|
|
|
srcs: [
|
|
|
|
"androidmk.go",
|
Replace stringly-typed API levels.
Handling of API levels within Soong is currently fairly difficult
since it isn't always clear based on context what kind of API level a
given string represents, how much canonicalizing and error checking
the code receiving the string are expected to do, or how those errors
should be treated.
The API level struct does not export its raw data, so as to keep its
"constructor" private to the android package, and to prevent misuse of
the `number` field, which is only an implementation detail for preview
API levels. API levels can be parsed with either
`android.ApiLevelFromUser`, which returns any errors to the caller, or
`android.ApiLevelOrPanic`, which is used in the case where the input
is trusted and any errors in parsing should panic. Even within the
`android` package, these APIs should be preferred over direct
construction.
For cases where there are context specific parsing requirements, such
as handling the "minimum" alias in the cc module,
`nativeApiLevelFromUser` and `nativeApiLevelOrPanic` should be used
instead.
Test: treehugger
Bug: http://b/154667674
Change-Id: Id52921fda32cb437fb1775ac2183299dedc0cf20
2020-07-07 05:49:35 +08:00
|
|
|
"api_level.go",
|
2020-06-02 01:45:49 +08:00
|
|
|
"builder.go",
|
Add os/target configurable selects for label list attributes.
This CL is pretty large, so I recommend starting with reading the newly
added tests for the expected behavior.
This change works in conjunction with the linked CLs in the Gerrit topic.
Those CLs add support for new platform() definitions for OS targets
specified in Soong's arch.go, which are configurable through
Android.bp's `target {}` property. It works similary to previous CLs
adding support for the `arch {}` property.
These configurable props are keyed by the OS: android, linux_bionic,
windows, and so on. They map to `select` statements in label list
attributes, which this CL enables for cc_library_headers' header_libs
and export_header_lib_headers props.
This enables //bionic/libc:libc_headers to be generated correctly, from:
cc_library_headers {
name: "libc_headers",
target: {
android: {
header_libs: ["libc_headers_arch"],
export_header_lib_headers: ["libc_headers_arch"],
},
linux_bionic: {
header_libs: ["libc_headers_arch"],
export_header_lib_headers: ["libc_headers_arch"],
},
},
// omitted props
}
to:
cc_library_headers(
name = "libc_headers",
deps = [] + select({
"//build/bazel/platforms/os:android": [
":libc_headers_arch",
],
"//build/bazel/platforms/os:linux_bionic": [
":libc_headers_arch",
],
"//conditions:default": [],
}),
)
Test: TH
Test: Verify generated //bionic/libc:libc_headers
Fixes: 183597786
Change-Id: I01016cc2cc9a71449f02300d747f01decebf3f6e
2021-03-24 14:18:33 +08:00
|
|
|
"bp2build.go",
|
2020-06-02 01:45:49 +08:00
|
|
|
"cc.go",
|
|
|
|
"ccdeps.go",
|
|
|
|
"check.go",
|
|
|
|
"coverage.go",
|
|
|
|
"gen.go",
|
2020-08-04 08:24:04 +08:00
|
|
|
"image.go",
|
2020-06-02 01:45:49 +08:00
|
|
|
"linkable.go",
|
|
|
|
"lto.go",
|
|
|
|
"makevars.go",
|
|
|
|
"pgo.go",
|
|
|
|
"prebuilt.go",
|
|
|
|
"proto.go",
|
|
|
|
"rs.go",
|
|
|
|
"sanitize.go",
|
|
|
|
"sabi.go",
|
|
|
|
"sdk.go",
|
2020-12-02 12:14:28 +08:00
|
|
|
"snapshot_prebuilt.go",
|
2020-06-02 01:45:49 +08:00
|
|
|
"snapshot_utils.go",
|
|
|
|
"stl.go",
|
|
|
|
"strip.go",
|
|
|
|
"sysprop.go",
|
|
|
|
"tidy.go",
|
|
|
|
"util.go",
|
|
|
|
"vendor_snapshot.go",
|
|
|
|
"vndk.go",
|
|
|
|
"vndk_prebuilt.go",
|
|
|
|
|
|
|
|
"cflag_artifacts.go",
|
|
|
|
"cmakelists.go",
|
|
|
|
"compdb.go",
|
|
|
|
"compiler.go",
|
|
|
|
"installer.go",
|
|
|
|
"linker.go",
|
|
|
|
|
|
|
|
"binary.go",
|
|
|
|
"binary_sdk_member.go",
|
|
|
|
"fuzz.go",
|
|
|
|
"library.go",
|
|
|
|
"library_headers.go",
|
|
|
|
"library_sdk_member.go",
|
|
|
|
"object.go",
|
|
|
|
"test.go",
|
|
|
|
"toolchain_library.go",
|
|
|
|
|
|
|
|
"ndk_prebuilt.go",
|
|
|
|
"ndk_headers.go",
|
|
|
|
"ndk_library.go",
|
|
|
|
"ndk_sysroot.go",
|
|
|
|
|
|
|
|
"llndk_library.go",
|
|
|
|
|
|
|
|
"kernel_headers.go",
|
|
|
|
|
|
|
|
"genrule.go",
|
|
|
|
|
|
|
|
"vendor_public_library.go",
|
|
|
|
|
|
|
|
"testing.go",
|
2020-11-16 09:48:44 +08:00
|
|
|
|
|
|
|
"stub_library.go",
|
2020-06-02 01:45:49 +08:00
|
|
|
],
|
|
|
|
testSrcs: [
|
|
|
|
"cc_test.go",
|
|
|
|
"compiler_test.go",
|
|
|
|
"gen_test.go",
|
|
|
|
"genrule_test.go",
|
|
|
|
"library_headers_test.go",
|
|
|
|
"library_test.go",
|
|
|
|
"object_test.go",
|
|
|
|
"prebuilt_test.go",
|
|
|
|
"proto_test.go",
|
2021-05-13 08:27:32 +08:00
|
|
|
"sanitize_test.go",
|
2020-06-02 01:45:49 +08:00
|
|
|
"test_data_test.go",
|
2021-04-24 05:04:33 +08:00
|
|
|
"vendor_public_library_test.go",
|
2021-01-09 08:40:12 +08:00
|
|
|
"vendor_snapshot_test.go",
|
2020-06-02 01:45:49 +08:00
|
|
|
],
|
|
|
|
pluginFor: ["soong_build"],
|
|
|
|
}
|