forked from servo/rust-azure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.cargo
135 lines (119 loc) · 2.87 KB
/
makefile.cargo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
ifeq (eabi,$(findstring eabi,$(TARGET)))
CXX ?= $(TARGET)-g++
AR ?= $(TARGET)-ar
else
CXX ?= g++
AR ?= ar
endif
AZURE_CPP_SRC = \
src/azure-c.cpp \
libazure/Blur.cpp \
libazure/convolver.cpp \
libazure/DataSourceSurface.cpp \
libazure/DataSurfaceHelpers.cpp \
libazure/DrawEventRecorder.cpp \
libazure/DrawTargetCapture.cpp \
libazure/DrawTarget.cpp \
libazure/DrawTargetDual.cpp \
libazure/DrawTargetRecording.cpp \
libazure/DrawTargetSkia.cpp \
libazure/DrawTargetTiled.cpp \
libazure/Factory.cpp \
libazure/FilterNodeSoftware.cpp \
libazure/FilterProcessing.cpp \
libazure/FilterProcessingScalar.cpp \
libazure/ImageScaling.cpp \
libazure/Matrix.cpp \
libazure/Path.cpp \
libazure/PathHelpers.cpp \
libazure/PathRecording.cpp \
libazure/PathSkia.cpp \
libazure/RecordedEvent.cpp \
libazure/ScaledFontBase.cpp \
libazure/ScaledFontSkia.cpp \
libazure/SourceSurfaceRawData.cpp \
libazure/SourceSurfaceSkia.cpp
CXXFLAGS += \
-std=gnu++11 \
-fPIC \
-Ilibazure \
-DMOZ_GFX \
-DMOZ_WARN_UNUSED_RESULT="" \
$(NULL)
ifeq ($(CFG_ENABLE_DEBUG_SKIA),1)
CXXFLAGS += \
-g \
-DSK_DEBUG \
-DGR_DEBUG=1 \
-DGR_GL_LOG_CALLS=1 \
-DGR_GL_LOG_CALLS_START=1 \
$(NULL)
else
CXXFLAGS += \
-O3 \
-DSK_RELEASE \
-DGR_RELEASE=1 \
$(NULL)
endif
CXXFLAGS += \
-I "$(DEP_FREETYPE_OUTDIR)/include" \
-iquote "$(DEP_SKIA_OUTDIR)/include" \
-iquote "$(DEP_SKIA_OUTDIR)/include/core" \
-iquote "$(DEP_SKIA_OUTDIR)/include/config" \
-iquote "$(DEP_SKIA_OUTDIR)/include/effects" \
-iquote "$(DEP_SKIA_OUTDIR)/include/ports" \
-iquote "$(DEP_SKIA_OUTDIR)/include/utils" \
-iquote "$(DEP_SKIA_OUTDIR)/include/gpu" \
-iquote "$(DEP_SKIA_OUTDIR)/include/gpu/gl" \
-DUSE_SKIA \
-DUSE_SKIA_GPU
USE_CLANG = $(shell $(CXX) --version|grep -c 'clang')
ifeq (i686,$(findstring i686,$(TARGET)))
supports_sse = true
endif
ifeq (x86_64,$(findstring x86_64,$(TARGET)))
supports_sse = true
endif
ifeq (true,$(supports_sse))
AZURE_CPP_SRC += \
libazure/BlurSSE2.cpp \
libazure/FilterProcessingSSE2.cpp \
libazure/ImageScalingSSE2.cpp \
libazure/convolverSSE2.cpp
CXXFLAGS += \
-msse2 \
-DUSE_SSE2
endif
ifeq (darwin,$(findstring darwin,$(TARGET)))
CXXFLAGS += \
-DXP_MACOSX \
-DXP_UNIX \
-Dtypeof=__typeof__
AZURE_CPP_SRC += \
libazure/DrawTargetCG.cpp \
libazure/MacIOSurface.cpp \
libazure/PathCG.cpp \
libazure/ScaledFontMac.cpp \
libazure/SourceSurfaceCG.cpp
endif
ifeq (linux,$(findstring linux,$(TARGET)))
CXXFLAGS += \
-DMOZ_ENABLE_FREETYPE \
-DXP_UNIX \
-DSK_BUILD_FOR_UNIX
endif
ifeq (androideabi,$(findstring androideabi,$(TARGET)))
CXXFLAGS += \
-DXP_UNIX \
-DSK_BUILD_FOR_ANDROID
CXXFLAGS += \
-DMOZ_ENABLE_FREETYPE
endif
ALL_CPP_SRC = $(AZURE_CPP_SRC)
ALL_OBJS = $(ALL_CPP_SRC:%.cpp=$(OUT_DIR)/%.o)
.PHONY: all
all: $(OUT_DIR)/libazure.a
$(OUT_DIR)/%.o: %.cpp
mkdir -p `dirname $@` && $(CXX) $< -o $@ -c $(CXXFLAGS)
$(OUT_DIR)/libazure.a: $(ALL_OBJS)
$(AR) rcs $@ $(ALL_OBJS)