aboutsummaryrefslogtreecommitdiffstats
path: root/build/conf/project_specific/maps/mapkit.conf
blob: d64b41f72a9aa712cbe06d625f55322cf8d27fdc (plain) (blame)
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
MAPKIT_IDL_INCLUDES=
macro MAPKIT_ADDINCL(Dirs...) {
    ADDINCL(${pre=FOR idl :Dirs})
    SET_APPEND(MAPKIT_IDL_INCLUDES $Dirs)
}

### @usage: MAPS_IDL_ADDINCL(dirnames...) # internal
###
### Warpper for MAPKIT_ADDINCL macro which is used for mobile mapkit build
macro MAPS_IDL_ADDINCL(Dirs...) {
    MAPKIT_ADDINCL($Dirs)
}

### @usage: _MAPKITIDL_PROXY(args...) # internal
###
### Proxy macro for MAPKITIDL which adds PEERDIR to YMAKE resources
macro _MAPKITIDL_PROXY(Args...) {
    MAPKITIDL($Args)
    ENABLE(USE_YMAKE_RESOURCE)
    SET_APPEND(_MAKEFILE_INCLUDE_LIKE_TEXT_DEPS ${ext=idl:Args})
}

MAPS_IDL_FILTER=

### @usage: MAPS_IDL_SRCS(filenames...) # internal
###
### Warpper for MAPKITIDL macro which is used for mobile mapkit build
macro MAPS_IDL_SRCS(Srcs...) {
    _MAPKITIDL_PROXY($Srcs ${MAPS_IDL_FILTER})
}

### @usage: MAPS_IDL_GLOBAL_SRCS(filenames...) # internal
###
### Warpper for MAPKITIDL macro which is used for mobile mapkit build
macro MAPS_IDL_GLOBAL_SRCS(Srcs...) {
    _MAPKITIDL_PROXY(GLOBAL_OUTPUTS $Srcs ${MAPS_IDL_FILTER})
}

### @usage: MAPSMOBI_SRCS(filenames...) # internal
###
### Make all source files listed as GLOBAL or not (depending on the value of
### MAPSMOBI_USE_SRCS_GLOBAL). Be careful since the value of
### MAPSMOBI_USE_SRCS_GLOBAL matters! If the value of this variable is equal to
### GLOBAL then call to MAPSMOBI_SRCS() macro behaves like call to
### GLOBAL_SRCS() macro otherwise the value of MAPSMOBI_USE_SRCS_GLOBAL is
### treated as a file name and a call to MAPSMOBI_SRCS() macro behaves like a
### call to SRCS() macro with additional argument which is the value of
### MAPSMOBI_USE_SRCS_GLOBAL variable
macro MAPSMOBI_SRCS(FILES...) {
    ALL_SRCS(${MAPSMOBI_USE_SRCS_GLOBAL} $FILES)
}

### @usage: EXPORT_MAPKIT_PROTO() # internal deprecated
###
### This macro is a temporary one and should be changed to EXPORT_YMAPS_PROTO
### when transition of mapsmobi to arcadia is finished
macro EXPORT_MAPKIT_PROTO() {
    PROTO_NAMESPACE(GLOBAL maps/mapsmobi/external/proto)
}

BEFORE_PEERS=
AFTER_PEERS=
when ($MAPKIT_WHOLE_ARCHIVE == "yes") {
    when($OS_LINUX) {
        BEFORE_PEERS += $START_WHOLE_ARCHIVE_VALUE
        AFTER_PEERS += $END_WHOLE_ARCHIVE_VALUE
    }
    elsewhen($OS_DARWIN) {
        LDFLAGS+=-Wl,-all_load
    }
}

### @usage: MAPKIT_ENABLE_WHOLE_ARCHIVE() # internal deprecated
###
### This macro is strictly prohibited to use outside of mapsmobi project
macro MAPKIT_ENABLE_WHOLE_ARCHIVE() {
    ENABLE(MAPKIT_WHOLE_ARCHIVE)
}

