When BOARD_VNDK_VERSION is set, a vendor lib cannot link against a
platform lib and is not provided with global include path. So, some
internal libraries such as swiftshader_top_[release|debug] were also
marked as vendor module and dependency to some header libs
(libhardware_headers, libnativebase_headers, etc.) were added
explicitly.
Bug:
64704866
Test: lunch sdk_gphone_x86-user, BOARD_VNDK_VERSION=current m -j
libEGL_swiftshader libGLESv1_CM_swiftshader libGLESv2_swiftshader
successful
Change-Id: I37851c9876f7f7c247bbc5d6e18946cb5bf72fa2
Reviewed-on: https://swiftshader-review.googlesource.com/11868
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
# libnativewindow is introduced from O
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo O),O)
-COMMON_SHARED_LIBRARIES := libnativewindow
+COMMON_SHARED_LIBRARIES := libnativewindow liblog
+COMMON_HEADER_LIBRARIES := libhardware_headers libnativebase_headers
+COMMON_STATIC_LIBRARIES := libarect
endif
# Marshmallow does not have stlport, but comes with libc++ by default
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_MODULE := swiftshader_top_release
+LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
LOCAL_CFLAGS := $(COMMON_CFLAGS) -fomit-frame-pointer -ffunction-sections -fdata-sections -DANGLE_DISABLE_TRACE
LOCAL_C_INCLUDES := $(COMMON_C_INCLUDES)
LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
+LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
+LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES)
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_MODULE := swiftshader_top_debug
+LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
LOCAL_CFLAGS := $(COMMON_CFLAGS) -UNDEBUG -g -O0 -DDEFAULT_THREAD_COUNT=1
LOCAL_C_INCLUDES := $(COMMON_C_INCLUDES)
LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
+LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
+LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES)
include $(BUILD_STATIC_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))
#include <sync/sync.h>
#endif
+#include <unistd.h> // for close()
+
class GrallocModule
{
public:
LOCAL_CLANG := true
LOCAL_MODULE := swiftshader_compiler_release
LOCAL_MODULE_TAGS := optional
+LOCAL_VENDOR_MODULE := true
LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
LOCAL_CFLAGS += \
$(COMMON_CFLAGS) \
-fdata-sections \
-DANGLE_DISABLE_TRACE
LOCAL_C_INCLUDES := $(COMMON_C_INCLUDES)
+LOCAL_SHARED_LIBRARIES := libcutils
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_MODULE := swiftshader_compiler_debug
LOCAL_MODULE_TAGS := optional
+LOCAL_VENDOR_MODULE := true
LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
LOCAL_CFLAGS += \
-O0
LOCAL_C_INCLUDES := $(COMMON_C_INCLUDES)
+LOCAL_SHARED_LIBRARIES := libcutils
include $(BUILD_STATIC_LIBRARY)
# libnativewindow is introduced from O
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo O),O)
COMMON_SHARED_LIBRARIES += libnativewindow
+COMMON_STATIC_LIBRARIES += libarect
+COMMON_HEADER_LIBRARIES += libnativebase_headers
endif
# gralloc1 is introduced from N MR1
LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
LOCAL_STATIC_LIBRARIES += swiftshader_top_debug $(COMMON_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES)
+LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
LOCAL_LDFLAGS += $(COMMON_LDFLAGS)
LOCAL_CFLAGS += $(COMMON_CFLAGS) -UNDEBUG -g -O0
include $(BUILD_SHARED_LIBRARY)
LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
LOCAL_STATIC_LIBRARIES += swiftshader_top_release $(COMMON_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES)
+LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
LOCAL_LDFLAGS += $(COMMON_LDFLAGS)
LOCAL_CFLAGS += $(COMMON_CFLAGS) -DANGLE_DISABLE_TRACE
include $(BUILD_SHARED_LIBRARY)
# libnativewindow is introduced from O
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo O),O)
COMMON_SHARED_LIBRARIES += libnativewindow
+COMMON_STATIC_LIBRARIES += libarect
+COMMON_HEADER_LIBRARIES := libnativebase_headers
endif
# gralloc1 is introduced from N MR1
LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
LOCAL_STATIC_LIBRARIES += swiftshader_top_debug $(COMMON_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES)
+LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
LOCAL_LDFLAGS += $(COMMON_LDFLAGS)
LOCAL_CFLAGS += $(COMMON_CFLAGS) -UNDEBUG -g -O0
include $(BUILD_SHARED_LIBRARY)
LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
LOCAL_STATIC_LIBRARIES += swiftshader_top_release $(COMMON_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES)
+LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
LOCAL_LDFLAGS += $(COMMON_LDFLAGS)
LOCAL_CFLAGS += \
$(COMMON_CFLAGS) \
# libnativewindow is introduced from O
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo O),O)
COMMON_SHARED_LIBRARIES += libnativewindow
+COMMON_STATIC_LIBRARIES += libarect
+COMMON_HEADER_LIBRARIES := libnativebase_headers
endif
# gralloc1 is introduced from N MR1
LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
LOCAL_STATIC_LIBRARIES += swiftshader_compiler_debug swiftshader_top_debug $(COMMON_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES)
+LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
LOCAL_LDFLAGS += $(COMMON_LDFLAGS)
LOCAL_CFLAGS += $(COMMON_CFLAGS) -UNDEBUG -g -O0
include $(BUILD_SHARED_LIBRARY)
LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
LOCAL_STATIC_LIBRARIES += swiftshader_compiler_release swiftshader_top_release $(COMMON_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES)
+LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
LOCAL_LDFLAGS += $(COMMON_LDFLAGS)
LOCAL_CFLAGS += \
$(COMMON_CFLAGS) \
LOCAL_MODULE := libLLVM_swiftshader
LOCAL_MODULE_TAGS := optional
+LOCAL_VENDOR_MODULE := true
LOCAL_SRC_FILES := \
lib/Analysis/AliasAnalysis.cpp \