OSDN Git Service

Allow Chromium to create an OpenGL ES3 context
[android-x86/external-swiftshader.git] / src / Android.mk
1 LOCAL_PATH:= $(call my-dir)
2
3 COMMON_C_INCLUDES += \
4         bionic \
5         $(LOCAL_PATH)/../include \
6         $(LOCAL_PATH)/OpenGL/ \
7         $(LOCAL_PATH) \
8         $(LOCAL_PATH)/Renderer/ \
9         $(LOCAL_PATH)/Common/ \
10         $(LOCAL_PATH)/Shader/ \
11         $(LOCAL_PATH)/Main/
12
13 ifdef use_subzero
14 COMMON_C_INCLUDES += \
15         $(LOCAL_PATH)/../third_party/subzero/ \
16         $(LOCAL_PATH)/../third_party/llvm-subzero/include/ \
17         $(LOCAL_PATH)/../third_party/llvm-subzero/build/Android/include/ \
18         $(LOCAL_PATH)/../third_party/subzero/pnacl-llvm/include/
19 else
20 COMMON_C_INCLUDES += \
21         $(LOCAL_PATH)/../third_party/LLVM/include
22 endif
23
24 # libnativewindow is introduced from O
25 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo O),O)
26 COMMON_SHARED_LIBRARIES := libnativewindow
27 endif
28
29 # Marshmallow does not have stlport, but comes with libc++ by default
30 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
31 COMMON_C_INCLUDES += external/stlport/stlport
32 endif
33
34 COMMON_SRC_FILES := \
35         Common/CPUID.cpp \
36         Common/Configurator.cpp \
37         Common/DebugAndroid.cpp \
38         Common/GrallocAndroid.cpp \
39         Common/Half.cpp \
40         Common/Math.cpp \
41         Common/Memory.cpp \
42         Common/Resource.cpp \
43         Common/Socket.cpp \
44         Common/Thread.cpp \
45         Common/Timer.cpp
46
47 COMMON_SRC_FILES += \
48         Main/Config.cpp \
49         Main/FrameBuffer.cpp \
50         Main/FrameBufferAndroid.cpp \
51         Main/SwiftConfig.cpp
52
53 ifdef use_subzero
54 COMMON_SRC_FILES += \
55         Reactor/SubzeroReactor.cpp \
56         Reactor/Routine.cpp \
57         Reactor/Optimizer.cpp
58 else
59 COMMON_SRC_FILES += \
60         Reactor/LLVMReactor.cpp \
61         Reactor/Routine.cpp \
62         Reactor/LLVMRoutine.cpp \
63         Reactor/LLVMRoutineManager.cpp
64 endif
65
66 COMMON_SRC_FILES += \
67         Renderer/Blitter.cpp \
68         Renderer/Clipper.cpp \
69         Renderer/Color.cpp \
70         Renderer/Context.cpp \
71         Renderer/ETC_Decoder.cpp \
72         Renderer/Matrix.cpp \
73         Renderer/PixelProcessor.cpp \
74         Renderer/Plane.cpp \
75         Renderer/Point.cpp \
76         Renderer/QuadRasterizer.cpp \
77         Renderer/Renderer.cpp \
78         Renderer/Sampler.cpp \
79         Renderer/SetupProcessor.cpp \
80         Renderer/Surface.cpp \
81         Renderer/TextureStage.cpp \
82         Renderer/Vector.cpp \
83         Renderer/VertexProcessor.cpp \
84
85 COMMON_SRC_FILES += \
86         Shader/Constants.cpp \
87         Shader/PixelPipeline.cpp \
88         Shader/PixelProgram.cpp \
89         Shader/PixelRoutine.cpp \
90         Shader/PixelShader.cpp \
91         Shader/SamplerCore.cpp \
92         Shader/SetupRoutine.cpp \
93         Shader/Shader.cpp \
94         Shader/ShaderCore.cpp \
95         Shader/VertexPipeline.cpp \
96         Shader/VertexProgram.cpp \
97         Shader/VertexRoutine.cpp \
98         Shader/VertexShader.cpp \
99
100 COMMON_SRC_FILES += \
101         OpenGL/common/Image.cpp \
102         OpenGL/common/Object.cpp \
103         OpenGL/common/MatrixStack.cpp \
104
105 COMMON_CFLAGS := \
106         -DLOG_TAG=\"swiftshader\" \
107         -Wno-unused-parameter \
108         -Wno-implicit-exception-spec-mismatch \
109         -Wno-overloaded-virtual \
110         -Wno-non-virtual-dtor \
111         -Wno-attributes \
112         -Wno-unknown-attributes \
113         -Wno-unknown-warning-option \
114         -fno-operator-names \
115         -msse2 \
116         -D__STDC_CONSTANT_MACROS \
117         -D__STDC_LIMIT_MACROS \
118         -DANDROID_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \
119         -std=c++11 \
120         -DNO_SANITIZE_FUNCTION=
121
122 ifneq (16,${PLATFORM_SDK_VERSION})
123 COMMON_CFLAGS += -Xclang -fuse-init-array
124 else
125 COMMON_CFLAGS += -D__STDC_INT64__
126 endif
127
128 # gralloc1 is introduced from N MR1
129 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25 && echo NMR1),NMR1)
130 COMMON_CFLAGS += -DHAVE_GRALLOC1
131 COMMON_C_INCLUDES += \
132         system/core/libsync/include \
133         system/core/libsync
134 endif
135
136 # Common Subzero defines
137 COMMON_CFLAGS += -DALLOW_DUMP=0 -DALLOW_TIMERS=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_MINIMAL_BUILD=0 -DALLOW_WASM=0 -DICE_THREAD_LOCAL_HACK=1
138
139 # Subzero target
140 LOCAL_CFLAGS_x86 += -DSZTARGET=X8632
141 LOCAL_CFLAGS_x86_64 += -DSZTARGET=X8664
142 LOCAL_CFLAGS_arm += -DSZTARGET=ARM32
143
144 include $(CLEAR_VARS)
145 LOCAL_CLANG := true
146 LOCAL_MODULE := swiftshader_top_release
147 LOCAL_MODULE_TAGS := optional
148 LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
149 LOCAL_CFLAGS := $(COMMON_CFLAGS) -fomit-frame-pointer -ffunction-sections -fdata-sections -DANGLE_DISABLE_TRACE
150 LOCAL_C_INCLUDES := $(COMMON_C_INCLUDES)
151 LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
152 include $(BUILD_STATIC_LIBRARY)
153
154 include $(CLEAR_VARS)
155 LOCAL_CLANG := true
156 LOCAL_MODULE := swiftshader_top_debug
157 LOCAL_MODULE_TAGS := optional
158 LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
159 LOCAL_CFLAGS := $(COMMON_CFLAGS) -UNDEBUG -g -O0 -DDEFAULT_THREAD_COUNT=1
160 LOCAL_C_INCLUDES := $(COMMON_C_INCLUDES)
161 LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
162 include $(BUILD_STATIC_LIBRARY)
163
164 include $(call all-makefiles-under,$(LOCAL_PATH))