platform_build_soong/Android.bp
Dan Willemsen 581341d4f2 Native Coverage support in Soong (gcov)
This is configured the same as make -- a global NATIVE_COVERAGE=true
flag to allow native coverage, then COVERAGE_PATHS=path1,path2,... to
turn it on for certain paths.

There are .gcnodir files exported to Make and saved in $OUT/coverage/...
files which are `ar` archives containing all of the compiler-produced
.gcno files for a particular executable / shared library.

Unlike the Make implementation, this only passes links the helper
library (automatically through --coverage) when one of the object files
or static libraries being used actually has coverage enabled.

Host support is currently disabled, since we set -nodefaultlibs, which
prevents libclang_rt.profile-*.a from being picked up automatically.

Bug: 32749731
Test: NATIVE_COVERAGE=true COVERAGE_PATHS=system/core/libcutils m -j libbacktrace libutils tombstoned
      $OUT/coverage/system/lib*/libcutils.gcnodir looks correct (self)
      $OUT/coverage/system/lib*/libbacktrace.gcnodir looks correct (static)
      $OUT/coverage/system/lib*/libutils.gcnodir doesn't exist (shared)
      $OUT/coverage/system/bin/tombstoned.gcnodir looks correct (executable)
Test: NATIVE_COVERAGE=true COVERAGE_PATHS=external/libcxxabi m -j libc++
      Confirm that $OUT/coverage/system/lib*/libc++.gcnodir looks correct (whole_static_libs)
Change-Id: I48aaa0ba8d76e50e9c2d1151421c0c6dc8ed79a9
2017-02-14 13:05:48 -08:00

256 lines
5.3 KiB
Text

//
// WARNING: Modifying this file will NOT automatically regenerate build.ninja.in!
//
// Before modifying this file make sure minibp is up to date:
// 1) "repo sync build/soong" to make sure you have the latest build.ninja.in
// 2) build minibp, which builds automicatically through the normal build steps. For example:
//
// After modifying this file regenerate build.ninja.in and build your changes:
// 1) In your build directory, execute "../bootstrap.bash -r" to regenerate build.ninja.in
// 2) Build again
//
subdirs = [
"androidmk",
"cmd/*",
"third_party/zip",
"ui/*",
]
bootstrap_go_package {
name: "soong-env",
pkgPath: "android/soong/env",
srcs: [
"env/env.go",
],
}
bootstrap_go_package {
name: "soong",
pkgPath: "android/soong",
deps: [
"blueprint",
],
srcs: [
"doc.go",
],
}
bootstrap_go_package {
name: "soong-android",
pkgPath: "android/soong/android",
deps: [
"blueprint",
"blueprint-bootstrap",
"soong",
"soong-env",
],
srcs: [
"android/androidmk.go",
"android/arch.go",
"android/config.go",
"android/defaults.go",
"android/defs.go",
"android/expand.go",
"android/hooks.go",
"android/makevars.go",
"android/module.go",
"android/mutator.go",
"android/onceper.go",
"android/package_ctx.go",
"android/paths.go",
"android/prebuilt.go",
"android/register.go",
"android/util.go",
"android/variable.go",
// Lock down environment access last
"android/env.go",
],
testSrcs: [
"android/expand_test.go",
"android/paths_test.go",
"android/prebuilt_test.go",
],
}
bootstrap_go_package {
name: "soong-cc-config",
pkgPath: "android/soong/cc/config",
deps: [
"soong-android",
],
srcs: [
"cc/config/clang.go",
"cc/config/global.go",
"cc/config/tidy.go",
"cc/config/toolchain.go",
"cc/config/arm_device.go",
"cc/config/arm64_device.go",
"cc/config/mips_device.go",
"cc/config/mips64_device.go",
"cc/config/x86_device.go",
"cc/config/x86_64_device.go",
"cc/config/x86_darwin_host.go",
"cc/config/x86_linux_host.go",
"cc/config/x86_windows_host.go",
],
testSrcs: [
"cc/config/tidy_test.go",
],
}
bootstrap_go_package {
name: "soong-cc",
pkgPath: "android/soong/cc",
deps: [
"blueprint",
"blueprint-pathtools",
"soong",
"soong-android",
"soong-cc-config",
"soong-genrule",
],
srcs: [
"cc/androidmk.go",
"cc/builder.go",
"cc/cc.go",
"cc/check.go",
"cc/coverage.go",
"cc/gen.go",
"cc/makevars.go",
"cc/prebuilt.go",
"cc/proto.go",
"cc/relocation_packer.go",
"cc/sanitize.go",
"cc/stl.go",
"cc/strip.go",
"cc/tidy.go",
"cc/util.go",
"cc/cmakelists.go",
"cc/compiler.go",
"cc/installer.go",
"cc/linker.go",
"cc/binary.go",
"cc/library.go",
"cc/object.go",
"cc/test.go",
"cc/toolchain_library.go",
"cc/ndk_prebuilt.go",
"cc/ndk_headers.go",
"cc/ndk_library.go",
"cc/ndk_sysroot.go",
],
testSrcs: [
"cc/cc_test.go",
"cc/test_data_test.go",
],
pluginFor: ["soong_build"],
}
bootstrap_go_package {
name: "soong-genrule",
pkgPath: "android/soong/genrule",
deps: [
"blueprint",
"blueprint-pathtools",
"soong",
"soong-android",
],
srcs: [
"genrule/filegroup.go",
"genrule/genrule.go",
],
pluginFor: ["soong_build"],
}
bootstrap_go_package {
name: "soong-phony",
pkgPath: "android/soong/phony",
deps: [
"blueprint",
"soong-android",
],
srcs: [
"phony/phony.go",
],
pluginFor: ["soong_build"],
}
bootstrap_go_package {
name: "soong-java",
pkgPath: "android/soong/java",
deps: [
"blueprint",
"blueprint-pathtools",
"soong",
"soong-android",
"soong-genrule",
],
srcs: [
"java/androidmk.go",
"java/app_builder.go",
"java/app.go",
"java/builder.go",
"java/gen.go",
"java/java.go",
"java/resources.go",
],
pluginFor: ["soong_build"],
}
//
// Defaults to enable various configurations of host bionic
//
cc_defaults {
name: "linux_bionic_supported",
host_supported: true,
target: {
host: {
enabled: false,
},
linux_bionic: {
enabled: true,
},
},
}
//
// C static libraries extracted from the gcc toolchain
//
toolchain_library {
name: "libatomic",
defaults: ["linux_bionic_supported"],
arch: {
arm: {
instruction_set: "arm",
},
},
}
toolchain_library {
name: "libgcc",
defaults: ["linux_bionic_supported"],
arch: {
arm: {
instruction_set: "arm",
},
},
}
toolchain_library {
name: "libgcov",
defaults: ["linux_bionic_supported"],
arch: {
arm: {
instruction_set: "arm",
},
},
}