diff options
author | 2020-03-09 20:23:15 +0000 | |
---|---|---|
committer | 2020-03-09 20:23:15 +0000 | |
commit | a81668628e7ccda49291c4b4779b02f4772affe2 (patch) | |
tree | 9234818cbe4c704435f4b490d8bc22a843e31ef9 /cc | |
parent | a8e37b98bba2a8bf61d01b20994ced119a0387be (diff) | |
parent | a04c107bfaf9262daafecc9174bd9e85b79264bd (diff) |
Merge "Add support for multiple os types"
Diffstat (limited to 'cc')
-rw-r--r-- | cc/binary_sdk_member.go | 2 | ||||
-rw-r--r-- | cc/library_sdk_member.go | 2 | ||||
-rw-r--r-- | cc/testing.go | 23 |
3 files changed, 22 insertions, 5 deletions
diff --git a/cc/binary_sdk_member.go b/cc/binary_sdk_member.go index eddf5b805..fc9b89e75 100644 --- a/cc/binary_sdk_member.go +++ b/cc/binary_sdk_member.go @@ -78,7 +78,7 @@ const ( // path to the native binary. Relative to <sdk_root>/<api_dir> func nativeBinaryPathFor(lib nativeBinaryInfoProperties) string { - return filepath.Join(lib.archType, + return filepath.Join(lib.OsPrefix(), lib.archType, nativeBinaryDir, lib.outputFile.Base()) } diff --git a/cc/library_sdk_member.go b/cc/library_sdk_member.go index a26269772..656df6969 100644 --- a/cc/library_sdk_member.go +++ b/cc/library_sdk_member.go @@ -254,7 +254,7 @@ const ( // path to the native library. Relative to <sdk_root>/<api_dir> func nativeLibraryPathFor(lib *nativeLibInfoProperties) string { - return filepath.Join(lib.archType, + return filepath.Join(lib.OsPrefix(), lib.archType, nativeStubDir, lib.outputFile.Base()) } diff --git a/cc/testing.go b/cc/testing.go index a22763a92..b8a7eab34 100644 --- a/cc/testing.go +++ b/cc/testing.go @@ -34,7 +34,7 @@ func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) { ctx.RegisterModuleType("ndk_prebuilt_object", NdkPrebuiltObjectFactory) } -func GatherRequiredDepsForTest(os android.OsType) string { +func GatherRequiredDepsForTest(oses ...android.OsType) string { ret := ` toolchain_library { name: "libatomic", @@ -341,8 +341,9 @@ func GatherRequiredDepsForTest(os android.OsType) string { } ` - if os == android.Fuchsia { - ret += ` + for _, os := range oses { + if os == android.Fuchsia { + ret += ` cc_library { name: "libbioniccompat", stl: "none", @@ -352,6 +353,22 @@ func GatherRequiredDepsForTest(os android.OsType) string { stl: "none", } ` + } + if os == android.Windows { + ret += ` + toolchain_library { + name: "libwinpthread", + host_supported: true, + enabled: false, + target: { + windows: { + enabled: true, + }, + }, + src: "", + } + ` + } } return ret } |