mapkit.conf 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. MAPKIT_IDL_INCLUDES=
  2. macro MAPKIT_ADDINCL(Dirs...) {
  3. ADDINCL(${pre=FOR idl :Dirs})
  4. SET_APPEND(MAPKIT_IDL_INCLUDES $Dirs)
  5. }
  6. ### @usage: MAPS_IDL_ADDINCL(dirnames...) # internal
  7. ###
  8. ### Warpper for MAPKIT_ADDINCL macro which is used for mobile mapkit build
  9. macro MAPS_IDL_ADDINCL(Dirs...) {
  10. MAPKIT_ADDINCL($Dirs)
  11. }
  12. ### @usage: _MAPKITIDL_PROXY(args...) # internal
  13. ###
  14. ### Proxy macro for MAPKITIDL which adds PEERDIR to YMAKE resources
  15. macro _MAPKITIDL_PROXY(Args...) {
  16. MAPKITIDL($Args)
  17. ENABLE(USE_YMAKE_RESOURCE)
  18. SET_APPEND(_MAKEFILE_INCLUDE_LIKE_TEXT_DEPS ${ext=idl:Args})
  19. }
  20. MAPS_IDL_FILTER=
  21. ### @usage: MAPS_IDL_SRCS(filenames...) # internal
  22. ###
  23. ### Warpper for MAPKITIDL macro which is used for mobile mapkit build
  24. macro MAPS_IDL_SRCS(Srcs...) {
  25. _MAPKITIDL_PROXY($Srcs ${MAPS_IDL_FILTER})
  26. }
  27. ### @usage: MAPS_IDL_GLOBAL_SRCS(filenames...) # internal
  28. ###
  29. ### Warpper for MAPKITIDL macro which is used for mobile mapkit build
  30. macro MAPS_IDL_GLOBAL_SRCS(Srcs...) {
  31. _MAPKITIDL_PROXY(GLOBAL_OUTPUTS $Srcs ${MAPS_IDL_FILTER})
  32. }
  33. ### @usage: MAPSMOBI_SRCS(filenames...) # internal
  34. ###
  35. ### Make all source files listed as GLOBAL or not (depending on the value of
  36. ### MAPSMOBI_USE_SRCS_GLOBAL). Be careful since the value of
  37. ### MAPSMOBI_USE_SRCS_GLOBAL matters! If the value of this variable is equal to
  38. ### GLOBAL then call to MAPSMOBI_SRCS() macro behaves like call to
  39. ### GLOBAL_SRCS() macro otherwise the value of MAPSMOBI_USE_SRCS_GLOBAL is
  40. ### treated as a file name and a call to MAPSMOBI_SRCS() macro behaves like a
  41. ### call to SRCS() macro with additional argument which is the value of
  42. ### MAPSMOBI_USE_SRCS_GLOBAL variable
  43. macro MAPSMOBI_SRCS(FILES...) {
  44. ALL_SRCS(${MAPSMOBI_USE_SRCS_GLOBAL} $FILES)
  45. }
  46. ### @usage: EXPORT_MAPKIT_PROTO() # internal deprecated
  47. ###
  48. ### This macro is a temporary one and should be changed to EXPORT_YMAPS_PROTO
  49. ### when transition of mapsmobi to arcadia is finished
  50. macro EXPORT_MAPKIT_PROTO() {
  51. PROTO_NAMESPACE(GLOBAL maps/mapsmobi/external/proto)
  52. }
  53. BEFORE_PEERS=
  54. AFTER_PEERS=
  55. when ($MAPKIT_WHOLE_ARCHIVE == "yes") {
  56. when($OS_LINUX) {
  57. BEFORE_PEERS += $START_WHOLE_ARCHIVE_VALUE
  58. AFTER_PEERS += $END_WHOLE_ARCHIVE_VALUE
  59. }
  60. elsewhen($OS_DARWIN) {
  61. LDFLAGS+=-Wl,-all_load
  62. }
  63. }
  64. ### @usage: MAPKIT_ENABLE_WHOLE_ARCHIVE() # internal deprecated
  65. ###
  66. ### This macro is strictly prohibited to use outside of mapsmobi project
  67. macro MAPKIT_ENABLE_WHOLE_ARCHIVE() {
  68. ENABLE(MAPKIT_WHOLE_ARCHIVE)
  69. }
  70. ### @usage: MAPS_IDL_LIBRARY()
  71. ###
  72. ### Definition of multimodule that builds various variants of libraries.
  73. ### The particular variant is selected based on where PEERDIR to IDL_LIBRARY comes from.
  74. ### Now supported 2 variants: C++, Java
  75. ### Java version is not really a library but an archive of generated Java sources
  76. multimodule MAPS_IDL_LIBRARY {
  77. module CPP_IDL: LIBRARY {
  78. .ALIASES=SRCS=MAPS_IDL_SRCS GLOBAL_SRCS=MAPS_IDL_GLOBAL_SRCS ADDINCL=MAPKIT_ADDINCL MAPSMOBI_SRCS=MAPS_IDL_SRCS
  79. SET(PEERDIR_TAGS CPP_IDL CPP_PROTO __EMPTY__)
  80. SET(MAPS_IDL_FILTER)
  81. ENABLE(CPP_IDL)
  82. NO_UTIL()
  83. when ($OS_IOS == "yes") {
  84. CFLAGS+=-fobjc-arc
  85. }
  86. }
  87. module JAVA_IDL: JSRC_LIBRARY {
  88. .ALIASES=SRCS=MAPS_IDL_SRCS GLOBAL_SRCS=MAPS_IDL_SRCS ADDINCL=MAPKIT_ADDINCL MAPSMOBI_SRCS=MAPS_IDL_SRCS
  89. .IGNORED=CPP_ADDINCL
  90. SET(PEERDIR_TAGS JAVA_IDL JAVA_PROTO)
  91. SET(MAPS_IDL_FILTER FILTER .java)
  92. ENABLE(JAVA_IDL)
  93. }
  94. }
  95. ### @usage: MAPSMOBI_COLLECT_ASSETS_FILES(varname [dir]) # internal
  96. ###
  97. ### This macro is strictly prohibited to use outside of mapsmobi project
  98. macro MAPSMOBI_COLLECT_ASSETS_FILES(VAR, DIR="") {
  99. _GLOB($VAR ${suf=/:DIR}**/*)
  100. RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
  101. }
  102. ### @usage: MAPSMOBI_COLLECT_AIDL_FILES(varname [dir]) # internal
  103. ###
  104. ### This macro is strictly prohibited to use outside of mapsmobi project
  105. macro MAPSMOBI_COLLECT_AIDL_FILES(VAR, DIR="") {
  106. _GLOB($VAR ${suf=/:DIR}**/*.aidl)
  107. RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
  108. }
  109. ### @usage: MAPSMOBI_COLLECT_JAVA_FILES(varname [dir]) # internal
  110. ###
  111. ### This macro is strictly prohibited to use outside of mapsmobi project
  112. macro MAPSMOBI_COLLECT_JAVA_FILES(VAR, DIR="") {
  113. _GLOB($VAR ${suf=/:DIR}**/*.java)
  114. RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
  115. }
  116. ### @usage: MAPSMOBI_COLLECT_JNI_LIBS_FILES(varname [dir]) # internal
  117. ###
  118. ### This macro is strictly prohibited to use outside of mapsmobi project
  119. macro MAPSMOBI_COLLECT_JNI_LIBS_FILES(VAR, DIR="") {
  120. _GLOB($VAR ${suf=/:DIR}**/*.so)
  121. RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
  122. }
  123. ### @usage: MAPSMOBI_COLLECT_RES_FILES(varname [dir]) # internal
  124. ###
  125. ### This macro is strictly prohibited to use outside of mapsmobi project
  126. macro MAPSMOBI_COLLECT_RES_FILES(VAR, DIR="") {
  127. _GLOB($VAR ${suf=/:DIR}**/*.(xml|png))
  128. RESTRICT_PATH(maps/mobile maps/automotive MSG This macro is for use in mapsmobi projects)
  129. }
  130. ### @usage: MAPSMOBI_COLLECT_TPL_FILES(varname [dir]) # internal
  131. ###
  132. ### This macro is strictly prohibited to use outside of mapsmobi project
  133. macro MAPSMOBI_COLLECT_TPL_FILES(VAR, DIR="") {
  134. _GLOB($VAR ${suf=/:DIR}**/*.tpl)
  135. RESTRICT_PATH(tools/idl MSG This macro is for use in mapsmobi projects)
  136. }
  137. ### @usage: MAPS_GARDEN_COLLECT_MODULE_TRAITS(varnamei dir) # internal
  138. ###
  139. ### This macro is strictly prohibited to use outside of maps/garden project
  140. macro MAPS_GARDEN_COLLECT_MODULE_TRAITS(VAR, DIR) {
  141. _GLOB($VAR $DIR/*/module_traits.json)
  142. RESTRICT_PATH(maps/garden/sdk/module_traits/tests/module_traits_bundle MSG This macro is for use in maps/garden project)
  143. }
  144. # mapsmobi build configuration
  145. MAPSMOBI_FAKEID=${FAKEID}_r8609790
  146. MAPSMOBI_BUILD=
  147. YANDEX_EXPORT=
  148. YRT_EXPORT=
  149. MAPSMOBI_CPP_PROTO_PLUGINS=
  150. STATIC_STL=
  151. EXPORT_ALL_SYMBOLS=
  152. when ($MAPSMOBI_BUILD_HOST || $MAPSMOBI_BUILD_TARGET) {
  153. MAPSMOBI_BUILD=yes
  154. }
  155. when ($MAPSMOBI_BUILD) {
  156. CFLAGS+=-DMOBILE_BUILD ${hide:MAPSMOBI_FAKEID}
  157. MAPKIT_BASE_PROTO_PACKAGE=yandex.maps.proto
  158. MAPKIT_PROTO_ROOT=maps/doc/proto
  159. MAPKIT_IDL_FRAMEWORK=maps/mobile/libs/idl_frameworks
  160. }
  161. when ($MAPSMOBI_BUILD_TARGET) {
  162. ALLOCATOR=FAKE
  163. USE_VANILLA_PROTOC=yes
  164. PROTOBUF_LITE=yes
  165. CPP_PROTO_PLUGINS=lite${pre=,:MAPSMOBI_CPP_PROTO_PLUGINS}:
  166. when ($OPENSOURCE != "yes") {
  167. SYSINCL+=build/yandex_specific/sysincl/mapsmobi.yml
  168. }
  169. 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}
  170. }
  171. when ($MAPSMOBI_BUILD_TARGET && $OS_ANDROID) {
  172. JDK_VERSION=8
  173. MAPSMOBI_CPP_PROTO_PLUGINS="dllexport_decl=YANDEX_EXPORT"
  174. YANDEX_EXPORT=__attribute__((visibility(\"default\")))
  175. CFLAGS+=-fvisibility=hidden
  176. when ($MAPS_MOBILE_EXPORT_CPP_API) {
  177. LDFLAGS+=-lc++_shared
  178. CFLAGS+=-DZLIB_DLL
  179. CFLAGS+=-DPROTOBUF_USE_DLLS -DLIBPROTOBUF_EXPORTS
  180. CFLAGS+=-DPNG_IMPEXP=${YANDEX_EXPORT}
  181. CFLAGS+=-DBOOST_ALL_DYN_LINK
  182. CFLAGS+=-DBOOST_SYMBOL_EXPORT=${YANDEX_EXPORT}
  183. DYNAMIC_BOOST=yes
  184. }
  185. otherwise {
  186. STATIC_STL=yes
  187. YANDEX_EXPORT=
  188. CFLAGS+=-DBOOST_SYMBOL_EXPORT=
  189. CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
  190. LDFLAGS+=-lc++_static -Wl,--exclude-libs,ALL -static-libstdc++
  191. USE_GLOBAL_CMD=no
  192. }
  193. when ($EXPORT_ALL_SYMBOLS) {
  194. CFLAGS+=-fvisibility=default
  195. }
  196. when ($NO_DEBUGINFO != "yes" && $REDUCED_DEBUGINFO) {
  197. CFLAGS+=-g1
  198. }
  199. CFLAGS+=-DANDROID -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -Wa,--noexecstack
  200. 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
  201. LDFLAGS+=-lc -lm -llog -Bsymbolic -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -Wl,--no-undefined
  202. when ($BT_RELEASE || $BT_RELWITHDEBINFO) {
  203. CFLAGS+=-fomit-frame-pointer -fvisibility-inlines-hidden -ffunction-sections -fdata-sections
  204. LDFLAGS+=-Wl,--gc-sections -Wl,--build-id
  205. }
  206. when ($ARCH_ARM7) {
  207. CFLAGS+=-mfloat-abi=softfp
  208. #Android clang overaligns some float types which causes NEON programs to fail on old Android versions. So we disable NEON.
  209. #See https://github.com/android/ndk/issues/640 for more information
  210. CFLAGS+=-mfpu=vfpv3-d16
  211. }
  212. elsewhen ($ARCH_ARM64) {
  213. }
  214. elsewhen ($ARCH_I386) {
  215. CFLAGS+=-fstrict-aliasing -mstackrealign -DTLS_STACK_PROTECTOR
  216. }
  217. elsewhen ($ARCH_X86_64) {
  218. CFLAGS+=-fstrict-aliasing -mstackrealign -march=x86-64 -msse4.2 -mpopcnt -m64 -DTLS_STACK_PROTECTOR
  219. }
  220. otherwise {
  221. PEERDIR+=__unsupported_architecture_for_android__
  222. }
  223. }
  224. when ($MAPSMOBI_BUILD_TARGET && $OS_DARWIN) {
  225. QT_REQUIRED=yes
  226. LDFLAGS+=-lc++
  227. CFLAGS+=-DBOOST_SYMBOL_EXPORT=
  228. CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
  229. }
  230. when ($MAPSMOBI_BUILD_TARGET && $OS_IOS) {
  231. CFLAGS+=-DIOS -stdlib=libc++ -fvisibility=hidden
  232. CFLAGS+=-DBOOST_SYMBOL_EXPORT=
  233. CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
  234. when ($MAPS_MOBILE_EXPORT_OBJC_API) {
  235. YRT_EXPORT=__attribute__((visibility(\"default\")))
  236. }
  237. }
  238. when ($MAPSMOBI_BUILD_TARGET && $OS_LINUX) {
  239. when ($NO_GRAPHICS != "yes") {
  240. QT_REQUIRED=yes
  241. OPENGL_REQUIRED=yes
  242. }
  243. OS_SDK=ubuntu-16
  244. PIC=yes
  245. LDFLAGS+=-lstdc++ -lgcc_s
  246. CFLAGS+=-DBOOST_SYMBOL_EXPORT=
  247. CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
  248. }
  249. when ($MAPSMOBI_BUILD_TARGET && $OS_YOCTO) {
  250. QT_REQUIRED=yes
  251. PIC=yes
  252. CFLAGS+=-DBOOST_SYMBOL_EXPORT=
  253. CFLAGS+=-DBOOST_SYMBOL_VISIBLE=
  254. }