### @usage: MAPS_IDL_LIBRARY()
###
### Definition of multimodule that builds various variants of libraries.
### The particular variant is selected based on where PEERDIR to IDL_LIBRARY comes from.
### Now supported 2 variants: C++, Java
### Java version is not really a library but an archive of generated Java sources
multimodule MAPS_IDL_LIBRARY {
    module CPP_IDL: LIBRARY {
        .ALIASES=SRCS=MAPS_IDL_SRCS GLOBAL_SRCS=MAPS_IDL_GLOBAL_SRCS ADDINCL=MAPKIT_ADDINCL MAPSMOBI_SRCS=MAPS_IDL_SRCS
        SET(PEERDIR_TAGS CPP_IDL CPP_PROTO __EMPTY__)
        SET(MAPS_IDL_FILTER)
        ENABLE(CPP_IDL)
        NO_UTIL()

        when ($OS_IOS == "yes") {
            CFLAGS+=-fobjc-arc
        }
    }

    module JAVA_IDL: JSRC_LIBRARY {
        .ALIASES=SRCS=MAPS_IDL_SRCS GLOBAL_SRCS=MAPS_IDL_SRCS ADDINCL=MAPKIT_ADDINCL MAPSMOBI_SRCS=MAPS_IDL_SRCS
        .IGNORED=CPP_ADDINCL
        SET(PEERDIR_TAGS JAVA_IDL JAVA_PROTO)
        SET(MAPS_IDL_FILTER FILTER .java)
        ENABLE(JAVA_IDL)
    }
}

### @usage: MAPSMOBI_COLLECT_ASSETS_FILES(varname [dir]) # internal
###
### This macro is strictly prohibited to use outside of mapsmobi project
macro MAPSMOBI_COLLECT_ASSETS_FILES(VAR, DIR="") {
    _GLOB($VAR ${suf=/:DIR}**/*)
    RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
}

### @usage: MAPSMOBI_COLLECT_AIDL_FILES(varname [dir]) # internal
###
### This macro is strictly prohibited to use outside of mapsmobi project
macro MAPSMOBI_COLLECT_AIDL_FILES(VAR, DIR="") {
    _GLOB($VAR ${suf=/:DIR}**/*.aidl)
    RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
}

### @usage: MAPSMOBI_COLLECT_JAVA_FILES(varname [dir]) # internal
###
### This macro is strictly prohibited to use outside of mapsmobi project
macro MAPSMOBI_COLLECT_JAVA_FILES(VAR, DIR="") {
    _GLOB($VAR ${suf=/:DIR}**/*.java)
    RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
}

### @usage: MAPSMOBI_COLLECT_JNI_LIBS_FILES(varname [dir]) # internal
###
### This macro is strictly prohibited to use outside of mapsmobi project
macro MAPSMOBI_COLLECT_JNI_LIBS_FILES(VAR, DIR="") {
    _GLOB($VAR ${suf=/:DIR}**/*.so)
    RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
}

### @usage: MAPSMOBI_COLLECT_RES_FILES(varname [dir]) # internal
###
### This macro is strictly prohibited to use outside of mapsmobi project
macro MAPSMOBI_COLLECT_RES_FILES(VAR, DIR="") {
    _GLOB($VAR ${suf=/:DIR}**/*.(xml|png))
    RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
}

### @usage: MAPSMOBI_COLLECT_TPL_FILES(varname [dir]) # internal
###
### This macro is strictly prohibited to use outside of mapsmobi project
macro MAPSMOBI_COLLECT_TPL_FILES(VAR, DIR="") {
    _GLOB($VAR ${suf=/:DIR}**/*.tpl)
    RESTRICT_PATH(tools/idl MSG This macro is for use in mapsmobi projects)
}

