Merge "Replace android.BuildOs with Config.BuildOS" am: 78fd15f7d6
am: bf2f93f8e8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1773108 Change-Id: Ib6e5eea644f359c59e597943222d3f1f51b564d0
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"android/soong/android"
|
||||
@@ -282,7 +283,7 @@ var (
|
||||
var pctx = android.NewPackageContext("android/soong/cc/config")
|
||||
|
||||
func init() {
|
||||
if android.BuildOs == android.Linux {
|
||||
if runtime.GOOS == "linux" {
|
||||
commonGlobalCflags = append(commonGlobalCflags, "-fdebug-prefix-map=/proc/self/cwd=")
|
||||
}
|
||||
|
||||
|
@@ -165,7 +165,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
|
||||
sort.Strings(ndkKnownLibs)
|
||||
ctx.Strict("NDK_KNOWN_LIBS", strings.Join(ndkKnownLibs, " "))
|
||||
|
||||
hostTargets := ctx.Config().Targets[android.BuildOs]
|
||||
hostTargets := ctx.Config().Targets[ctx.Config().BuildOS]
|
||||
makeVarsToolchain(ctx, "", hostTargets[0])
|
||||
if len(hostTargets) > 1 {
|
||||
makeVarsToolchain(ctx, "2ND_", hostTargets[1])
|
||||
|
@@ -15,6 +15,7 @@
|
||||
package cc
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"android/soong/android"
|
||||
@@ -271,8 +272,8 @@ func TestPrebuiltLibrarySharedStem(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPrebuiltSymlinkedHostBinary(t *testing.T) {
|
||||
if android.BuildOs != android.Linux {
|
||||
t.Skipf("Skipping host prebuilt testing that is only supported on %s not %s", android.Linux, android.BuildOs)
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skipf("Skipping host prebuilt testing that is only supported on linux not %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
ctx := testPrebuilt(t, `
|
||||
|
@@ -51,7 +51,7 @@ func TestProto(t *testing.T) {
|
||||
},
|
||||
}`)
|
||||
|
||||
buildOS := android.BuildOs.String()
|
||||
buildOS := ctx.Config().BuildOS.String()
|
||||
|
||||
proto := ctx.ModuleForTests("libfoo", "android_arm_armv7-a-neon_shared").Output("proto/a.pb.cc")
|
||||
foobar := ctx.ModuleForTests("protoc-gen-foobar", buildOS+"_x86_64")
|
||||
|
Reference in New Issue
Block a user