Merge "Move platform constraints to bazel_common_rules." into main
This commit is contained in:
commit
a4c330e076
41 changed files with 537 additions and 537 deletions
|
@ -133,7 +133,7 @@ func createPlatformArchMap() map[string]string {
|
|||
}
|
||||
result := make(map[string]string)
|
||||
for arch, allFeatures := range archFeatures {
|
||||
result[arch] = "//build/bazel/platforms/arch:" + arch
|
||||
result[arch] = "//build/bazel_common_rules/platforms/arch:" + arch
|
||||
// Sometimes we want to select on multiple features being active, so
|
||||
// add the power set of all possible features to the map. More details
|
||||
// in android.ModuleBase.GetArchVariantProperties
|
||||
|
@ -160,33 +160,33 @@ var (
|
|||
// A map of target operating systems to the Bazel label of the
|
||||
// constraint_value for the @platforms//os:os constraint_setting
|
||||
platformOsMap = map[string]string{
|
||||
OsAndroid: "//build/bazel/platforms/os:android",
|
||||
OsDarwin: "//build/bazel/platforms/os:darwin",
|
||||
OsLinux: "//build/bazel/platforms/os:linux_glibc",
|
||||
osLinuxMusl: "//build/bazel/platforms/os:linux_musl",
|
||||
osLinuxBionic: "//build/bazel/platforms/os:linux_bionic",
|
||||
OsWindows: "//build/bazel/platforms/os:windows",
|
||||
OsAndroid: "//build/bazel_common_rules/platforms/os:android",
|
||||
OsDarwin: "//build/bazel_common_rules/platforms/os:darwin",
|
||||
OsLinux: "//build/bazel_common_rules/platforms/os:linux_glibc",
|
||||
osLinuxMusl: "//build/bazel_common_rules/platforms/os:linux_musl",
|
||||
osLinuxBionic: "//build/bazel_common_rules/platforms/os:linux_bionic",
|
||||
OsWindows: "//build/bazel_common_rules/platforms/os:windows",
|
||||
ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map.
|
||||
}
|
||||
|
||||
platformOsArchMap = map[string]string{
|
||||
osArchAndroidArm: "//build/bazel/platforms/os_arch:android_arm",
|
||||
OsArchAndroidArm64: "//build/bazel/platforms/os_arch:android_arm64",
|
||||
osArchAndroidRiscv64: "//build/bazel/platforms/os_arch:android_riscv64",
|
||||
osArchAndroidX86: "//build/bazel/platforms/os_arch:android_x86",
|
||||
osArchAndroidX86_64: "//build/bazel/platforms/os_arch:android_x86_64",
|
||||
osArchDarwinArm64: "//build/bazel/platforms/os_arch:darwin_arm64",
|
||||
osArchDarwinX86_64: "//build/bazel/platforms/os_arch:darwin_x86_64",
|
||||
osArchLinuxX86: "//build/bazel/platforms/os_arch:linux_glibc_x86",
|
||||
osArchLinuxX86_64: "//build/bazel/platforms/os_arch:linux_glibc_x86_64",
|
||||
osArchLinuxMuslArm: "//build/bazel/platforms/os_arch:linux_musl_arm",
|
||||
osArchLinuxMuslArm64: "//build/bazel/platforms/os_arch:linux_musl_arm64",
|
||||
osArchLinuxMuslX86: "//build/bazel/platforms/os_arch:linux_musl_x86",
|
||||
osArchLinuxMuslX86_64: "//build/bazel/platforms/os_arch:linux_musl_x86_64",
|
||||
osArchLinuxBionicArm64: "//build/bazel/platforms/os_arch:linux_bionic_arm64",
|
||||
osArchLinuxBionicX86_64: "//build/bazel/platforms/os_arch:linux_bionic_x86_64",
|
||||
osArchWindowsX86: "//build/bazel/platforms/os_arch:windows_x86",
|
||||
osArchWindowsX86_64: "//build/bazel/platforms/os_arch:windows_x86_64",
|
||||
osArchAndroidArm: "//build/bazel_common_rules/platforms/os_arch:android_arm",
|
||||
OsArchAndroidArm64: "//build/bazel_common_rules/platforms/os_arch:android_arm64",
|
||||
osArchAndroidRiscv64: "//build/bazel_common_rules/platforms/os_arch:android_riscv64",
|
||||
osArchAndroidX86: "//build/bazel_common_rules/platforms/os_arch:android_x86",
|
||||
osArchAndroidX86_64: "//build/bazel_common_rules/platforms/os_arch:android_x86_64",
|
||||
osArchDarwinArm64: "//build/bazel_common_rules/platforms/os_arch:darwin_arm64",
|
||||
osArchDarwinX86_64: "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64",
|
||||
osArchLinuxX86: "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86",
|
||||
osArchLinuxX86_64: "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86_64",
|
||||
osArchLinuxMuslArm: "//build/bazel_common_rules/platforms/os_arch:linux_musl_arm",
|
||||
osArchLinuxMuslArm64: "//build/bazel_common_rules/platforms/os_arch:linux_musl_arm64",
|
||||
osArchLinuxMuslX86: "//build/bazel_common_rules/platforms/os_arch:linux_musl_x86",
|
||||
osArchLinuxMuslX86_64: "//build/bazel_common_rules/platforms/os_arch:linux_musl_x86_64",
|
||||
osArchLinuxBionicArm64: "//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64",
|
||||
osArchLinuxBionicX86_64: "//build/bazel_common_rules/platforms/os_arch:linux_bionic_x86_64",
|
||||
osArchWindowsX86: "//build/bazel_common_rules/platforms/os_arch:windows_x86",
|
||||
osArchWindowsX86_64: "//build/bazel_common_rules/platforms/os_arch:windows_x86_64",
|
||||
ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map.
|
||||
}
|
||||
|
||||
|
@ -209,11 +209,11 @@ var (
|
|||
AndroidAndInApex: "//build/bazel/rules/apex:android-in_apex",
|
||||
AndroidPlatform: "//build/bazel/rules/apex:system",
|
||||
Unbundled_app: "//build/bazel/rules/apex:unbundled_app",
|
||||
OsDarwin: "//build/bazel/platforms/os:darwin",
|
||||
OsLinux: "//build/bazel/platforms/os:linux_glibc",
|
||||
osLinuxMusl: "//build/bazel/platforms/os:linux_musl",
|
||||
osLinuxBionic: "//build/bazel/platforms/os:linux_bionic",
|
||||
OsWindows: "//build/bazel/platforms/os:windows",
|
||||
OsDarwin: "//build/bazel_common_rules/platforms/os:darwin",
|
||||
OsLinux: "//build/bazel_common_rules/platforms/os:linux_glibc",
|
||||
osLinuxMusl: "//build/bazel_common_rules/platforms/os:linux_musl",
|
||||
osLinuxBionic: "//build/bazel_common_rules/platforms/os:linux_bionic",
|
||||
OsWindows: "//build/bazel_common_rules/platforms/os:windows",
|
||||
ConditionsDefaultConfigKey: ConditionsDefaultSelectKey,
|
||||
}
|
||||
|
||||
|
|
|
@ -69,8 +69,8 @@ android_library {
|
|||
"TestLib",
|
||||
AttrNameToString{
|
||||
"srcs": `["lib.java"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm.java"],
|
||||
"//build/bazel/platforms/arch:x86": ["x86.java"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm.java"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["x86.java"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"manifest": `"manifest/AndroidManifest.xml"`,
|
||||
|
|
|
@ -128,7 +128,7 @@ func TestCcAconfigLibrary(t *testing.T) {
|
|||
AttrNameToString{
|
||||
"aconfig_declarations": `":foo_aconfig_declarations"`,
|
||||
"dynamic_deps": `[":server_configurable_flags"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
},
|
||||
)}
|
||||
RunBp2BuildTestCase(t, registerAconfigModuleTypes, Bp2buildTestCase{
|
||||
|
@ -169,7 +169,7 @@ func TestJavaAconfigLibrary(t *testing.T) {
|
|||
"aconfig_declarations": `":foo_aconfig_declarations"`,
|
||||
"test": `True`,
|
||||
"sdk_version": `"system_current"`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
},
|
||||
)}
|
||||
RunBp2BuildTestCase(t, registerAconfigModuleTypes, Bp2buildTestCase{
|
||||
|
@ -215,7 +215,7 @@ func TestJavaAconfigLibraryAsTaggedOutput(t *testing.T) {
|
|||
"aconfig_declarations": `":foo_aconfig_declarations"`,
|
||||
"test": `True`,
|
||||
"sdk_version": `"system_current"`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
},
|
||||
),
|
||||
MakeBazelTargetNoRestrictions(
|
||||
|
@ -224,7 +224,7 @@ func TestJavaAconfigLibraryAsTaggedOutput(t *testing.T) {
|
|||
AttrNameToString{
|
||||
"srcs": `[":foo_aconfig_library.generated_srcjars"]`,
|
||||
"sdk_version": `"current"`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
},
|
||||
),
|
||||
MakeNeverlinkDuplicateTarget("java_library", "foo_library"),
|
||||
|
|
|
@ -167,8 +167,8 @@ android_app {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
|
||||
"srcs": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm.java"],
|
||||
"//build/bazel/platforms/arch:x86": ["x86.java"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm.java"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["x86.java"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"manifest": `"AndroidManifest.xml"`,
|
||||
|
@ -508,7 +508,7 @@ filegroup {
|
|||
"manifest": `"AndroidManifest.xml"`,
|
||||
"resource_files": `["res/values/attrs.xml"]`,
|
||||
"resource_zips": `["resource_zip.zip"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
}),
|
||||
MakeBazelTargetNoRestrictions("filegroup", "framework-res-package-jar", AttrNameToString{
|
||||
"srcs": `[":framework-res.export-package.apk"]`,
|
||||
|
|
|
@ -158,22 +158,22 @@ apex {
|
|||
"manifest": `"apogee_manifest.json"`,
|
||||
"min_sdk_version": `"29"`,
|
||||
"native_shared_libs_32": `select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
":native_shared_lib_1",
|
||||
":native_shared_lib_2",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
":native_shared_lib_1",
|
||||
":native_shared_lib_2",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"native_shared_libs_64": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
":native_shared_lib_1",
|
||||
":native_shared_lib_2",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
":native_shared_lib_1",
|
||||
":native_shared_lib_2",
|
||||
],
|
||||
|
@ -293,18 +293,18 @@ filegroup {
|
|||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib32",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:arm": [":native_shared_lib_for_first"],
|
||||
"//build/bazel/platforms/arch:x86": [":native_shared_lib_for_first"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [":native_shared_lib_for_first"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [":native_shared_lib_for_first"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"native_shared_libs_64": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
":unnested_native_shared_lib",
|
||||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib64",
|
||||
":native_shared_lib_for_first",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
":unnested_native_shared_lib",
|
||||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib64",
|
||||
|
@ -322,13 +322,13 @@ func TestApexBundleCompileMultilibFirstAndDefaultValue(t *testing.T) {
|
|||
expectedBazelTargets := []string{
|
||||
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
|
||||
"native_shared_libs_32": `select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
":unnested_native_shared_lib",
|
||||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib32",
|
||||
":native_shared_lib_for_first",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
":unnested_native_shared_lib",
|
||||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib32",
|
||||
|
@ -337,13 +337,13 @@ func TestApexBundleCompileMultilibFirstAndDefaultValue(t *testing.T) {
|
|||
"//conditions:default": [],
|
||||
})`,
|
||||
"native_shared_libs_64": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
":unnested_native_shared_lib",
|
||||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib64",
|
||||
":native_shared_lib_for_first",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
":unnested_native_shared_lib",
|
||||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib64",
|
||||
|
@ -405,8 +405,8 @@ filegroup {
|
|||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib32",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:arm": [":native_shared_lib_for_first"],
|
||||
"//build/bazel/platforms/arch:x86": [":native_shared_lib_for_first"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [":native_shared_lib_for_first"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [":native_shared_lib_for_first"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
|
||||
|
@ -433,13 +433,13 @@ filegroup {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
|
||||
"native_shared_libs_64": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
":unnested_native_shared_lib",
|
||||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib64",
|
||||
":native_shared_lib_for_first",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
":unnested_native_shared_lib",
|
||||
":native_shared_lib_for_both",
|
||||
":native_shared_lib_for_lib64",
|
||||
|
@ -671,22 +671,22 @@ override_apex {
|
|||
"manifest": `"apogee_manifest.json"`,
|
||||
"min_sdk_version": `"29"`,
|
||||
"native_shared_libs_32": `select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
":native_shared_lib_1",
|
||||
":native_shared_lib_2",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
":native_shared_lib_1",
|
||||
":native_shared_lib_2",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"native_shared_libs_64": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
":native_shared_lib_1",
|
||||
":native_shared_lib_2",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
":native_shared_lib_1",
|
||||
":native_shared_lib_2",
|
||||
],
|
||||
|
@ -796,13 +796,13 @@ override_apex {
|
|||
"manifest": `"apogee_manifest.json"`,
|
||||
"min_sdk_version": `"29"`,
|
||||
"native_shared_libs_32": `select({
|
||||
"//build/bazel/platforms/arch:arm": [":native_shared_lib_1"],
|
||||
"//build/bazel/platforms/arch:x86": [":native_shared_lib_1"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [":native_shared_lib_1"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [":native_shared_lib_1"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"native_shared_libs_64": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [":native_shared_lib_1"],
|
||||
"//build/bazel/platforms/arch:x86_64": [":native_shared_lib_1"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [":native_shared_lib_1"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [":native_shared_lib_1"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"testonly": "True",
|
||||
|
@ -1298,13 +1298,13 @@ apex {
|
|||
"manifest": `"myapex_manifest.json"`,
|
||||
"binaries": `[":bar"]`,
|
||||
"native_shared_libs_32": `select({
|
||||
"//build/bazel/platforms/arch:arm": [":foo"],
|
||||
"//build/bazel/platforms/arch:x86": [":foo"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [":foo"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [":foo"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"native_shared_libs_64": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [":foo"],
|
||||
"//build/bazel/platforms/arch:x86_64": [":foo"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [":foo"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [":foo"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -49,7 +49,7 @@ apex_key {
|
|||
ExpectedBazelTargets: []string{MakeBazelTargetNoRestrictions("apex_key", "com.android.apogee.key", AttrNameToString{
|
||||
"private_key": `"com.android.apogee.pem"`,
|
||||
"public_key": `"com.android.apogee.avbpubkey"`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ apex_key {
|
|||
ExpectedBazelTargets: []string{MakeBazelTargetNoRestrictions("apex_key", "com.android.apogee.key", AttrNameToString{
|
||||
"private_key_name": `"com.android.apogee.pem"`,
|
||||
"public_key_name": `"com.android.apogee.avbpubkey"`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ apex_key {
|
|||
ExpectedBazelTargets: []string{MakeBazelTargetNoRestrictions("apex_key", "com.android.apogee.key", AttrNameToString{
|
||||
"private_key": `":com.android.apogee.pem"`,
|
||||
"public_key": `":com.android.apogee.avbpubkey"`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ bpf {
|
|||
"bpfTestSrcOne.c",
|
||||
"bpfTestSrcTwo.c",
|
||||
]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
}),
|
||||
},
|
||||
})
|
||||
|
|
|
@ -270,8 +270,8 @@ func TestGenerateBazelTargetModules(t *testing.T) {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("custom", "foo", AttrNameToString{
|
||||
"string_literal_prop": `select({
|
||||
"//build/bazel/platforms/arch:arm": "ARM",
|
||||
"//build/bazel/platforms/arch:arm64": "ARM64",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "ARM",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "ARM64",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}),
|
||||
|
@ -382,60 +382,60 @@ custom {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("custom", "arch_paths", AttrNameToString{
|
||||
"arch_paths": `select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
"arm.txt",
|
||||
"lib32.txt",
|
||||
],
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
"arm64.txt",
|
||||
"lib64.txt",
|
||||
],
|
||||
"//build/bazel/platforms/arch:riscv64": [
|
||||
"//build/bazel_common_rules/platforms/arch:riscv64": [
|
||||
"riscv64.txt",
|
||||
"lib64.txt",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
"x86.txt",
|
||||
"lib32.txt",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
"x86_64.txt",
|
||||
"lib64.txt",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": [
|
||||
"//build/bazel_common_rules/platforms/os:android": [
|
||||
"linux.txt",
|
||||
"bionic.txt",
|
||||
"android.txt",
|
||||
],
|
||||
"//build/bazel/platforms/os:darwin": [
|
||||
"//build/bazel_common_rules/platforms/os:darwin": [
|
||||
"host.txt",
|
||||
"darwin.txt",
|
||||
"not_windows.txt",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_bionic": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [
|
||||
"host.txt",
|
||||
"linux.txt",
|
||||
"bionic.txt",
|
||||
"linux_bionic.txt",
|
||||
"not_windows.txt",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_glibc": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": [
|
||||
"host.txt",
|
||||
"linux.txt",
|
||||
"glibc.txt",
|
||||
"linux_glibc.txt",
|
||||
"not_windows.txt",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_musl": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [
|
||||
"host.txt",
|
||||
"linux.txt",
|
||||
"musl.txt",
|
||||
"linux_musl.txt",
|
||||
"not_windows.txt",
|
||||
],
|
||||
"//build/bazel/platforms/os:windows": [
|
||||
"//build/bazel_common_rules/platforms/os:windows": [
|
||||
"host.txt",
|
||||
"windows.txt",
|
||||
],
|
||||
|
@ -467,7 +467,7 @@ custom {
|
|||
}),
|
||||
MakeBazelTarget("custom", "has_dep", AttrNameToString{
|
||||
"arch_paths": `select({
|
||||
"//build/bazel/platforms/arch:x86": [":dep"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [":dep"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1768,8 +1768,8 @@ python_library {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("py_library", "fg_foo", map[string]string{
|
||||
"data": `select({
|
||||
"//build/bazel/platforms/arch:arm": [":reqdarm"],
|
||||
"//build/bazel/platforms/arch:x86": [":reqdx86"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [":reqdarm"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [":reqdx86"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs_version": `"PY3"`,
|
||||
|
|
|
@ -618,13 +618,13 @@ cc_library {
|
|||
{"cc_library_static", "bar_bp2build_cc_library_static", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["b.cc"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
},
|
||||
},
|
||||
{"cc_library_shared", "bar", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["b.cc"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
},
|
||||
},
|
||||
{"cc_binary", "foo", AttrNameToString{
|
||||
|
@ -653,7 +653,7 @@ func TestCcBinaryWithInstructionSet(t *testing.T) {
|
|||
targets: []testBazelTarget{
|
||||
{"cc_binary", "foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm_isa_arm"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm_isa_arm"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -713,8 +713,8 @@ func TestCcArchVariantBinarySuffix(t *testing.T) {
|
|||
{"cc_binary", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"suffix": `select({
|
||||
"//build/bazel/platforms/arch:arm": "-32",
|
||||
"//build/bazel/platforms/arch:arm64": "-64",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "-32",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "-64",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}},
|
||||
|
@ -775,7 +775,7 @@ func TestCcBinaryWithSyspropSrcsSomeConfigs(t *testing.T) {
|
|||
targets: []testBazelTarget{
|
||||
{"sysprop_library", "foo_sysprop_library", AttrNameToString{
|
||||
"srcs": `select({
|
||||
"//build/bazel/platforms/os:android": ["bar.sysprop"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}},
|
||||
|
@ -788,7 +788,7 @@ func TestCcBinaryWithSyspropSrcsSomeConfigs(t *testing.T) {
|
|||
"local_includes": `["."]`,
|
||||
"min_sdk_version": `"5"`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}},
|
||||
|
@ -866,8 +866,8 @@ func TestCcBinaryWithUBSanPropertiesArchSpecific(t *testing.T) {
|
|||
"ubsan_undefined",
|
||||
"ubsan_nullability",
|
||||
] + select({
|
||||
"//build/bazel/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}},
|
||||
|
@ -964,11 +964,11 @@ func TestCcBinaryWithThinLtoArchSpecific(t *testing.T) {
|
|||
{"cc_binary", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}},
|
||||
|
@ -998,7 +998,7 @@ func TestCcBinaryWithThinLtoDisabledDefaultEnabledVariant(t *testing.T) {
|
|||
{"cc_binary", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
|
||||
"//conditions:default": ["-android_thin_lto"],
|
||||
})`,
|
||||
}},
|
||||
|
@ -1062,7 +1062,7 @@ func TestCcBinaryHiddenVisibilityConvertedToFeatureOsSpecific(t *testing.T) {
|
|||
{"cc_binary", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["visibility_hidden"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}},
|
||||
|
@ -1106,7 +1106,7 @@ func TestCcBinaryWithCfiOsSpecific(t *testing.T) {
|
|||
targets: []testBazelTarget{
|
||||
{"cc_binary", "foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_cfi"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -1187,8 +1187,8 @@ cc_binary {
|
|||
}},
|
||||
{"cc_binary", "foo_with_arch_variant_stem", AttrNameToString{
|
||||
"stem": `select({
|
||||
"//build/bazel/platforms/arch:arm": "foo-arm",
|
||||
"//build/bazel/platforms/arch:arm64": "foo-arm64",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "foo-arm",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "foo-arm64",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
|
|
@ -137,22 +137,22 @@ cc_library {
|
|||
"export_includes": `["foo-dir"]`,
|
||||
"implementation_deps": `[":some-headers"]`,
|
||||
"linkopts": `["-Wl,--exclude-libs=bar.a"] + select({
|
||||
"//build/bazel/platforms/arch:x86": ["-Wl,--exclude-libs=baz.a"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["-Wl,--exclude-libs=qux.a"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["-Wl,--exclude-libs=baz.a"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["-Wl,--exclude-libs=qux.a"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs": `["impl.cpp"] + select({
|
||||
"//build/bazel/platforms/arch:x86": ["x86.cpp"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["x86_64.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["x86.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["x86_64.cpp"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": [
|
||||
"//build/bazel_common_rules/platforms/os:android": [
|
||||
"bionic.cpp",
|
||||
"android.cpp",
|
||||
],
|
||||
"//build/bazel/platforms/os:darwin": ["darwin.cpp"],
|
||||
"//build/bazel/platforms/os:linux_bionic": ["bionic.cpp"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["linux.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os:darwin": ["darwin.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": ["bionic.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["linux.cpp"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"sdk_version": `"current"`,
|
||||
|
@ -228,8 +228,8 @@ cc_library {
|
|||
"-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a",
|
||||
"-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:x86": ["-Wl,--exclude-libs=libgcc_eh.a"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["-Wl,--exclude-libs=libgcc_eh.a"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["-Wl,--exclude-libs=libgcc_eh.a"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["-Wl,--exclude-libs=libgcc_eh.a"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -278,7 +278,7 @@ cc_library {
|
|||
Blueprint: soongCcLibraryPreamble,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("fake-libarm-optimized-routines-math", AttrNameToString{
|
||||
"copts": `select({
|
||||
"//build/bazel/platforms/arch:arm64": ["-DHAVE_FAST_FMA=1"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["-DHAVE_FAST_FMA=1"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -688,14 +688,14 @@ cc_library_static { name: "android_dep_for_shared" }
|
|||
"bothflag",
|
||||
"staticflag",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:x86": ["-DX86_STATIC"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["-DX86_STATIC"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"implementation_deps": `[
|
||||
":static_dep_for_both",
|
||||
":static_dep_for_static",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:x86": [":x86_dep_for_static"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [":x86_dep_for_static"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -703,7 +703,7 @@ cc_library_static { name: "android_dep_for_shared" }
|
|||
"both.cpp",
|
||||
"staticonly.cpp",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:x86": ["x86_static.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["x86_static.cpp"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -712,27 +712,27 @@ cc_library_static { name: "android_dep_for_shared" }
|
|||
"bothflag",
|
||||
"sharedflag",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["-DARM_SHARED"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["-DARM_SHARED"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": ["-DANDROID_SHARED"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["-DANDROID_SHARED"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": ["-DANDROID_ARM_SHARED"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": ["-DANDROID_ARM_SHARED"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"implementation_deps": `[
|
||||
":static_dep_for_both",
|
||||
":static_dep_for_shared",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:arm": [":arm_static_dep_for_shared"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [":arm_static_dep_for_shared"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": [":android_dep_for_shared"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":android_dep_for_shared"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"implementation_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/arch:arm": [":arm_shared_dep_for_shared"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [":arm_shared_dep_for_shared"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -740,14 +740,14 @@ cc_library_static { name: "android_dep_for_shared" }
|
|||
"both.cpp",
|
||||
"sharedonly.cpp",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm_shared.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm_shared.cpp"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": ["android_shared.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_shared.cpp"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/arch:arm": [":arm_whole_static_dep_for_shared"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [":arm_whole_static_dep_for_shared"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -954,22 +954,22 @@ cc_library {
|
|||
Blueprint: soongCcLibraryPreamble,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
|
||||
"additional_linker_inputs": `select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
"arm.map",
|
||||
"dynamic_arm.list",
|
||||
],
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
"arm64.map",
|
||||
"dynamic_arm64.list",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"linkopts": `select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
"-Wl,--version-script,$(location arm.map)",
|
||||
"-Wl,--dynamic-list,$(location dynamic_arm.list)",
|
||||
],
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
"-Wl,--version-script,$(location arm64.map)",
|
||||
"-Wl,--dynamic-list,$(location dynamic_arm64.list)",
|
||||
],
|
||||
|
@ -977,8 +977,8 @@ cc_library {
|
|||
})`,
|
||||
"srcs": `["a.cpp"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["android_cfi_exports_map"],
|
||||
"//build/bazel/platforms/arch:arm64": ["android_cfi_exports_map"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["android_cfi_exports_map"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["android_cfi_exports_map"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1065,7 +1065,7 @@ func TestCcLibraryFeatures(t *testing.T) {
|
|||
})...)
|
||||
expected_targets = append(expected_targets, makeCcLibraryTargets("b", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
"disable_pack_relocations",
|
||||
"-no_undefined_symbols",
|
||||
],
|
||||
|
@ -1076,7 +1076,7 @@ func TestCcLibraryFeatures(t *testing.T) {
|
|||
})...)
|
||||
expected_targets = append(expected_targets, makeCcLibraryTargets("c", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:darwin": [
|
||||
"//build/bazel_common_rules/platforms/os:darwin": [
|
||||
"disable_pack_relocations",
|
||||
"-no_undefined_symbols",
|
||||
],
|
||||
|
@ -1181,10 +1181,10 @@ func TestCcLibraryCppFlagsGoesIntoCopts(t *testing.T) {
|
|||
"-fsigned-char",
|
||||
"-pedantic",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:arm64": ["-DARM64=1"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["-DARM64=1"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": ["-DANDROID=1"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["-DANDROID=1"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs": `["a.cpp"]`,
|
||||
|
@ -1271,14 +1271,14 @@ cc_library {
|
|||
`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("foo_static", AttrNameToString{
|
||||
"implementation_deps": `select({
|
||||
"//build/bazel/platforms/arch:arm": [],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [],
|
||||
"//conditions:default": [":arm_static_lib_excludes_bp2build_cc_library_static"],
|
||||
}) + select({
|
||||
"//build/bazel/product_config/config_settings:malloc_not_svelte": [],
|
||||
"//conditions:default": [":malloc_not_svelte_static_lib_excludes_bp2build_cc_library_static"],
|
||||
})`,
|
||||
"implementation_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/arch:arm": [],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [],
|
||||
"//conditions:default": [":arm_shared_lib_excludes"],
|
||||
}) + select({
|
||||
"//build/bazel/product_config/config_settings:malloc_not_svelte": [":malloc_not_svelte_shared_lib"],
|
||||
|
@ -1286,7 +1286,7 @@ cc_library {
|
|||
})`,
|
||||
"srcs_c": `["common.c"]`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/arch:arm": [],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [],
|
||||
"//conditions:default": [":arm_whole_static_lib_excludes_bp2build_cc_library_static"],
|
||||
}) + select({
|
||||
"//build/bazel/product_config/config_settings:malloc_not_svelte": [":malloc_not_svelte_whole_static_lib_bp2build_cc_library_static"],
|
||||
|
@ -1325,7 +1325,7 @@ cc_library {
|
|||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs_c": `["common.c"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
}),
|
||||
},
|
||||
)
|
||||
|
@ -1402,7 +1402,7 @@ cc_library {
|
|||
`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["-link_crt"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["-link_crt"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs": `["impl.cpp"]`,
|
||||
|
@ -1506,8 +1506,8 @@ cc_library {
|
|||
ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
|
||||
"srcs": `["impl.cpp"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["-use_libcrt"],
|
||||
"//build/bazel/platforms/arch:x86": ["-use_libcrt"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["-use_libcrt"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["-use_libcrt"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1543,11 +1543,11 @@ cc_library {
|
|||
`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["-use_libcrt"],
|
||||
"//build/bazel/platforms/arch:x86": ["-use_libcrt"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["-use_libcrt"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["-use_libcrt"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:darwin": ["-use_libcrt"],
|
||||
"//build/bazel_common_rules/platforms/os:darwin": ["-use_libcrt"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs": `["impl.cpp"]`,
|
||||
|
@ -1586,8 +1586,8 @@ cc_library {
|
|||
ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
|
||||
"srcs": `["impl.cpp"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["-use_libcrt"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["-use_libcrt"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["-use_libcrt"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["-use_libcrt"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1705,15 +1705,15 @@ cc_library {
|
|||
ExpectedBazelTargets: makeCcLibraryTargets("multi-arch", AttrNameToString{
|
||||
"strip": `{
|
||||
"keep_symbols": select({
|
||||
"//build/bazel/platforms/arch:arm64": True,
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": True,
|
||||
"//conditions:default": None,
|
||||
}),
|
||||
"keep_symbols_and_debug_frame": select({
|
||||
"//build/bazel/platforms/arch:arm": True,
|
||||
"//build/bazel_common_rules/platforms/arch:arm": True,
|
||||
"//conditions:default": None,
|
||||
}),
|
||||
"keep_symbols_list": select({
|
||||
"//build/bazel/platforms/os:darwin": [
|
||||
"//build/bazel_common_rules/platforms/os:darwin": [
|
||||
"foo",
|
||||
"bar",
|
||||
],
|
||||
|
@ -1844,7 +1844,7 @@ cc_library {
|
|||
`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("target_linux_bionic_empty", AttrNameToString{
|
||||
"system_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1875,7 +1875,7 @@ cc_library {
|
|||
`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("target_bionic_empty", AttrNameToString{
|
||||
"system_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -2011,25 +2011,25 @@ cc_library {
|
|||
`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
|
||||
"srcs": `["base.cpp"] + select({
|
||||
"//build/bazel/platforms/os:android": [
|
||||
"//build/bazel_common_rules/platforms/os:android": [
|
||||
"linux.cpp",
|
||||
"bionic.cpp",
|
||||
"android.cpp",
|
||||
],
|
||||
"//build/bazel/platforms/os:darwin": ["darwin.cpp"],
|
||||
"//build/bazel/platforms/os:linux_bionic": [
|
||||
"//build/bazel_common_rules/platforms/os:darwin": ["darwin.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [
|
||||
"linux.cpp",
|
||||
"bionic.cpp",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_glibc": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": [
|
||||
"linux.cpp",
|
||||
"linux_glibc.cpp",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_musl": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [
|
||||
"linux.cpp",
|
||||
"linux_musl.cpp",
|
||||
],
|
||||
"//build/bazel/platforms/os:windows": ["windows.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os:windows": ["windows.cpp"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -2056,7 +2056,7 @@ cc_library {
|
|||
`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("libcrypto", AttrNameToString{
|
||||
"inject_bssl_hash": `select({
|
||||
"//build/bazel/platforms/os:android": True,
|
||||
"//build/bazel_common_rules/platforms/os:android": True,
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}),
|
||||
|
@ -2697,11 +2697,11 @@ func TestCcLibraryDisabledArchAndTarget(t *testing.T) {
|
|||
ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
|
||||
"srcs": `["foo.cpp"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:linux_glibc_x86": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:windows_x86": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:windows_x86": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -2733,8 +2733,8 @@ func TestCcLibraryDisabledArchAndTargetWithDefault(t *testing.T) {
|
|||
ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
|
||||
"srcs": `["foo.cpp"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os_arch:darwin_arm64": [],
|
||||
"//build/bazel/platforms/os_arch:darwin_x86_64": [],
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_arm64": [],
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
})`,
|
||||
}),
|
||||
|
@ -2767,7 +2767,7 @@ func TestCcLibrarySharedDisabled(t *testing.T) {
|
|||
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"srcs": `["foo.cpp"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -2804,15 +2804,15 @@ func TestCcLibraryStaticDisabledForSomeArch(t *testing.T) {
|
|||
ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
|
||||
"srcs": `["foo.cpp"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:windows": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:windows": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"srcs": `["foo.cpp"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os_arch:darwin_arm64": [],
|
||||
"//build/bazel/platforms/os_arch:darwin_x86_64": [],
|
||||
"//build/bazel/platforms/os_arch:linux_glibc_x86": [],
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_arm64": [],
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": [],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
})`,
|
||||
}),
|
||||
|
@ -2923,22 +2923,22 @@ cc_library {
|
|||
}`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("foolib", AttrNameToString{
|
||||
"implementation_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/os:darwin": [":bazlib"],
|
||||
"//build/bazel/platforms/os:linux_bionic": [":bazlib"],
|
||||
"//build/bazel/platforms/os:linux_glibc": [":bazlib"],
|
||||
"//build/bazel/platforms/os:linux_musl": [":bazlib"],
|
||||
"//build/bazel/platforms/os:windows": [":bazlib"],
|
||||
"//build/bazel_common_rules/platforms/os:darwin": [":bazlib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [":bazlib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": [":bazlib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [":bazlib"],
|
||||
"//build/bazel_common_rules/platforms/os:windows": [":bazlib"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:darwin": [":quxlib"],
|
||||
"//build/bazel/platforms/os:linux_bionic": [":quxlib"],
|
||||
"//build/bazel/platforms/os:linux_glibc": [":quxlib"],
|
||||
"//build/bazel/platforms/os:linux_musl": [":quxlib"],
|
||||
"//build/bazel/platforms/os:windows": [":quxlib"],
|
||||
"//build/bazel/rules/apex:foo": [
|
||||
"@api_surfaces//module-libapi/current:barlib",
|
||||
"@api_surfaces//module-libapi/current:quxlib",
|
||||
],
|
||||
"//build/bazel_common_rules/platforms/os:darwin": [":quxlib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [":quxlib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": [":quxlib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [":quxlib"],
|
||||
"//build/bazel_common_rules/platforms/os:windows": [":quxlib"],
|
||||
"//conditions:default": [
|
||||
":barlib",
|
||||
":quxlib",
|
||||
|
@ -3053,7 +3053,7 @@ func TestCcLibraryWithInstructionSet(t *testing.T) {
|
|||
`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm_isa_arm"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm_isa_arm"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -3137,8 +3137,8 @@ func TestCcLibraryArchVariantSuffix(t *testing.T) {
|
|||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"srcs_c": `["foo.c"]`,
|
||||
"suffix": `select({
|
||||
"//build/bazel/platforms/arch:arm": "-32",
|
||||
"//build/bazel/platforms/arch:arm64": "-64",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "-32",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "-64",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}),
|
||||
|
@ -3503,7 +3503,7 @@ cc_library {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTargetNoRestrictions("sysprop_library", "foo_sysprop_library", AttrNameToString{
|
||||
"srcs": `select({
|
||||
"//build/bazel/platforms/os:android": ["bar.sysprop"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -3516,7 +3516,7 @@ cc_library {
|
|||
"local_includes": `["."]`,
|
||||
"min_sdk_version": `"5"`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -3525,7 +3525,7 @@ cc_library {
|
|||
"local_includes": `["."]`,
|
||||
"min_sdk_version": `"5"`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -3861,39 +3861,39 @@ cc_library {
|
|||
`,
|
||||
ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
|
||||
"export_includes": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": [
|
||||
"android_arm_eid1",
|
||||
"android_arm_eid2",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": [
|
||||
"//build/bazel_common_rules/platforms/os:android": [
|
||||
"android_eid1",
|
||||
"android_eid2",
|
||||
"linux_eid1",
|
||||
"linux_eid2",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_bionic": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [
|
||||
"linux_eid1",
|
||||
"linux_eid2",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_glibc": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": [
|
||||
"linux_eid1",
|
||||
"linux_eid2",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_musl": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [
|
||||
"linux_eid1",
|
||||
"linux_eid2",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
"lib32_eid1",
|
||||
"lib32_eid2",
|
||||
"arm_eid1",
|
||||
"arm_eid2",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
"lib32_eid1",
|
||||
"lib32_eid2",
|
||||
],
|
||||
|
@ -3903,39 +3903,39 @@ cc_library {
|
|||
"eid2",
|
||||
]`,
|
||||
"export_system_includes": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": [
|
||||
"android_arm_esid1",
|
||||
"android_arm_esid2",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": [
|
||||
"//build/bazel_common_rules/platforms/os:android": [
|
||||
"android_esid1",
|
||||
"android_esid2",
|
||||
"linux_esid1",
|
||||
"linux_esid2",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_bionic": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [
|
||||
"linux_esid1",
|
||||
"linux_esid2",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_glibc": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": [
|
||||
"linux_esid1",
|
||||
"linux_esid2",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_musl": [
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [
|
||||
"linux_esid1",
|
||||
"linux_esid2",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
"lib32_esid1",
|
||||
"lib32_esid2",
|
||||
"arm_esid1",
|
||||
"arm_esid2",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
"lib32_esid1",
|
||||
"lib32_esid2",
|
||||
],
|
||||
|
@ -3946,7 +3946,7 @@ cc_library {
|
|||
]`,
|
||||
"srcs": `["a.cpp"]`,
|
||||
"local_includes": `["."]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
}),
|
||||
},
|
||||
)
|
||||
|
@ -4081,8 +4081,8 @@ cc_library {
|
|||
"ubsan_undefined",
|
||||
"ubsan_nullability",
|
||||
] + select({
|
||||
"//build/bazel/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -4092,8 +4092,8 @@ cc_library {
|
|||
"ubsan_undefined",
|
||||
"ubsan_nullability",
|
||||
] + select({
|
||||
"//build/bazel/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -4221,21 +4221,21 @@ cc_library {
|
|||
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//conditions:default": [],
|
||||
})`}),
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//conditions:default": [],
|
||||
})`}),
|
||||
},
|
||||
|
@ -4266,14 +4266,14 @@ cc_library {
|
|||
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
|
||||
"//conditions:default": ["-android_thin_lto"],
|
||||
})`,
|
||||
}),
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
|
||||
"//conditions:default": ["-android_thin_lto"],
|
||||
})`,
|
||||
}),
|
||||
|
@ -4401,14 +4401,14 @@ cc_library {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["visibility_hidden"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
}),
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["visibility_hidden"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -4440,7 +4440,7 @@ cc_library {
|
|||
"flag_values": `{
|
||||
"//build/bazel/rules/apex:api_domain": "myapex",
|
||||
}`,
|
||||
"constraint_values": `["//build/bazel/platforms/os:android"]`,
|
||||
"constraint_values": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
},
|
||||
),
|
||||
},
|
||||
|
@ -4574,12 +4574,12 @@ func TestCcLibraryHostLdLibs(t *testing.T) {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTargetNoRestrictions("cc_binary", "a", AttrNameToString{
|
||||
"linkopts": `["-lcommon"] + select({
|
||||
"//build/bazel/platforms/os:darwin": [
|
||||
"//build/bazel_common_rules/platforms/os:darwin": [
|
||||
"-ldarwinadditional",
|
||||
"-ldarwin",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["-llinux"],
|
||||
"//build/bazel/platforms/os:windows": ["-lwindows"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["-llinux"],
|
||||
"//build/bazel_common_rules/platforms/os:windows": ["-lwindows"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -4632,14 +4632,14 @@ cc_library {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_cfi"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
}),
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_cfi"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -4737,8 +4737,8 @@ cc_library_shared {
|
|||
}),
|
||||
MakeBazelTarget("cc_library_shared", "foo_with_arch_variant_stem", AttrNameToString{
|
||||
"stem": `select({
|
||||
"//build/bazel/platforms/arch:arm": "foo-arm",
|
||||
"//build/bazel/platforms/arch:arm64": "foo-arm64",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "foo-arm",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "foo-arm64",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -5122,35 +5122,35 @@ cc_library {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTargetNoRestrictions("cc_library_shared", "lib32", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"] + select({
|
||||
"//build/bazel/platforms/arch:arm64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/arch:riscv64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["@platforms//:incompatible"],
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/arch:riscv64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
MakeBazelTargetNoRestrictions("cc_library_static", "lib32_bp2build_cc_library_static", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"] + select({
|
||||
"//build/bazel/platforms/arch:arm64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/arch:riscv64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["@platforms//:incompatible"],
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/arch:riscv64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
MakeBazelTargetNoRestrictions("cc_library_shared", "lib64", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/arch:x86": ["@platforms//:incompatible"],
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
MakeBazelTargetNoRestrictions("cc_library_static", "lib64_bp2build_cc_library_static", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/arch:x86": ["@platforms//:incompatible"],
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -103,9 +103,9 @@ cc_library_headers {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
|
||||
"export_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm64": ["arch_arm64_exported_include_dir"],
|
||||
"//build/bazel/platforms/arch:x86": ["arch_x86_exported_include_dir"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["arch_arm64_exported_include_dir"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["arch_x86_exported_include_dir"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir"],
|
||||
"//conditions:default": [],
|
||||
}) + [
|
||||
"dir-1",
|
||||
|
@ -180,11 +180,11 @@ cc_library_headers {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
|
||||
"deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":android-lib"],
|
||||
"//build/bazel/platforms/os:darwin": [":darwin-lib"],
|
||||
"//build/bazel/platforms/os:linux_bionic": [":linux_bionic-lib"],
|
||||
"//build/bazel/platforms/os:linux_glibc": [":linux-lib"],
|
||||
"//build/bazel/platforms/os:windows": [":windows-lib"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":android-lib"],
|
||||
"//build/bazel_common_rules/platforms/os:darwin": [":darwin-lib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [":linux_bionic-lib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": [":linux-lib"],
|
||||
"//build/bazel_common_rules/platforms/os:windows": [":windows-lib"],
|
||||
"//conditions:default": [],
|
||||
}) + [":base-lib"]`,
|
||||
}),
|
||||
|
@ -217,7 +217,7 @@ cc_library_headers {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
|
||||
"deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":exported-lib"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":exported-lib"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -268,13 +268,13 @@ func TestCcLibraryHeadersArchAndTargetExportSystemIncludes(t *testing.T) {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
|
||||
"export_system_includes": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_include_dir"],
|
||||
"//build/bazel/platforms/os:darwin": ["darwin_include_dir"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["linux_include_dir"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_include_dir"],
|
||||
"//build/bazel_common_rules/platforms/os:darwin": ["darwin_include_dir"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["linux_include_dir"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm_include_dir"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["x86_64_include_dir"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm_include_dir"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["x86_64_include_dir"],
|
||||
"//conditions:default": [],
|
||||
}) + ["shared_include_dir"]`,
|
||||
}),
|
||||
|
|
|
@ -204,11 +204,11 @@ cc_library_shared {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
|
||||
"implementation_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [":shared_dep"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [":shared_dep"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [":static_dep"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [":static_dep"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -233,7 +233,7 @@ cc_library_shared {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
|
||||
"implementation_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":shared_dep"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":shared_dep"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -266,10 +266,10 @@ cc_library_shared {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
|
||||
"implementation_dynamic_deps": `[":shared_dep"] + select({
|
||||
"//build/bazel/platforms/arch:arm64": [":shared_dep3"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [":shared_dep3"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": [":shared_dep2"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":shared_dep2"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -472,7 +472,7 @@ cc_library_shared {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["-link_crt"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["-link_crt"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs": `["impl.cpp"]`,
|
||||
|
@ -1006,8 +1006,8 @@ cc_library_shared {
|
|||
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
|
||||
"srcs_c": `["foo.c"]`,
|
||||
"suffix": `select({
|
||||
"//build/bazel/platforms/arch:arm": "-32",
|
||||
"//build/bazel/platforms/arch:arm64": "-64",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "-32",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "-64",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}),
|
||||
|
@ -1068,7 +1068,7 @@ cc_library_shared {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
|
||||
"srcs": `select({
|
||||
"//build/bazel/platforms/os:android": ["bar.sysprop"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1081,7 +1081,7 @@ cc_library_shared {
|
|||
"local_includes": `["."]`,
|
||||
"min_sdk_version": `"5"`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1201,8 +1201,8 @@ cc_library_shared {
|
|||
"ubsan_undefined",
|
||||
"ubsan_nullability",
|
||||
] + select({
|
||||
"//build/bazel/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -1303,11 +1303,11 @@ cc_library_shared {
|
|||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//conditions:default": [],
|
||||
})`}),
|
||||
},
|
||||
|
@ -1336,7 +1336,7 @@ cc_library_shared {
|
|||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
|
||||
"//conditions:default": ["-android_thin_lto"],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1400,7 +1400,7 @@ cc_library_shared{
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["visibility_hidden"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -1510,7 +1510,7 @@ cc_library_shared {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_cfi"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
|
|
@ -410,11 +410,11 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"implementation_deps": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [":static_dep"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [":static_dep"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/arch:arm64": [":static_dep2"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [":static_dep2"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -442,11 +442,11 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"implementation_deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":static_dep"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":static_dep"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":static_dep2"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":static_dep2"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -484,10 +484,10 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"implementation_deps": `[":static_dep"] + select({
|
||||
"//build/bazel/platforms/arch:arm64": [":static_dep4"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [":static_dep4"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": [":static_dep3"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":static_dep3"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"whole_archive_deps": `[":static_dep2"]`,
|
||||
|
@ -539,7 +539,7 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs_c": `["common.c"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["foo-arm.c"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["foo-arm.c"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -569,7 +569,7 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs_c": `["common.c"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["for-arm.c"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["for-arm.c"],
|
||||
"//conditions:default": ["not-for-arm.c"],
|
||||
})`,
|
||||
}),
|
||||
|
@ -601,11 +601,11 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs_c": `["common.c"] + select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
"not-for-x86.c",
|
||||
"for-arm.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
"not-for-arm.c",
|
||||
"for-x86.c",
|
||||
],
|
||||
|
@ -650,25 +650,25 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs_c": `["common.c"] + select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
"not-for-arm64.c",
|
||||
"not-for-x86.c",
|
||||
"not-for-x86_64.c",
|
||||
"for-arm.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
"not-for-arm.c",
|
||||
"not-for-x86.c",
|
||||
"not-for-x86_64.c",
|
||||
"for-arm64.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
"not-for-arm.c",
|
||||
"not-for-arm64.c",
|
||||
"not-for-x86_64.c",
|
||||
"for-x86.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
"not-for-arm.c",
|
||||
"not-for-arm64.c",
|
||||
"not-for-x86.c",
|
||||
|
@ -707,7 +707,7 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs": `["common.cc"] + select({
|
||||
"//build/bazel/platforms/arch:arm": [],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [],
|
||||
"//conditions:default": ["foo-no-arm.cc"],
|
||||
})`,
|
||||
}),
|
||||
|
@ -738,8 +738,8 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs": `["common.cc"] + select({
|
||||
"//build/bazel/platforms/arch:arm": [],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
"foo-no-arm.cc",
|
||||
"x86-only.cc",
|
||||
],
|
||||
|
@ -792,8 +792,8 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs_c": `["common.c"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["for-lib32.c"],
|
||||
"//build/bazel/platforms/arch:x86": ["for-lib32.c"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["for-lib32.c"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["for-lib32.c"],
|
||||
"//conditions:default": ["not-for-lib32.c"],
|
||||
})`,
|
||||
}),
|
||||
|
@ -824,23 +824,23 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs_c": `["common.c"] + select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
"not-for-lib64.c",
|
||||
"for-lib32.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
"not-for-lib32.c",
|
||||
"for-lib64.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:riscv64": [
|
||||
"//build/bazel_common_rules/platforms/arch:riscv64": [
|
||||
"not-for-lib32.c",
|
||||
"for-lib64.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
"not-for-lib64.c",
|
||||
"for-lib32.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
"not-for-lib32.c",
|
||||
"for-lib64.c",
|
||||
],
|
||||
|
@ -895,7 +895,7 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs_c": `["common.c"] + select({
|
||||
"//build/bazel/platforms/arch:arm": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [
|
||||
"not-for-arm64.c",
|
||||
"not-for-lib64.c",
|
||||
"not-for-riscv64.c",
|
||||
|
@ -904,7 +904,7 @@ cc_library_static {
|
|||
"for-arm.c",
|
||||
"for-lib32.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:arm64": [
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": [
|
||||
"not-for-arm.c",
|
||||
"not-for-lib32.c",
|
||||
"not-for-riscv64.c",
|
||||
|
@ -913,7 +913,7 @@ cc_library_static {
|
|||
"for-arm64.c",
|
||||
"for-lib64.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:riscv64": [
|
||||
"//build/bazel_common_rules/platforms/arch:riscv64": [
|
||||
"not-for-arm.c",
|
||||
"not-for-arm64.c",
|
||||
"not-for-lib32.c",
|
||||
|
@ -922,7 +922,7 @@ cc_library_static {
|
|||
"for-riscv64.c",
|
||||
"for-lib64.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [
|
||||
"not-for-arm.c",
|
||||
"not-for-arm64.c",
|
||||
"not-for-lib64.c",
|
||||
|
@ -931,7 +931,7 @@ cc_library_static {
|
|||
"for-x86.c",
|
||||
"for-lib32.c",
|
||||
],
|
||||
"//build/bazel/platforms/arch:x86_64": [
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [
|
||||
"not-for-arm.c",
|
||||
"not-for-arm64.c",
|
||||
"not-for-lib32.c",
|
||||
|
@ -1089,20 +1089,20 @@ cc_library_static {
|
|||
"//dep:generated_src_other_pkg",
|
||||
":generated_hdr",
|
||||
] + select({
|
||||
"//build/bazel/platforms/arch:x86": ["for-x86.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["for-x86.cpp"],
|
||||
"//conditions:default": [
|
||||
"not-for-x86.cpp",
|
||||
":generated_src_not_x86",
|
||||
],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os:android": [":generated_src_android"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":generated_src_android"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"hdrs": `select({
|
||||
"//build/bazel/platforms/os:android": ["//dep:generated_hdr_other_pkg_android"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["//dep:generated_hdr_other_pkg_android"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/arch:x86": ["//dep:generated_hdr_other_pkg_x86"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["//dep:generated_hdr_other_pkg_x86"],
|
||||
"//conditions:default": [],
|
||||
}) + ["//dep:generated_hdr_other_pkg"]`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -1147,15 +1147,15 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
|
||||
"srcs_c": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_src.c"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_src.c"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": ["android_arm_src.c"],
|
||||
"//build/bazel/platforms/os_arch:android_arm64": ["android_arm64_src.c"],
|
||||
"//build/bazel/platforms/os_arch:android_x86": ["android_x86_src.c"],
|
||||
"//build/bazel/platforms/os_arch:android_x86_64": ["android_x86_64_src.c"],
|
||||
"//build/bazel/platforms/os_arch:linux_bionic_arm64": ["linux_bionic_arm64_src.c"],
|
||||
"//build/bazel/platforms/os_arch:linux_bionic_x86_64": ["linux_bionic_x86_64_src.c"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_arm_src.c"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_arm64_src.c"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_x86_src.c"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_x86_64_src.c"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64": ["linux_bionic_arm64_src.c"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_bionic_x86_64": ["linux_bionic_x86_64_src.c"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1358,7 +1358,7 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "target_bionic_empty", AttrNameToString{
|
||||
"system_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1392,7 +1392,7 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "target_linux_bionic_empty", AttrNameToString{
|
||||
"system_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1477,9 +1477,9 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "target_bionic", AttrNameToString{
|
||||
"system_dynamic_deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":libc"],
|
||||
"//build/bazel/platforms/os:linux_bionic": [":libc"],
|
||||
"//build/bazel/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":libc"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [":libc"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1512,8 +1512,8 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "target_linux_bionic", AttrNameToString{
|
||||
"system_dynamic_deps": `[":libc"] + select({
|
||||
"//build/bazel/platforms/os:linux_bionic": [":libm"],
|
||||
"//build/bazel/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [":libm"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1837,7 +1837,7 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
|
||||
"srcs": `select({
|
||||
"//build/bazel/platforms/os:android": ["bar.sysprop"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1850,7 +1850,7 @@ cc_library_static {
|
|||
"local_includes": `["."]`,
|
||||
"min_sdk_version": `"5"`,
|
||||
"whole_archive_deps": `select({
|
||||
"//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -1930,8 +1930,8 @@ cc_library_static {
|
|||
"ubsan_undefined",
|
||||
"ubsan_nullability",
|
||||
] + select({
|
||||
"//build/bazel/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -2032,11 +2032,11 @@ cc_library_static {
|
|||
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
|
||||
"//conditions:default": [],
|
||||
})`}),
|
||||
},
|
||||
|
@ -2065,7 +2065,7 @@ cc_library_static {
|
|||
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_thin_lto"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
|
||||
"//conditions:default": ["-android_thin_lto"],
|
||||
})`,
|
||||
}),
|
||||
|
@ -2129,7 +2129,7 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["visibility_hidden"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
@ -2174,7 +2174,7 @@ cc_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_cfi"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
|
|
|
@ -232,11 +232,11 @@ func TestCcObjectCflagsOneArch(t *testing.T) {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_object", "foo", AttrNameToString{
|
||||
"copts": `["-fno-addrsig"] + select({
|
||||
"//build/bazel/platforms/arch:x86": ["-fPIC"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["-fPIC"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs": `["a.cpp"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["arch/arm/file.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arch/arm/file.cpp"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"system_dynamic_deps": `[]`,
|
||||
|
@ -276,17 +276,17 @@ func TestCcObjectCflagsFourArch(t *testing.T) {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_object", "foo", AttrNameToString{
|
||||
"copts": `["-fno-addrsig"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["-Wall"],
|
||||
"//build/bazel/platforms/arch:arm64": ["-Wall"],
|
||||
"//build/bazel/platforms/arch:x86": ["-fPIC"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["-fPIC"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["-Wall"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["-Wall"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["-fPIC"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["-fPIC"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs": `["base.cpp"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm.cpp"],
|
||||
"//build/bazel/platforms/arch:arm64": ["arm64.cpp"],
|
||||
"//build/bazel/platforms/arch:x86": ["x86.cpp"],
|
||||
"//build/bazel/platforms/arch:x86_64": ["x86_64.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["arm64.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["x86.cpp"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": ["x86_64.cpp"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"system_dynamic_deps": `[]`,
|
||||
|
@ -364,15 +364,15 @@ cc_object {
|
|||
MakeBazelTarget("cc_object", "foo", AttrNameToString{
|
||||
"copts": `["-fno-addrsig"]`,
|
||||
"objs": `select({
|
||||
"//build/bazel/platforms/arch:arm": [":arm_obj"],
|
||||
"//build/bazel/platforms/arch:x86": [":x86_obj"],
|
||||
"//build/bazel/platforms/arch:x86_64": [":x86_64_obj"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": [":arm_obj"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [":x86_obj"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": [":x86_64_obj"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"linker_script": `select({
|
||||
"//build/bazel/platforms/arch:arm": "arm.lds",
|
||||
"//build/bazel/platforms/arch:x86": "x86.lds",
|
||||
"//build/bazel/platforms/arch:x86_64": "x86_64.lds",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "arm.lds",
|
||||
"//build/bazel_common_rules/platforms/arch:x86": "x86.lds",
|
||||
"//build/bazel_common_rules/platforms/arch:x86_64": "x86_64.lds",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
"srcs": `["base.cpp"]`,
|
||||
|
@ -405,18 +405,18 @@ func TestCcObjectSelectOnLinuxAndBionicArchs(t *testing.T) {
|
|||
MakeBazelTarget("cc_object", "foo", AttrNameToString{
|
||||
"copts": `["-fno-addrsig"]`,
|
||||
"srcs": `["base.cpp"] + select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"linux_arm64.cpp",
|
||||
"bionic_arm64.cpp",
|
||||
],
|
||||
"//build/bazel/platforms/os_arch:android_x86": ["linux_x86.cpp"],
|
||||
"//build/bazel/platforms/os_arch:linux_bionic_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86": ["linux_x86.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64": [
|
||||
"linux_arm64.cpp",
|
||||
"bionic_arm64.cpp",
|
||||
],
|
||||
"//build/bazel/platforms/os_arch:linux_glibc_x86": ["linux_x86.cpp"],
|
||||
"//build/bazel/platforms/os_arch:linux_musl_arm64": ["linux_arm64.cpp"],
|
||||
"//build/bazel/platforms/os_arch:linux_musl_x86": ["linux_x86.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86": ["linux_x86.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_musl_arm64": ["linux_arm64.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_musl_x86": ["linux_x86.cpp"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -95,8 +95,8 @@ cc_prebuilt_binary {
|
|||
}`, ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_prebuilt_binary", "bintest", AttrNameToString{
|
||||
"src": `select({
|
||||
"//build/bazel/platforms/arch:arm": "binb",
|
||||
"//build/bazel/platforms/arch:arm64": "bina",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "binb",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "bina",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -76,21 +76,21 @@ cc_prebuilt_library {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
|
||||
"static_library": `select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
})`}),
|
||||
MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static_alwayslink", AttrNameToString{
|
||||
"alwayslink": "True",
|
||||
"static_library": `select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
})`}),
|
||||
MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
|
||||
"shared_library": `select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}),
|
||||
|
@ -289,16 +289,16 @@ cc_prebuilt_library {
|
|||
MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
|
||||
"shared_library": `"libf.so"`,
|
||||
"export_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
|
||||
"static_library": `"libf.so"`,
|
||||
"export_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -306,8 +306,8 @@ cc_prebuilt_library {
|
|||
"alwayslink": "True",
|
||||
"static_library": `"libf.so"`,
|
||||
"export_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -336,16 +336,16 @@ cc_prebuilt_library {
|
|||
MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
|
||||
"shared_library": `"libf.so"`,
|
||||
"export_system_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
|
||||
"static_library": `"libf.so"`,
|
||||
"export_system_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -353,8 +353,8 @@ cc_prebuilt_library {
|
|||
"alwayslink": "True",
|
||||
"static_library": `"libf.so"`,
|
||||
"export_system_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -381,11 +381,11 @@ ndk_prebuilt_shared_stl {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_prebuilt_library_static", "ndk_libfoo_static", AttrNameToString{
|
||||
"static_library": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_static.a",
|
||||
"//build/bazel/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_static.a",
|
||||
"//build/bazel/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_static.a",
|
||||
"//build/bazel/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_static.a",
|
||||
"//build/bazel/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_static.a",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_static.a",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_static.a",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_static.a",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_static.a",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_static.a",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
"export_system_includes": `[
|
||||
|
@ -395,11 +395,11 @@ ndk_prebuilt_shared_stl {
|
|||
}),
|
||||
MakeBazelTarget("cc_prebuilt_library_shared", "ndk_libfoo_shared", AttrNameToString{
|
||||
"shared_library": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_shared.so",
|
||||
"//build/bazel/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_shared.so",
|
||||
"//build/bazel/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_shared.so",
|
||||
"//build/bazel/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_shared.so",
|
||||
"//build/bazel/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_shared.so",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_shared.so",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_shared.so",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_shared.so",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_shared.so",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_shared.so",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
"export_system_includes": `[
|
||||
|
|
|
@ -68,8 +68,8 @@ cc_prebuilt_library_shared {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
|
||||
"shared_library": `select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}),
|
||||
|
@ -125,8 +125,8 @@ cc_prebuilt_library_shared {
|
|||
MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
|
||||
"shared_library": `"libf.so"`,
|
||||
"export_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -155,8 +155,8 @@ cc_prebuilt_library_shared {
|
|||
MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
|
||||
"shared_library": `"libf.so"`,
|
||||
"export_system_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -52,8 +52,8 @@ cc_prebuilt_library_shared {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
|
||||
"shared_library": `select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -72,15 +72,15 @@ cc_prebuilt_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
|
||||
"static_library": `select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
})`}),
|
||||
MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
|
||||
"alwayslink": "True",
|
||||
"static_library": `select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
})`}),
|
||||
},
|
||||
|
@ -141,8 +141,8 @@ cc_prebuilt_library_static {
|
|||
MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
|
||||
"static_library": `"libf.so"`,
|
||||
"export_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -150,8 +150,8 @@ cc_prebuilt_library_static {
|
|||
"alwayslink": "True",
|
||||
"static_library": `"libf.so"`,
|
||||
"export_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -180,8 +180,8 @@ cc_prebuilt_library_static {
|
|||
MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
|
||||
"static_library": `"libf.so"`,
|
||||
"export_system_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -189,8 +189,8 @@ cc_prebuilt_library_static {
|
|||
"alwayslink": "True",
|
||||
"static_library": `"libf.so"`,
|
||||
"export_system_includes": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -69,15 +69,15 @@ cc_prebuilt_library_static {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
|
||||
"static_library": `select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
})`}),
|
||||
MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
|
||||
"alwayslink": "True",
|
||||
"static_library": `select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
})`}),
|
||||
},
|
||||
|
|
|
@ -71,8 +71,8 @@ cc_prebuilt_object {
|
|||
}`, ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_prebuilt_object", "objtest", AttrNameToString{
|
||||
"src": `select({
|
||||
"//build/bazel/platforms/arch:arm": "objb.o",
|
||||
"//build/bazel/platforms/arch:arm64": "obja.o",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "objb.o",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "obja.o",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -117,26 +117,26 @@ cc_test_library {
|
|||
":libgtest_main",
|
||||
":libgtest",
|
||||
] + select({
|
||||
"//build/bazel/platforms/os:darwin": [":hostlib"],
|
||||
"//build/bazel/platforms/os:linux_bionic": [":hostlib"],
|
||||
"//build/bazel/platforms/os:linux_glibc": [":hostlib"],
|
||||
"//build/bazel/platforms/os:linux_musl": [":hostlib"],
|
||||
"//build/bazel/platforms/os:windows": [":hostlib"],
|
||||
"//build/bazel_common_rules/platforms/os:darwin": [":hostlib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": [":hostlib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": [":hostlib"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": [":hostlib"],
|
||||
"//build/bazel_common_rules/platforms/os:windows": [":hostlib"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
"dynamic_deps": `[":cc_test_lib2"] + select({
|
||||
"//build/bazel/platforms/os:android": [":foolib"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":foolib"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs": `["test.cpp"] + select({
|
||||
"//build/bazel/platforms/os:android": [
|
||||
"//build/bazel_common_rules/platforms/os:android": [
|
||||
"linux.cpp",
|
||||
"android.cpp",
|
||||
],
|
||||
"//build/bazel/platforms/os:linux_bionic": ["linux.cpp"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["linux.cpp"],
|
||||
"//build/bazel/platforms/os:linux_musl": ["linux.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_bionic": ["linux.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["linux.cpp"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_musl": ["linux.cpp"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"runs_on": `[
|
||||
|
@ -144,7 +144,7 @@ cc_test_library {
|
|||
"device",
|
||||
]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -178,7 +178,7 @@ cc_test {
|
|||
"device",
|
||||
]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -217,7 +217,7 @@ cc_test {
|
|||
"device",
|
||||
]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -248,7 +248,7 @@ cc_test {
|
|||
{"cc_test", "mytest", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["test.cpp"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"test_config": `"test_config.xml"`,
|
||||
"deps": `[
|
||||
":libgtest_main",
|
||||
|
@ -256,7 +256,7 @@ cc_test {
|
|||
]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -287,7 +287,7 @@ cc_test {
|
|||
{"cc_test", "mytest", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["test.cpp"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"test_config": `"AndroidTest.xml"`,
|
||||
"dynamic_config": `"DynamicConfig.xml"`,
|
||||
"deps": `[
|
||||
|
@ -296,7 +296,7 @@ cc_test {
|
|||
]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -330,7 +330,7 @@ cc_test {
|
|||
"auto_generate_test_config": "True",
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["test.cpp"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"template_configs": `[
|
||||
"'<target_preparer class=\"com.android.tradefed.targetprep.RootTargetPreparer\">\\n <option name=\"force-root\" value=\"false\" />\\n </target_preparer>'",
|
||||
"'<option name=\"not-shardable\" value=\"true\" />'",
|
||||
|
@ -341,7 +341,7 @@ cc_test {
|
|||
"dynamic_deps": `[":liblog"]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -369,14 +369,14 @@ cc_test {
|
|||
{"cc_test", "mytest", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["test.cpp"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"deps": `[
|
||||
":libgtest",
|
||||
":libgtest_main",
|
||||
]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -405,12 +405,12 @@ cc_test {
|
|||
{"cc_test", "mytest", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["test.cpp"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"deps": `[":libgtest_isolated_main"]`,
|
||||
"dynamic_deps": `[":liblog"]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -446,10 +446,10 @@ cc_test {
|
|||
":libgtest",
|
||||
]`,
|
||||
"gtest": "True",
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -460,10 +460,10 @@ cc_test {
|
|||
{"cc_test", "mytest_with_no_gtest", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"gtest": "False",
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -495,12 +495,12 @@ cc_test {
|
|||
{"cc_test", "mytest", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["test.cpp"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"deps": `[":libgtest_isolated_main"]`,
|
||||
"dynamic_deps": `[":liblog"]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `["android_cfi"] + select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": ["-memtag_heap"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": ["-memtag_heap"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
},
|
||||
|
@ -532,12 +532,12 @@ cc_test {
|
|||
{"cc_test", "mytest", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["test.cpp"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"deps": `[":libgtest_isolated_main"]`,
|
||||
"dynamic_deps": `[":liblog"]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": ["-memtag_heap"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": ["-memtag_heap"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
},
|
||||
|
@ -569,12 +569,12 @@ cc_test {
|
|||
{"cc_test", "mytest", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["test.cpp"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"deps": `[":libgtest_isolated_main"]`,
|
||||
"dynamic_deps": `[":liblog"]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"memtag_heap",
|
||||
"diag_memtag_heap",
|
||||
],
|
||||
|
@ -615,12 +615,12 @@ cc_test {
|
|||
{"cc_test", "mytest", AttrNameToString{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["test.cpp"]`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"deps": `[":libgtest_isolated_main"]`,
|
||||
"dynamic_deps": `[":liblog"]`,
|
||||
"runs_on": `["device"]`,
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm64": [
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": [
|
||||
"-memtag_heap",
|
||||
"-diag_memtag_heap",
|
||||
],
|
||||
|
|
|
@ -126,14 +126,14 @@ cc_library {
|
|||
MakeBazelTarget("yasm", "foo_yasm", map[string]string{
|
||||
"include_dirs": `["."]`,
|
||||
"srcs": `select({
|
||||
"//build/bazel/platforms/arch:x86": ["myfile.asm"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["myfile.asm"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
}, makeCcLibraryTargets("foo", map[string]string{
|
||||
"local_includes": `["."]`,
|
||||
"srcs": `["main.cpp"] + select({
|
||||
"//build/bazel/platforms/arch:x86": [":foo_yasm"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": [":foo_yasm"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
})...),
|
||||
|
@ -164,7 +164,7 @@ cc_library {
|
|||
MakeBazelTarget("yasm", "foo_yasm", map[string]string{
|
||||
"include_dirs": `["."]`,
|
||||
"srcs": `["myfile.asm"] + select({
|
||||
"//build/bazel/platforms/arch:x86": ["mysecondfile.asm"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["mysecondfile.asm"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -50,8 +50,8 @@ fdo_profile {
|
|||
}`,
|
||||
expectedBazelAttrs: AttrNameToString{
|
||||
"profile": `select({
|
||||
"//build/bazel/platforms/arch:arm": "foo_arm.afdo",
|
||||
"//build/bazel/platforms/arch:arm64": "foo_arm64.afdo",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "foo_arm.afdo",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "foo_arm64.afdo",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
},
|
||||
|
|
|
@ -681,11 +681,11 @@ func TestCcGenruleArchAndExcludeSrcs(t *testing.T) {
|
|||
|
||||
expectedBazelAttrs := AttrNameToString{
|
||||
"srcs": `["foo1.in"] + select({
|
||||
"//build/bazel/platforms/arch:arm": ["foo1_arch.in"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["foo1_arch.in"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"cmd": `"cat $(SRCS) > $(OUTS)"`,
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
}
|
||||
|
||||
expectedBazelTargets := []string{
|
||||
|
|
|
@ -84,8 +84,8 @@ bootstrap_go_package {
|
|||
"foo1.go",
|
||||
"foo2.go",
|
||||
] + select({
|
||||
"//build/bazel/platforms/os:darwin": ["foo_darwin.go"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["foo_linux.go"],
|
||||
"//build/bazel_common_rules/platforms/os:darwin": ["foo_darwin.go"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["foo_linux.go"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
},
|
||||
|
@ -98,8 +98,8 @@ bootstrap_go_package {
|
|||
"foo1_test.go",
|
||||
"foo2_test.go",
|
||||
] + select({
|
||||
"//build/bazel/platforms/os:darwin": ["foo_darwin_test.go"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["foo_linux_test.go"],
|
||||
"//build/bazel_common_rules/platforms/os:darwin": ["foo_darwin_test.go"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["foo_linux_test.go"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
},
|
||||
|
|
|
@ -63,7 +63,7 @@ func TestJavaBinaryHost(t *testing.T) {
|
|||
"java_version": `"8"`,
|
||||
"javacopts": `["-Xdoclint:all/protected"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -71,7 +71,7 @@ func TestJavaBinaryHost(t *testing.T) {
|
|||
"main_class": `"com.android.test.MainClass"`,
|
||||
"jvm_flags": `["-Djava.library.path=$${RUNPATH}other/jni-lib-1"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"runtime_deps": `[":java-binary-host-1_lib"]`,
|
||||
|
@ -102,7 +102,7 @@ java_library {
|
|||
"main_class": `"com.android.test.MainClass"`,
|
||||
"runtime_deps": `[":java-dep-1"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -132,14 +132,14 @@ java_import_host{
|
|||
"srcs": `["a.java"]`,
|
||||
"deps": `[":java-lib-dep-1-neverlink"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
MakeBazelTarget("java_binary", "java-binary-host-libs", AttrNameToString{
|
||||
"main_class": `"com.android.test.MainClass"`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"runtime_deps": `[":java-binary-host-libs_lib"]`,
|
||||
|
@ -165,7 +165,7 @@ func TestJavaBinaryHostKotlinSrcs(t *testing.T) {
|
|||
"b.kt",
|
||||
]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -173,7 +173,7 @@ func TestJavaBinaryHostKotlinSrcs(t *testing.T) {
|
|||
"main_class": `"com.android.test.MainClass"`,
|
||||
"runtime_deps": `[":java-binary-host_lib"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -197,7 +197,7 @@ func TestJavaBinaryHostKotlinCommonSrcs(t *testing.T) {
|
|||
"srcs": `["a.java"]`,
|
||||
"common_srcs": `["b.kt"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -205,7 +205,7 @@ func TestJavaBinaryHostKotlinCommonSrcs(t *testing.T) {
|
|||
"main_class": `"com.android.test.MainClass"`,
|
||||
"runtime_deps": `[":java-binary-host_lib"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -240,7 +240,7 @@ func TestJavaBinaryHostKotlinWithResourceDir(t *testing.T) {
|
|||
]`,
|
||||
"resource_strip_prefix": `"res"`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -248,7 +248,7 @@ func TestJavaBinaryHostKotlinWithResourceDir(t *testing.T) {
|
|||
"main_class": `"com.android.test.MainClass"`,
|
||||
"runtime_deps": `[":java-binary-host_lib"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -286,7 +286,7 @@ func TestJavaBinaryHostKotlinWithResources(t *testing.T) {
|
|||
]`,
|
||||
"resource_strip_prefix": `"adir"`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -294,7 +294,7 @@ func TestJavaBinaryHostKotlinWithResources(t *testing.T) {
|
|||
"main_class": `"com.android.test.MainClass"`,
|
||||
"runtime_deps": `[":java-binary-host_lib"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -321,7 +321,7 @@ func TestJavaBinaryHostKotlinCflags(t *testing.T) {
|
|||
"-flag2",
|
||||
]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -329,7 +329,7 @@ func TestJavaBinaryHostKotlinCflags(t *testing.T) {
|
|||
"main_class": `"com.android.test.MainClass"`,
|
||||
"runtime_deps": `[":java-binary-host_lib"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -88,8 +88,8 @@ java_import {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("java_import", "example_import", AttrNameToString{
|
||||
"jars": `select({
|
||||
"//build/bazel/platforms/os:android": ["android.jar"],
|
||||
"//build/bazel/platforms/os:linux_glibc": ["linux.jar"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["android.jar"],
|
||||
"//build/bazel_common_rules/platforms/os:linux_glibc": ["linux.jar"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -780,7 +780,7 @@ android_library {
|
|||
AttrNameToString{
|
||||
"srcs": `["lib.java"] + select({
|
||||
"//build/bazel/platforms/arch/variants:arm-neon": [],
|
||||
"//build/bazel/platforms/arch:arm": ["arm_non_neon.java"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm_non_neon.java"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"manifest": `"manifest/AndroidManifest.xml"`,
|
||||
|
@ -899,11 +899,11 @@ func TestJavaLibraryArchVariantDeps(t *testing.T) {
|
|||
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
|
||||
"srcs": `["a.java"]`,
|
||||
"exports": `select({
|
||||
"//build/bazel/platforms/os:android": [":java-lib-4"],
|
||||
"//build/bazel_common_rules/platforms/os:android": [":java-lib-4"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"deps": `[":java-lib-2-neverlink"] + select({
|
||||
"//build/bazel/platforms/os:android": [
|
||||
"//build/bazel_common_rules/platforms/os:android": [
|
||||
":java-lib-3-neverlink",
|
||||
":java-lib-4",
|
||||
],
|
||||
|
@ -934,7 +934,7 @@ func TestJavaLibraryArchVariantSrcsWithExcludes(t *testing.T) {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
|
||||
"srcs": `["b.java"] + select({
|
||||
"//build/bazel/platforms/os:android": [],
|
||||
"//build/bazel_common_rules/platforms/os:android": [],
|
||||
"//conditions:default": ["a.java"],
|
||||
})`,
|
||||
"sdk_version": `"current"`,
|
||||
|
|
|
@ -50,7 +50,7 @@ java_library_host {
|
|||
"srcs": `["a.java"]`,
|
||||
"deps": `[":java-lib-host-2-neverlink"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -58,7 +58,7 @@ java_library_host {
|
|||
"exports": `[":java-lib-host-1"]`,
|
||||
"neverlink": `True`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -66,7 +66,7 @@ java_library_host {
|
|||
"java_version": `"9"`,
|
||||
"srcs": `["c.java"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -74,7 +74,7 @@ java_library_host {
|
|||
"exports": `[":java-lib-host-2"]`,
|
||||
"neverlink": `True`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"java_version": `"9"`,
|
||||
|
|
|
@ -55,7 +55,7 @@ java_library {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"deps": `[
|
||||
|
@ -95,7 +95,7 @@ java_library {
|
|||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"deps": `[
|
||||
|
|
|
@ -64,7 +64,7 @@ java_library {
|
|||
"javacopts": `["-Xdoclint:all/protected"]`,
|
||||
"srcs": `["a.java"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -76,7 +76,7 @@ java_library {
|
|||
]`,
|
||||
"srcs": `["a.java"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -111,7 +111,7 @@ java_library {
|
|||
":static_libs_a",
|
||||
]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -137,7 +137,7 @@ java_test_host {
|
|||
]`,
|
||||
"runtime_deps": `[":java_test_host-1_lib"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -147,7 +147,7 @@ java_test_host {
|
|||
"b.kt",
|
||||
]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -80,8 +80,8 @@ prebuilt_etc {
|
|||
"filename": `"tz_version"`,
|
||||
"installable": `False`,
|
||||
"src": `select({
|
||||
"//build/bazel/platforms/arch:arm": "arm",
|
||||
"//build/bazel/platforms/arch:arm64": "arm64",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "arm",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "arm64",
|
||||
"//conditions:default": "version/tz_version",
|
||||
})`,
|
||||
"dir": `"etc/tz"`,
|
||||
|
@ -119,11 +119,11 @@ prebuilt_etc {
|
|||
"filename": `"tz_version"`,
|
||||
"installable": `False`,
|
||||
"src": `select({
|
||||
"//build/bazel/platforms/os_arch:android_arm": "arm",
|
||||
"//build/bazel/platforms/os_arch:android_arm64": "darwin_or_arm64",
|
||||
"//build/bazel/platforms/os_arch:darwin_arm64": "darwin_or_arm64",
|
||||
"//build/bazel/platforms/os_arch:darwin_x86_64": "darwin_or_arm64",
|
||||
"//build/bazel/platforms/os_arch:linux_bionic_arm64": "darwin_or_arm64",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm": "arm",
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_arm64": "darwin_or_arm64",
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_arm64": "darwin_or_arm64",
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": "darwin_or_arm64",
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64": "darwin_or_arm64",
|
||||
"//conditions:default": "version/tz_version",
|
||||
})`,
|
||||
"dir": `"etc/tz"`,
|
||||
|
@ -270,8 +270,8 @@ prebuilt_etc {
|
|||
"filename_from_src": `True`,
|
||||
"dir": `"etc"`,
|
||||
"src": `select({
|
||||
"//build/bazel/platforms/arch:arm": "barSrc",
|
||||
"//build/bazel/platforms/arch:arm64": "bazSrc",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "barSrc",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "bazSrc",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
})}})
|
||||
|
@ -317,8 +317,8 @@ prebuilt_etc {
|
|||
"filename": `"fooFilename"`,
|
||||
"dir": `"etc"`,
|
||||
"src": `select({
|
||||
"//build/bazel/platforms/arch:arm": "armSrc",
|
||||
"//build/bazel/product_config/config_settings:native_coverage-arm": "nativeCoverageArmSrc",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "armSrc",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
})}})
|
||||
|
|
|
@ -56,7 +56,7 @@ func TestPythonBinaryHostSimple(t *testing.T) {
|
|||
"b/d.py",
|
||||
]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -90,7 +90,7 @@ func TestPythonBinaryHostPy2(t *testing.T) {
|
|||
"imports": `["."]`,
|
||||
"srcs": `["a.py"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -124,7 +124,7 @@ func TestPythonBinaryHostPy3(t *testing.T) {
|
|||
"imports": `["."]`,
|
||||
"srcs": `["a.py"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -156,12 +156,12 @@ func TestPythonBinaryHostArchVariance(t *testing.T) {
|
|||
MakeBazelTarget("py_binary", "foo-arm", AttrNameToString{
|
||||
"imports": `["."]`,
|
||||
"srcs": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm.py"],
|
||||
"//build/bazel/platforms/arch:x86": ["x86.py"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm.py"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["x86.py"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -183,7 +183,7 @@ func TestPythonBinaryMainIsNotSpecified(t *testing.T) {
|
|||
MakeBazelTarget("py_binary", "foo", AttrNameToString{
|
||||
"imports": `["."]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -212,7 +212,7 @@ genrule {
|
|||
"main": `":a"`,
|
||||
"imports": `["."]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -241,7 +241,7 @@ func TestPythonBinaryMainIsSubpackageFile(t *testing.T) {
|
|||
"main": `"//a:b.py"`,
|
||||
"imports": `["."]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -269,7 +269,7 @@ func TestPythonBinaryMainIsSubDirFile(t *testing.T) {
|
|||
"main": `"a/b.py"`,
|
||||
"imports": `["."]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
@ -311,7 +311,7 @@ python_defaults {
|
|||
":r2",
|
||||
]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -25,7 +25,7 @@ type pythonLibBp2BuildTestCase struct {
|
|||
func convertPythonLibTestCaseToBp2build_Host(tc pythonLibBp2BuildTestCase) Bp2buildTestCase {
|
||||
for i := range tc.expectedBazelTargets {
|
||||
tc.expectedBazelTargets[i].attrs["target_compatible_with"] = `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`
|
||||
}
|
||||
|
@ -296,8 +296,8 @@ func TestPythonArchVariance(t *testing.T) {
|
|||
name: "foo",
|
||||
attrs: AttrNameToString{
|
||||
"srcs": `select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm.py"],
|
||||
"//build/bazel/platforms/arch:x86": ["x86.py"],
|
||||
"//build/bazel_common_rules/platforms/arch:arm": ["arm.py"],
|
||||
"//build/bazel_common_rules/platforms/arch:x86": ["x86.py"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"srcs_version": `"PY3"`,
|
||||
|
|
|
@ -58,7 +58,7 @@ func TestPythonTestHostSimple(t *testing.T) {
|
|||
"b/d.py",
|
||||
]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
}),
|
||||
|
|
|
@ -120,7 +120,7 @@ func TestShTestHostSimple(t *testing.T) {
|
|||
]`,
|
||||
"tags": `["no-remote"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
})},
|
||||
|
@ -164,7 +164,7 @@ func TestShTestAutogen(t *testing.T) {
|
|||
"srcs": `["empty.sh"]`,
|
||||
"runs_on": `["device"]`,
|
||||
"auto_generate_test_config": "True",
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
|
||||
"template_test_config": `":art-run-test-target-template"`,
|
||||
"data": `[
|
||||
"android.hardware.bluetooth@1.1-service.sim.rc",
|
||||
|
@ -220,7 +220,7 @@ func TestShTestHostAutogen(t *testing.T) {
|
|||
"runs_on": `["host_without_device"]`,
|
||||
"auto_generate_test_config": "True",
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"template_test_config": `":art-run-test-target-template"`,
|
||||
|
@ -332,7 +332,7 @@ func TestShTestHostSimpleUnset(t *testing.T) {
|
|||
]`,
|
||||
"tags": `["no-remote"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
})},
|
||||
|
|
|
@ -1207,13 +1207,13 @@ cc_binary {
|
|||
local_includes = ["."],
|
||||
srcs = ["main.cc"],
|
||||
target_compatible_with = select({
|
||||
"//build/bazel/platforms/os_arch:android_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:linux_bionic_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:linux_glibc_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:linux_musl_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_bionic_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:linux_musl_x86_64": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/product_config/config_settings:alphabet_module__special_build": [],
|
||||
|
@ -1423,7 +1423,7 @@ cc_binary {
|
|||
ExpectedBazelTargets: []string{`cc_binary(
|
||||
name = "my_binary",
|
||||
copts = select({
|
||||
"//build/bazel/platforms/os:android": ["-DFOO"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["-DFOO"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//build/bazel/product_config/config_settings:my_namespace__my_bool_variable__android": ["-DBAR"],
|
||||
|
@ -1440,7 +1440,7 @@ cc_binary {
|
|||
}),
|
||||
local_includes = ["."],
|
||||
srcs = ["main.cc"],
|
||||
target_compatible_with = ["//build/bazel/platforms/os:android"],
|
||||
target_compatible_with = ["//build/bazel_common_rules/platforms/os:android"],
|
||||
)`}})
|
||||
}
|
||||
|
||||
|
|
|
@ -682,11 +682,11 @@ func makeBazelTargetHostOrDevice(typ, name string, attrs AttrNameToString, hod a
|
|||
switch hod {
|
||||
case android.HostSupported:
|
||||
attrs["target_compatible_with"] = `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
})`
|
||||
case android.DeviceSupported:
|
||||
attrs["target_compatible_with"] = `["//build/bazel/platforms/os:android"]`
|
||||
attrs["target_compatible_with"] = `["//build/bazel_common_rules/platforms/os:android"]`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1514,7 +1514,7 @@ func createInApexConfigSetting(ctx android.Bp2buildMutatorContext, apexName stri
|
|||
Constraint_values: bazel.MakeLabelListAttribute(
|
||||
bazel.MakeLabelList(
|
||||
[]bazel.Label{
|
||||
bazel.Label{Label: "//build/bazel/platforms/os:android"},
|
||||
bazel.Label{Label: "//build/bazel_common_rules/platforms/os:android"},
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
|
@ -121,8 +121,8 @@ prebuilt_etc_xml {
|
|||
"filename_from_src": `True`,
|
||||
"dir": `"etc"`,
|
||||
"src": `select({
|
||||
"//build/bazel/platforms/arch:arm": "barSrc",
|
||||
"//build/bazel/platforms/arch:arm64": "bazSrc",
|
||||
"//build/bazel_common_rules/platforms/arch:arm": "barSrc",
|
||||
"//build/bazel_common_rules/platforms/arch:arm64": "bazSrc",
|
||||
"//conditions:default": None,
|
||||
})`,
|
||||
})}})
|
||||
|
|
Loading…
Reference in a new issue