diff options
author | Steven Moreland <smoreland@google.com> | 2017-07-10 16:28:07 -0700 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2017-07-11 16:38:49 +0000 |
commit | 531c9e3f882a0ad72eab37fafb87e5ee573abf5f (patch) | |
tree | b37e34a65bc12be75011308dfb22d90ce6ea26ca | |
parent | 20b1326af5f0ed4dd32735893b50477f9718cdf6 (diff) | |
download | contexthub-531c9e3f882a0ad72eab37fafb87e5ee573abf5f.tar.gz |
Make contexthubhal build with the VNDK.
When the vndk is enabled (BOARD_VNDK_VERSION=current),
vendor libraries must only link against vendor variants
in the build system. This means that they receive restricted
sets of headers and that automatic global headers are restricted.
Also renamed device side static library "libnanohub_common" which
only provided headers to libnanohub_common_headers and made it
a header library.
Test: build contexthubhal with BOARD_VNDK_VERSION=current
Test: build, boot, use sensors (such as photosphere)
Bug: 37342627
Change-Id: I9bdaff3dc27f0fc2f45b38987ee18d7200a23f6c
-rw-r--r-- | Android.bp | 3 | ||||
-rw-r--r-- | contexthubhal/Android.mk | 5 | ||||
-rw-r--r-- | contexthubhal/nanohubhal.cpp | 2 | ||||
-rw-r--r-- | contexthubhal/nanohubhal_default.cpp | 2 | ||||
-rw-r--r-- | contexthubhal/system_comms.cpp | 2 | ||||
-rw-r--r-- | contexthubhal/test/main.cpp | 2 | ||||
-rw-r--r-- | lib/Android.bp | 5 | ||||
-rw-r--r-- | lib/Android.mk | 14 |
8 files changed, 16 insertions, 19 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 00000000..1e0d8c8f --- /dev/null +++ b/Android.bp @@ -0,0 +1,3 @@ +subdirs = [ + "lib", +] diff --git a/contexthubhal/Android.mk b/contexthubhal/Android.mk index 1600e1b6..be27d470 100644 --- a/contexthubhal/Android.mk +++ b/contexthubhal/Android.mk @@ -14,7 +14,10 @@ LOCAL_MODULE_OWNER := google # Include target-specific files. LOCAL_SRC_FILES += nanohubhal_default.cpp -LOCAL_STATIC_LIBRARIES += libnanohub_common +LOCAL_HEADER_LIBRARIES := \ + libhardware_headers \ + libnanohub_common_headers \ + libutils_headers LOCAL_MODULE := context_hub.default LOCAL_MODULE_TAGS := optional diff --git a/contexthubhal/nanohubhal.cpp b/contexthubhal/nanohubhal.cpp index 7764253b..21b63746 100644 --- a/contexthubhal/nanohubhal.cpp +++ b/contexthubhal/nanohubhal.cpp @@ -26,8 +26,8 @@ #include <hardware/context_hub.h> #include <hardware/hardware.h> -#include <utils/Log.h> #include <cutils/properties.h> +#include <log/log.h> #include <nanohub/nanohub.h> diff --git a/contexthubhal/nanohubhal_default.cpp b/contexthubhal/nanohubhal_default.cpp index 2645c612..fb5231e3 100644 --- a/contexthubhal/nanohubhal_default.cpp +++ b/contexthubhal/nanohubhal_default.cpp @@ -18,7 +18,7 @@ #include <hardware/context_hub.h> #include "nanohub_perdevice.h" #include "nanohubhal.h" -#include <utils/Log.h> +#include <log/log.h> namespace android { diff --git a/contexthubhal/system_comms.cpp b/contexthubhal/system_comms.cpp index c4e9b621..4a67a669 100644 --- a/contexthubhal/system_comms.cpp +++ b/contexthubhal/system_comms.cpp @@ -24,7 +24,7 @@ #include <vector> -#include <utils/Log.h> +#include <log/log.h> #include <endian.h> diff --git a/contexthubhal/test/main.cpp b/contexthubhal/test/main.cpp index fe21e998..f8399cef 100644 --- a/contexthubhal/test/main.cpp +++ b/contexthubhal/test/main.cpp @@ -16,8 +16,8 @@ #include <signal.h> #include <unistd.h> +#include <log/log.h> #include <sys/endian.h> -#include <utils/Log.h> #include <hardware/hardware.h> #include <hardware/context_hub.h> diff --git a/lib/Android.bp b/lib/Android.bp new file mode 100644 index 00000000..828d29ed --- /dev/null +++ b/lib/Android.bp @@ -0,0 +1,5 @@ +cc_library_headers { + name: "libnanohub_common_headers", + vendor_available: true, + export_include_dirs: ["include"], +} diff --git a/lib/Android.mk b/lib/Android.mk index e88b9757..0caa1234 100644 --- a/lib/Android.mk +++ b/lib/Android.mk @@ -58,20 +58,6 @@ LOCAL_MULTILIB := both include $(BUILD_HOST_STATIC_LIBRARY) -include $(CLEAR_VARS) - -# now-empty static library to export include files for other projects -LOCAL_MODULE := libnanohub_common -LOCAL_MODULE_TAGS := optional - -LOCAL_C_INCLUDES := \ - $(src_includes) - -LOCAL_EXPORT_C_INCLUDE_DIRS := \ - $(src_includes) - -include $(BUILD_STATIC_LIBRARY) - include $(call first-makefiles-under, $(LOCAL_PATH)) src_files := |