Enable vsoc_lib to be compiled for guest
Change-Id: Ib18d851dcd698bc943077841e2d872c184706f1f
diff --git a/Android.bp b/Android.bp
index dd75563..d19dcb6 100644
--- a/Android.bp
+++ b/Android.bp
@@ -33,6 +33,32 @@
}
cc_defaults {
+ name: "cuttlefish_common",
+ gnu_extensions: false,
+ header_libs: [
+ "cuttlefish_common_headers",
+ "cuttlefish_kernel_headers",
+ ],
+ host_supported: true,
+ device_supported: true,
+ target: {
+ linux: {
+ host_ldlibs: ["-lrt"],
+ cflags: ["-DCUTTLEFISH_HOST"],
+ },
+ darwin: {
+ enabled: false,
+ },
+ android: {
+ enabled: true,
+ },
+ windows: {
+ enabled: false,
+ },
+ },
+}
+
+cc_defaults {
name: "cuttlefish_host",
gnu_extensions: false,
header_libs: [
@@ -53,7 +79,7 @@
},
}
-cc_library_host_static {
+cc_library {
name: "vsoc_lib",
srcs: [
"common/vsoc/lib/compat.cpp",
@@ -64,17 +90,34 @@
"common/vsoc/lib/region_view.cpp",
"common/vsoc/lib/wifi_exchange_layout.cpp",
"common/vsoc/lib/wifi_exchange_view.cpp",
- "host/vsoc/lib/host_lock.cpp",
- "host/vsoc/lib/region_control.cpp",
- "host/vsoc/lib/region_view.cpp",
],
- header_libs: ["cuttlefish_glog"],
+ header_libs: [
+ "cuttlefish_glog"
+ ],
static_libs: [
"libcuttlefish_fs",
"libbase",
"libgflags",
],
- defaults: ["cuttlefish_host"],
+ target: {
+ linux: {
+ host_ldlibs: ["-lrt"],
+ cflags: ["-DCUTTLEFISH_HOST"],
+ srcs: [
+ "host/vsoc/lib/host_lock.cpp",
+ "host/vsoc/lib/region_control.cpp",
+ "host/vsoc/lib/region_view.cpp",
+ ],
+ },
+ android: {
+ srcs: [
+ "guest/vsoc/lib/guest_lock.cpp",
+ "guest/vsoc/lib/region_control.cpp",
+ "guest/vsoc/lib/region_view.cpp",
+ ],
+ },
+ },
+ defaults: ["cuttlefish_common"],
}
cc_library_host_static {
diff --git a/common/libs/auto_resources/Android.bp b/common/libs/auto_resources/Android.bp
index 14ccf5f..03c1275 100644
--- a/common/libs/auto_resources/Android.bp
+++ b/common/libs/auto_resources/Android.bp
@@ -13,12 +13,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-cc_library_host_static {
+cc_library_static {
name: "cuttlefish_auto_resources",
srcs: [
"auto_resources.cpp",
],
- defaults: ["cuttlefish_host"],
+ defaults: ["cuttlefish_common"],
}
cc_test_host {
diff --git a/common/libs/fs/Android.bp b/common/libs/fs/Android.bp
index a3f9176..7d0d492 100644
--- a/common/libs/fs/Android.bp
+++ b/common/libs/fs/Android.bp
@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-cc_library_host_static {
+cc_library {
name: "libcuttlefish_fs",
srcs: [
"gce_fs.cpp",
@@ -22,6 +22,7 @@
static_libs: [
"cuttlefish_auto_resources",
"libbase",
+ "liblog",
],
- defaults: ["cuttlefish_host"],
+ defaults: ["cuttlefish_common"],
}
diff --git a/common/libs/fs/Android.mk b/common/libs/fs/Android.mk
deleted file mode 100644
index c8fdd0a..0000000
--- a/common/libs/fs/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libcuttlefish_fs
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- gce_fs.cpp \
- shared_fd.cpp
-
-LOCAL_C_INCLUDES := \
- device/google/cuttlefish_common
-
-LOCAL_SHARED_LIBRARIES := \
- libcuttlefish_auto_resources \
- libbase
-
-LOCAL_VENDOR_MODULE := true
-include $(BUILD_SHARED_LIBRARY)