• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LOCAL_PATH:= $(call my-dir)
2
3COMMON_C_INCLUDES := \
4	bionic \
5	$(LOCAL_PATH)/../../../include \
6	$(LOCAL_PATH)/../ \
7	$(LOCAL_PATH)/../../ \
8	$(LOCAL_PATH)/../../Renderer/ \
9	$(LOCAL_PATH)/../../Common/ \
10	$(LOCAL_PATH)/../../Shader/ \
11	$(LOCAL_PATH)/../../Main/
12
13# Marshmallow does not have stlport, but comes with libc++ by default
14ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
15COMMON_C_INCLUDES += \
16	$(LOCAL_PATH)/../../../third_party/stlport-cpp11-extension/ \
17	external/stlport/stlport/ \
18	external/stlport/
19endif
20
21COMMON_CFLAGS := \
22	-DLOG_TAG=\"swiftshader_compiler\" \
23	-Wall \
24	-Werror \
25	-Wno-format \
26	-Wno-sign-compare \
27	-Wno-unneeded-internal-declaration \
28	-Wno-unused-const-variable \
29	-Wno-unused-parameter \
30	-Wno-unused-variable \
31	-Wno-implicit-exception-spec-mismatch \
32	-Wno-implicit-fallthrough \
33	-Wno-overloaded-virtual \
34	-Wno-attributes \
35	-Wno-unknown-attributes \
36	-Wno-unknown-warning-option \
37	-fno-operator-names \
38	-msse2 \
39	-D__STDC_CONSTANT_MACROS \
40	-D__STDC_LIMIT_MACROS \
41	-std=c++11 \
42	-DANDROID_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
43
44ifneq (16,${PLATFORM_SDK_VERSION})
45COMMON_CFLAGS += -Xclang -fuse-init-array
46else
47COMMON_CFLAGS += -D__STDC_INT64__
48endif
49
50COMMON_SRC_FILES := \
51	preprocessor/DiagnosticsBase.cpp \
52	preprocessor/DirectiveHandlerBase.cpp \
53	preprocessor/DirectiveParser.cpp \
54	preprocessor/ExpressionParser.cpp \
55	preprocessor/Input.cpp \
56	preprocessor/Lexer.cpp \
57	preprocessor/Macro.cpp \
58	preprocessor/MacroExpander.cpp \
59	preprocessor/Preprocessor.cpp \
60	preprocessor/Token.cpp \
61	preprocessor/Tokenizer.cpp \
62	AnalyzeCallDepth.cpp \
63	Compiler.cpp \
64	debug.cpp \
65	Diagnostics.cpp \
66	DirectiveHandler.cpp \
67	glslang_lex.cpp \
68	glslang_tab.cpp \
69	InfoSink.cpp \
70	Initialize.cpp \
71	InitializeParseContext.cpp \
72	IntermTraverse.cpp \
73	Intermediate.cpp \
74	intermOut.cpp \
75	ossource_posix.cpp \
76	OutputASM.cpp \
77	parseConst.cpp \
78	ParseHelper.cpp \
79	PoolAlloc.cpp \
80	SymbolTable.cpp \
81	TranslatorASM.cpp \
82	util.cpp \
83	ValidateLimitations.cpp \
84	ValidateSwitch.cpp \
85
86# liblog_headers is introduced from O MR1
87ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27 && echo OMR1),OMR1)
88COMMON_HEADER_LIBRARIES := liblog_headers
89else
90COMMON_HEADER_LIBRARIES :=
91endif
92
93include $(CLEAR_VARS)
94LOCAL_CLANG := true
95LOCAL_MODULE := swiftshader_compiler_release
96LOCAL_MODULE_TAGS := optional
97LOCAL_VENDOR_MODULE := true
98LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
99LOCAL_CFLAGS += \
100	$(COMMON_CFLAGS) \
101	-ffunction-sections \
102	-fdata-sections \
103	-DANGLE_DISABLE_TRACE
104LOCAL_C_INCLUDES := $(COMMON_C_INCLUDES)
105LOCAL_SHARED_LIBRARIES := libcutils
106LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
107include $(BUILD_STATIC_LIBRARY)
108
109include $(CLEAR_VARS)
110LOCAL_CLANG := true
111LOCAL_MODULE := swiftshader_compiler_debug
112LOCAL_MODULE_TAGS := optional
113LOCAL_VENDOR_MODULE := true
114LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
115
116LOCAL_CFLAGS += \
117	$(COMMON_CFLAGS) \
118	-UNDEBUG \
119	-g \
120	-O0
121
122LOCAL_C_INCLUDES := $(COMMON_C_INCLUDES)
123LOCAL_SHARED_LIBRARIES := libcutils
124LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES)
125include $(BUILD_STATIC_LIBRARY)
126