### @usage: MAPS_GARDEN_COLLECT_MODULE_TRAITS(varnamei dir) # internal
###
### This macro is strictly prohibited to use outside of maps/garden project
macro MAPS_GARDEN_COLLECT_MODULE_TRAITS(VAR, DIR) {
    _GLOB($VAR $DIR/*/module_traits.json)
    RESTRICT_PATH(maps/garden/sdk/module_traits/tests/module_traits_bundle MSG This macro is for use in maps/garden project)
}

# mapsmobi build configuration

MAPSMOBI_FAKEID=${FAKEID}_r8609790
MAPSMOBI_BUILD=
YANDEX_EXPORT=
YRT_EXPORT=
MAPSMOBI_CPP_PROTO_PLUGINS=
STATIC_STL=
EXPORT_ALL_SYMBOLS=
when ($MAPSMOBI_BUILD_HOST || $MAPSMOBI_BUILD_TARGET) {
    MAPSMOBI_BUILD=yes
}
when ($MAPSMOBI_BUILD) {
    CFLAGS+=-DMOBILE_BUILD ${hide:MAPSMOBI_FAKEID}
    MAPKIT_BASE_PROTO_PACKAGE=yandex.maps.proto
    MAPKIT_PROTO_ROOT=maps/doc/proto
    MAPKIT_IDL_FRAMEWORK=maps/mobile/libs/idl_frameworks
}
when ($MAPSMOBI_BUILD_TARGET) {
    ALLOCATOR=FAKE
    USE_VANILLA_PROTOC=yes
    PROTOBUF_LITE=yes
    CPP_PROTO_PLUGINS=lite${pre=,:MAPSMOBI_CPP_PROTO_PLUGINS}:
    when ($OPENSOURCE != "yes") {
        SYSINCL+=build/yandex_specific/sysincl/mapsmobi.yml
    }

    CFLAGS+=-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DBOOST_CB_DISABLE_DEBUG -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -DYANDEX_EXPORT=${YANDEX_EXPORT} -DYRT_EXPORT=${YRT_EXPORT}
}
when ($MAPSMOBI_BUILD_TARGET && $OS_ANDROID) {
    JDK_VERSION=8
    MAPSMOBI_CPP_PROTO_PLUGINS="dllexport_decl=YANDEX_EXPORT"
    YANDEX_EXPORT=__attribute__((visibility(\"default\")))
    CFLAGS+=-fvisibility=hidden

    when ($MAPS_MOBILE_EXPORT_CPP_API) {
        LDFLAGS+=-lc++_shared
        CFLAGS+=-DZLIB_DLL
        CFLAGS+=-DPROTOBUF_USE_DLLS -DLIBPROTOBUF_EXPORTS
        CFLAGS+=-DPNG_IMPEXP=${YANDEX_EXPORT}
        CFLAGS+=-DBOOST_ALL_DYN_LINK
        CFLAGS+=-DBOOST_SYMBOL_EXPORT=${YANDEX_EXPORT}
        DYNAMIC_BOOST=yes
    }
    otherwise {
        STATIC_STL=yes
        YANDEX_EXPORT=
        CFLAGS+=-DBOOST_SYMBOL_EXPORT=
        CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
        LDFLAGS+=-lc++_static -Wl,--exclude-libs,ALL -static-libstdc++
        USE_GLOBAL_CMD=no
    }

    when ($EXPORT_ALL_SYMBOLS) {
        CFLAGS+=-fvisibility=default
    }

    when ($NO_DEBUGINFO != "yes" && $REDUCED_DEBUGINFO) {
        CFLAGS+=-g1
    }

    CFLAGS+=-DANDROID -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -Wa,--noexecstack
    CFLAGS+=-Qunused-arguments -Wno-unused-function -Wno-pessimizing-move -Wno-missing-field-initializers -Wno-missing-braces -Wno-unused-parameter -Wno-vexing-parse -Wno-sign-compare -Wno-deprecated-declarations

    LDFLAGS+=-lc -lm -llog -Bsymbolic -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -Wl,--no-undefined

    when ($BT_RELEASE || $BT_RELWITHDEBINFO) {
        CFLAGS+=-fomit-frame-pointer -fvisibility-inlines-hidden -ffunction-sections -fdata-sections
        LDFLAGS+=-Wl,--gc-sections -Wl,--build-id
    }

    when ($ARCH_ARM7) {
        CFLAGS+=-mfloat-abi=softfp
        #Android clang overaligns some float types which causes NEON programs to fail on old Android versions. So we disable NEON.
        #See https://github.com/android/ndk/issues/640 for more information
        CFLAGS+=-mfpu=vfpv3-d16
    }
    elsewhen ($ARCH_ARM64) {
    }
    elsewhen ($ARCH_I386) {
        CFLAGS+=-fstrict-aliasing -mstackrealign -DTLS_STACK_PROTECTOR
    }
    elsewhen ($ARCH_X86_64) {
        CFLAGS+=-fstrict-aliasing -mstackrealign -march=x86-64 -msse4.2 -mpopcnt -m64 -DTLS_STACK_PROTECTOR
    }
    otherwise {
        PEERDIR+=__unsupported_architecture_for_android__
    }
}
when ($MAPSMOBI_BUILD_TARGET && $OS_DARWIN) {
    QT_REQUIRED=yes
    LDFLAGS+=-lc++
    CFLAGS+=-DBOOST_SYMBOL_EXPORT=
    CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
}
when ($MAPSMOBI_BUILD_TARGET && $OS_IOS) {
    CFLAGS+=-DIOS -stdlib=libc++ -fvisibility=hidden
    CFLAGS+=-DBOOST_SYMBOL_EXPORT=
    CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
    when ($MAPS_MOBILE_EXPORT_OBJC_API) {
        YRT_EXPORT=__attribute__((visibility(\"default\")))
    }
}
when ($MAPSMOBI_BUILD_TARGET && $OS_LINUX) {
    when ($NO_GRAPHICS != "yes") {
        QT_REQUIRED=yes
        OPENGL_REQUIRED=yes
    }
    OS_SDK=ubuntu-16
    PIC=yes
    LDFLAGS+=-lstdc++ -lgcc_s
    CFLAGS+=-DBOOST_SYMBOL_EXPORT=
    CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
}
when ($MAPSMOBI_BUILD_TARGET && $OS_YOCTO) {
    QT_REQUIRED=yes
    PIC=yes
    CFLAGS+=-DBOOST_SYMBOL_EXPORT=
    CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
}