common.gypi 138 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670
  1. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. # IMPORTANT:
  5. # Please don't directly include this file if you are building via gyp_chromium,
  6. # since gyp_chromium is automatically forcing its inclusion.
  7. {
  8. # Variables expected to be overriden on the GYP command line (-D) or by
  9. # ~/.gyp/include.gypi.
  10. 'variables': {
  11. # Putting a variables dict inside another variables dict looks kind of
  12. # weird. This is done so that 'host_arch', 'chromeos', etc are defined as
  13. # variables within the outer variables dict here. This is necessary
  14. # to get these variables defined for the conditions within this variables
  15. # dict that operate on these variables.
  16. 'variables': {
  17. 'variables': {
  18. 'variables': {
  19. 'variables': {
  20. # Whether we're building a ChromeOS build.
  21. 'chromeos%': 0,
  22. # Whether or not we are using the Aura windowing framework.
  23. 'use_aura%': 0,
  24. # Whether or not we are building the Ash shell.
  25. 'use_ash%': 0,
  26. },
  27. # Copy conditionally-set variables out one scope.
  28. 'chromeos%': '<(chromeos)',
  29. 'use_aura%': '<(use_aura)',
  30. 'use_ash%': '<(use_ash)',
  31. # Whether we are using Views Toolkit
  32. 'toolkit_views%': 0,
  33. # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803
  34. 'use_openssl%': 0,
  35. 'use_ibus%': 0,
  36. # Disable viewport meta tag by default.
  37. 'enable_viewport%': 0,
  38. # Enable HiDPI support.
  39. 'enable_hidpi%': 0,
  40. # Enable touch optimized art assets and metrics.
  41. 'enable_touch_ui%': 0,
  42. # Is this change part of the android upstream bringup?
  43. # Allows us to *temporarily* disable certain things for
  44. # staging. Only set to 1 in a GYP_DEFINES.
  45. 'android_upstream_bringup%': 0,
  46. # Override buildtype to select the desired build flavor.
  47. # Dev - everyday build for development/testing
  48. # Official - release build (generally implies additional processing)
  49. # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
  50. # conversion is done), some of the things which are now controlled by
  51. # 'branding', such as symbol generation, will need to be refactored
  52. # based on 'buildtype' (i.e. we don't care about saving symbols for
  53. # non-Official # builds).
  54. 'buildtype%': 'Dev',
  55. 'conditions': [
  56. # ChromeOS implies ash.
  57. ['chromeos==1', {
  58. 'use_ash%': 1,
  59. 'use_aura%': 1,
  60. }],
  61. # For now, Windows builds that |use_aura| should also imply using
  62. # ash. This rule should be removed for the future when Windows is
  63. # using the aura windows without the ash interface.
  64. ['use_aura==1 and OS=="win"', {
  65. 'use_ash%': 1,
  66. }],
  67. ['use_ash==1', {
  68. 'use_aura%': 1,
  69. }],
  70. # A flag for BSD platforms
  71. ['OS=="dragonfly" or OS=="freebsd" or OS=="netbsd" or \
  72. OS=="openbsd"', {
  73. 'os_bsd%': 1,
  74. }, {
  75. 'os_bsd%': 0,
  76. }],
  77. ],
  78. },
  79. # Copy conditionally-set variables out one scope.
  80. 'chromeos%': '<(chromeos)',
  81. 'use_aura%': '<(use_aura)',
  82. 'use_ash%': '<(use_ash)',
  83. 'os_bsd%': '<(os_bsd)',
  84. 'use_openssl%': '<(use_openssl)',
  85. 'use_ibus%': '<(use_ibus)',
  86. 'enable_viewport%': '<(enable_viewport)',
  87. 'enable_hidpi%': '<(enable_hidpi)',
  88. 'enable_touch_ui%': '<(enable_touch_ui)',
  89. 'android_upstream_bringup%': '<(android_upstream_bringup)',
  90. 'buildtype%': '<(buildtype)',
  91. # Sets whether we're building with the Android SDK/NDK (and hence with
  92. # Ant, value 0), or as part of the Android system (and hence with the
  93. # Android build system, value 1).
  94. 'android_build_type%': 0,
  95. # Compute the architecture that we're building on.
  96. 'conditions': [
  97. ['OS=="win" or OS=="ios"', {
  98. 'host_arch%': 'ia32',
  99. }, {
  100. # This handles the Unix platforms for which there is some support.
  101. # Anything else gets passed through, which probably won't work very
  102. # well; such hosts should pass an explicit target_arch to gyp.
  103. 'host_arch%':
  104. '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")',
  105. }],
  106. # Set default value of toolkit_views based on OS.
  107. ['OS=="win" or chromeos==1 or use_aura==1', {
  108. 'toolkit_views%': 1,
  109. }, {
  110. 'toolkit_views%': 0,
  111. }],
  112. # Set toolkit_uses_gtk for the Chromium browser on Linux.
  113. ['(OS=="linux" or OS=="solaris" or os_bsd==1) and use_aura==0', {
  114. 'toolkit_uses_gtk%': 1,
  115. }, {
  116. 'toolkit_uses_gtk%': 0,
  117. }],
  118. # Enable HiDPI on Mac OS and Chrome OS.
  119. ['OS=="mac" or chromeos==1', {
  120. 'enable_hidpi%': 1,
  121. }],
  122. # Enable touch UI on Metro.
  123. ['OS=="win"', {
  124. 'enable_touch_ui%': 1,
  125. }],
  126. ],
  127. },
  128. # Copy conditionally-set variables out one scope.
  129. 'chromeos%': '<(chromeos)',
  130. 'host_arch%': '<(host_arch)',
  131. 'toolkit_views%': '<(toolkit_views)',
  132. 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
  133. 'use_aura%': '<(use_aura)',
  134. 'use_ash%': '<(use_ash)',
  135. 'os_bsd%': '<(os_bsd)',
  136. 'use_openssl%': '<(use_openssl)',
  137. 'use_ibus%': '<(use_ibus)',
  138. 'enable_viewport%': '<(enable_viewport)',
  139. 'enable_hidpi%': '<(enable_hidpi)',
  140. 'enable_touch_ui%': '<(enable_touch_ui)',
  141. 'android_upstream_bringup%': '<(android_upstream_bringup)',
  142. 'android_build_type%': '<(android_build_type)',
  143. # We used to provide a variable for changing how libraries were built.
  144. # This variable remains until we can clean up all the users.
  145. # This needs to be one nested variables dict in so that dependent
  146. # gyp files can make use of it in their outer variables. (Yikes!)
  147. # http://code.google.com/p/chromium/issues/detail?id=83308
  148. 'library%': 'static_library',
  149. # Override branding to select the desired branding flavor.
  150. 'branding%': 'Chromium',
  151. 'buildtype%': '<(buildtype)',
  152. # Default architecture we're building for is the architecture we're
  153. # building on.
  154. 'target_arch%': '<(host_arch)',
  155. # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
  156. # are built under a chromium full build (1) or a webkit.org chromium
  157. # build (0).
  158. 'inside_chromium_build%': 1,
  159. # Set to 1 to enable fast builds. It disables debug info for fastest
  160. # compilation.
  161. 'fastbuild%': 0,
  162. # Set to 1 to enable dcheck in release without having to use the flag.
  163. 'dcheck_always_on%': 0,
  164. # Disable file manager component extension by default.
  165. 'file_manager_extension%': 0,
  166. # Python version.
  167. 'python_ver%': '2.6',
  168. # Set ARM version (for libyuv)
  169. 'arm_version%': 6,
  170. # Set ARM-v7 compilation flags
  171. 'armv7%': 0,
  172. # Set Neon compilation flags (only meaningful if armv7==1).
  173. 'arm_neon%': 1,
  174. 'arm_neon_optional%': 0,
  175. # The system root for cross-compiles. Default: none.
  176. 'sysroot%': '',
  177. # The system libdir used for this ABI.
  178. 'system_libdir%': 'lib',
  179. # On Linux, we build with sse2 for Chromium builds.
  180. 'disable_sse2%': 0,
  181. # Use libjpeg-turbo as the JPEG codec used by Chromium.
  182. 'use_libjpeg_turbo%': 1,
  183. # Use system libjpeg. Note that the system's libjepg will be used even if
  184. # use_libjpeg_turbo is set.
  185. 'use_system_libjpeg%': 0,
  186. # Use system libvpx
  187. 'use_system_libvpx%': 0,
  188. # Variable 'component' is for cases where we would like to build some
  189. # components as dynamic shared libraries but still need variable
  190. # 'library' for static libraries.
  191. # By default, component is set to whatever library is set to and
  192. # it can be overriden by the GYP command line or by ~/.gyp/include.gypi.
  193. 'component%': 'static_library',
  194. # Set to select the Title Case versions of strings in GRD files.
  195. 'use_titlecase_in_grd_files%': 0,
  196. # Use translations provided by volunteers at launchpad.net. This
  197. # currently only works on Linux.
  198. 'use_third_party_translations%': 0,
  199. # Remoting compilation is enabled by default. Set to 0 to disable.
  200. 'remoting%': 1,
  201. # Configuration policy is enabled by default. Set to 0 to disable.
  202. 'configuration_policy%': 1,
  203. # Safe browsing is compiled in by default. Set to 0 to disable.
  204. 'safe_browsing%': 1,
  205. # Speech input is compiled in by default. Set to 0 to disable.
  206. 'input_speech%': 1,
  207. # Notifications are compiled in by default. Set to 0 to disable.
  208. 'notifications%' : 1,
  209. # If this is set, the clang plugins used on the buildbot will be used.
  210. # Run tools/clang/scripts/update.sh to make sure they are compiled.
  211. # This causes 'clang_chrome_plugins_flags' to be set.
  212. # Has no effect if 'clang' is not set as well.
  213. 'clang_use_chrome_plugins%': 1,
  214. # Enable building with ASAN (Clang's -faddress-sanitizer option).
  215. # -faddress-sanitizer only works with clang, but asan=1 implies clang=1
  216. # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
  217. 'asan%': 0,
  218. # Enable building with TSAN (Clang's -fthread-sanitizer option).
  219. # -fthread-sanitizer only works with clang, but tsan=1 implies clang=1
  220. # See http://clang.llvm.org/docs/ThreadSanitizer.html
  221. 'tsan%': 0,
  222. # Use a modified version of Clang to intercept allocated types and sizes
  223. # for allocated objects. clang_type_profiler=1 implies clang=1.
  224. # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
  225. # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
  226. 'clang_type_profiler%': 0,
  227. # Set to true to instrument the code with function call logger.
  228. # See src/third_party/cygprofile/cyg-profile.cc for details.
  229. 'order_profiling%': 0,
  230. # Use the provided profiled order file to link Chrome image with it.
  231. # This makes Chrome faster by better using CPU cache when executing code.
  232. # This is known as PGO (profile guided optimization).
  233. # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
  234. 'order_text_section%' : "",
  235. # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
  236. # libraries on linux x86-64 and arm, plus ASLR.
  237. 'linux_fpic%': 1,
  238. # Whether one-click signin is enabled or not.
  239. 'enable_one_click_signin%': 0,
  240. # Enable Web Intents support in WebKit.
  241. 'enable_web_intents%': 1,
  242. # Enable Chrome browser extensions
  243. 'enable_extensions%': 1,
  244. # Enable browser automation.
  245. 'enable_automation%': 1,
  246. # Enable printing support and UI.
  247. 'enable_printing%': 1,
  248. # Enable Web Intents web content registration via HTML element
  249. # and WebUI managing such registrations.
  250. 'enable_web_intents_tag%': 0,
  251. # Webrtc compilation is enabled by default. Set to 0 to disable.
  252. 'enable_webrtc%': 1,
  253. # PPAPI by default does not support plugins making calls off the main
  254. # thread. Set to 1 to turn on experimental support for out-of-process
  255. # plugins to make call of the main thread.
  256. 'enable_pepper_threading%': 0,
  257. # Enables use of the session service, which is enabled by default.
  258. # Support for disabling depends on the platform.
  259. 'enable_session_service%': 1,
  260. # Enables theme support, which is enabled by default. Support for
  261. # disabling depends on the platform.
  262. 'enable_themes%': 1,
  263. # Uses OEM-specific wallpaper resources on Chrome OS.
  264. 'use_oem_wallpaper%': 0,
  265. # Enables support for background apps.
  266. 'enable_background%': 1,
  267. # Enable the task manager by default.
  268. 'enable_task_manager%': 1,
  269. # Enable FTP support by default.
  270. 'disable_ftp_support%': 0,
  271. # XInput2 multitouch support is disabled by default (use_xi2_mt=0).
  272. # Setting to non-zero value enables XI2 MT. When XI2 MT is enabled,
  273. # the input value also defines the required XI2 minor minimum version.
  274. # For example, use_xi2_mt=2 means XI2.2 or above version is required.
  275. 'use_xi2_mt%': 0,
  276. # Use of precompiled headers on Windows.
  277. #
  278. # This is on by default in VS 2010, but off by default for VS
  279. # 2008 because of complications that it can cause with our
  280. # trybots etc.
  281. #
  282. # This variable may be explicitly set to 1 (enabled) or 0
  283. # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
  284. # This setting will override the default.
  285. #
  286. # Note that a setting of 1 is probably suitable for most or all
  287. # Windows developers using VS 2008, since precompiled headers
  288. # provide a build speedup of 20-25%. There are a couple of
  289. # small workarounds you may need to use when using VS 2008 (but
  290. # not 2010), see
  291. # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
  292. # for details.
  293. 'chromium_win_pch%': 0,
  294. # Set this to true when building with Clang.
  295. # See http://code.google.com/p/chromium/wiki/Clang for details.
  296. 'clang%': 0,
  297. # Enable plug-in installation by default.
  298. 'enable_plugin_installation%': 1,
  299. # Enable protector service by default.
  300. 'enable_protector_service%': 1,
  301. # Specifies whether to use canvas_skia.cc in place of platform
  302. # specific implementations of gfx::Canvas. Affects text drawing in the
  303. # Chrome UI.
  304. # TODO(asvitkine): Enable this on all platforms and delete this flag.
  305. # http://crbug.com/105550
  306. 'use_canvas_skia%': 0,
  307. # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
  308. # with one of those tools.
  309. 'build_for_tool%': '',
  310. # Whether tests targets should be run, archived or just have the
  311. # dependencies verified. All the tests targets have the '_run' suffix,
  312. # e.g. base_unittests_run runs the target base_unittests. The test target
  313. # always calls tools/swarm_client/isolate.py. See the script's --help for
  314. # more information and the valid --mode values. Meant to be overriden with
  315. # GYP_DEFINES.
  316. # TODO(maruel): Converted the default from 'check' to 'noop' so work can
  317. # be done while the builders are being reconfigured to check out test data
  318. # files.
  319. 'test_isolation_mode%': 'noop',
  320. # It must not be '<(PRODUCT_DIR)' alone, the '/' is necessary otherwise
  321. # gyp will remove duplicate flags, causing isolate.py to be confused.
  322. 'test_isolation_outdir%': '<(PRODUCT_DIR)/isolate',
  323. # Force rlz to use chrome's networking stack.
  324. 'force_rlz_use_chrome_net%': 1,
  325. 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
  326. 'wix_path%': '<(DEPTH)/third_party/wix',
  327. 'conditions': [
  328. # TODO(epoger): Figure out how to set use_skia=1 for Mac outside of
  329. # the 'conditions' clause. Initial attempts resulted in chromium and
  330. # webkit disagreeing on its setting.
  331. ['OS=="mac"', {
  332. 'use_skia%': 1,
  333. }, {
  334. 'use_skia%': 1,
  335. }],
  336. # A flag for POSIX platforms
  337. ['OS=="win"', {
  338. 'os_posix%': 0,
  339. }, {
  340. 'os_posix%': 1,
  341. }],
  342. # NSS usage.
  343. ['(OS=="linux" or OS=="solaris" or os_bsd==1) and use_openssl==0', {
  344. 'use_nss%': 1,
  345. }, {
  346. 'use_nss%': 0,
  347. }],
  348. # Flags to use X11 on non-Mac POSIX platforms
  349. ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', {
  350. 'use_glib%': 0,
  351. 'use_x11%': 0,
  352. }, {
  353. 'use_glib%': 1,
  354. 'use_x11%': 1,
  355. }],
  356. # We always use skia text rendering in Aura on Windows, since GDI
  357. # doesn't agree with our BackingStore.
  358. # TODO(beng): remove once skia text rendering is on by default.
  359. ['use_aura==1 and OS=="win"', {
  360. 'enable_skia_text%': 1,
  361. }],
  362. # A flag to enable or disable our compile-time dependency
  363. # on gnome-keyring. If that dependency is disabled, no gnome-keyring
  364. # support will be available. This option is useful
  365. # for Linux distributions and for Aura.
  366. ['chromeos==1 or use_aura==1', {
  367. 'use_gnome_keyring%': 0,
  368. }, {
  369. 'use_gnome_keyring%': 1,
  370. }],
  371. ['toolkit_uses_gtk==1 or OS=="mac" or OS=="ios"', {
  372. # GTK+, Mac and iOS want Title Case strings
  373. 'use_titlecase_in_grd_files%': 1,
  374. }],
  375. # Enable file manager extension on Chrome OS.
  376. ['chromeos==1', {
  377. 'file_manager_extension%': 1,
  378. }, {
  379. 'file_manager_extension%': 0,
  380. }],
  381. ['OS=="win" or OS=="mac" or (OS=="linux" and use_aura==0)', {
  382. 'enable_one_click_signin%': 1,
  383. }],
  384. ['OS=="android"', {
  385. 'enable_extensions%': 0,
  386. 'enable_printing%': 0,
  387. 'enable_themes%': 0,
  388. 'enable_webrtc%': 0,
  389. 'proprietary_codecs%': 1,
  390. 'remoting%': 0,
  391. }],
  392. ['OS=="ios"', {
  393. 'configuration_policy%': 0,
  394. 'disable_ftp_support%': 1,
  395. 'enable_automation%': 0,
  396. 'enable_extensions%': 0,
  397. 'enable_printing%': 0,
  398. 'enable_themes%': 0,
  399. 'enable_webrtc%': 0,
  400. 'notifications%': 0,
  401. 'remoting%': 0,
  402. }],
  403. # Use GPU accelerated cross process image transport by default
  404. # on linux builds with the Aura window manager
  405. ['use_aura==1 and OS=="linux"', {
  406. 'ui_compositor_image_transport%': 1,
  407. }, {
  408. 'ui_compositor_image_transport%': 0,
  409. }],
  410. # Turn precompiled headers on by default for VS 2010.
  411. ['OS=="win" and MSVS_VERSION=="2010" and buildtype!="Official"', {
  412. 'chromium_win_pch%': 1
  413. }],
  414. ['use_aura==1 or chromeos==1 or OS=="android"', {
  415. 'enable_plugin_installation%': 0,
  416. }, {
  417. 'enable_plugin_installation%': 1,
  418. }],
  419. ['OS=="android" or OS=="ios"', {
  420. 'enable_protector_service%': 0,
  421. }, {
  422. 'enable_protector_service%': 1,
  423. }],
  424. # linux_use_gold_binary: whether to use the binary checked into
  425. # third_party/gold.
  426. ['OS=="linux"', {
  427. 'linux_use_gold_binary%': 1,
  428. }, {
  429. 'linux_use_gold_binary%': 0,
  430. }],
  431. # linux_use_gold_flags: whether to use build flags that rely on gold.
  432. # On by default for x64 Linux. Temporarily off for ChromeOS as
  433. # it failed on a buildbot.
  434. ['OS=="linux" and chromeos==0', {
  435. 'linux_use_gold_flags%': 1,
  436. }, {
  437. 'linux_use_gold_flags%': 0,
  438. }],
  439. ['OS=="android"', {
  440. 'enable_captive_portal_detection%': 0,
  441. }, {
  442. 'enable_captive_portal_detection%': 1,
  443. }],
  444. # Enable Skia UI text drawing incrementally on different platforms.
  445. # http://crbug.com/105550
  446. #
  447. # On Aura, this allows per-tile painting to be used in the browser
  448. # compositor.
  449. ['OS!="mac" and OS!="android"', {
  450. 'use_canvas_skia%': 1,
  451. }],
  452. ['chromeos==1', {
  453. # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
  454. 'use_libjpeg_turbo%': 0,
  455. }],
  456. ['OS=="android"', {
  457. # When building as part of the Android system, use system libraries
  458. # where possible to reduce ROM size.
  459. 'use_system_libjpeg%': '<(android_build_type)',
  460. }],
  461. ],
  462. # Set this to 1 to use the Google-internal file containing
  463. # official API keys for Google Chrome even in a developer build.
  464. # Setting this variable explicitly to 1 will cause your build to
  465. # fail if the internal file is missing.
  466. #
  467. # Set this to 0 to not use the internal file, even when it
  468. # exists in your checkout.
  469. #
  470. # Leave set to 2 to have this variable implicitly set to 1 if
  471. # you have src/google_apis/internal/google_chrome_api_keys.h in
  472. # your checkout, and implicitly set to 0 if not.
  473. #
  474. # Note that official builds always behave as if this variable
  475. # was explicitly set to 1, i.e. they always use official keys,
  476. # and will fail to build if the internal file is missing.
  477. 'use_official_google_api_keys%': 2,
  478. # Set these to bake the specified API keys and OAuth client
  479. # IDs/secrets into your build.
  480. #
  481. # If you create a build without values baked in, you can instead
  482. # set environment variables to provide the keys at runtime (see
  483. # src/google_apis/google_api_keys.h for details). Features that
  484. # require server-side APIs may fail to work if no keys are
  485. # provided.
  486. #
  487. # Note that if you are building an official build or if
  488. # use_official_google_api_keys has been set to 1 (explicitly or
  489. # implicitly), these values will be ignored and the official
  490. # keys will be used instead.
  491. 'google_api_key%': '',
  492. 'google_default_client_id%': '',
  493. 'google_default_client_secret%': '',
  494. },
  495. # Copy conditionally-set variables out one scope.
  496. 'branding%': '<(branding)',
  497. 'buildtype%': '<(buildtype)',
  498. 'target_arch%': '<(target_arch)',
  499. 'host_arch%': '<(host_arch)',
  500. 'library%': 'static_library',
  501. 'toolkit_views%': '<(toolkit_views)',
  502. 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
  503. 'use_aura%': '<(use_aura)',
  504. 'use_ash%': '<(use_ash)',
  505. 'use_openssl%': '<(use_openssl)',
  506. 'use_ibus%': '<(use_ibus)',
  507. 'use_nss%': '<(use_nss)',
  508. 'os_bsd%': '<(os_bsd)',
  509. 'os_posix%': '<(os_posix)',
  510. 'use_glib%': '<(use_glib)',
  511. 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
  512. 'use_skia%': '<(use_skia)',
  513. 'use_x11%': '<(use_x11)',
  514. 'use_gnome_keyring%': '<(use_gnome_keyring)',
  515. 'linux_fpic%': '<(linux_fpic)',
  516. 'enable_pepper_threading%': '<(enable_pepper_threading)',
  517. 'chromeos%': '<(chromeos)',
  518. 'enable_viewport%': '<(enable_viewport)',
  519. 'enable_hidpi%': '<(enable_hidpi)',
  520. 'enable_touch_ui%': '<(enable_touch_ui)',
  521. 'use_xi2_mt%':'<(use_xi2_mt)',
  522. 'file_manager_extension%': '<(file_manager_extension)',
  523. 'inside_chromium_build%': '<(inside_chromium_build)',
  524. 'fastbuild%': '<(fastbuild)',
  525. 'dcheck_always_on%': '<(dcheck_always_on)',
  526. 'python_ver%': '<(python_ver)',
  527. 'arm_version%': '<(arm_version)',
  528. 'armv7%': '<(armv7)',
  529. 'arm_neon%': '<(arm_neon)',
  530. 'arm_neon_optional%': '<(arm_neon_optional)',
  531. 'sysroot%': '<(sysroot)',
  532. 'system_libdir%': '<(system_libdir)',
  533. 'component%': '<(component)',
  534. 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
  535. 'use_third_party_translations%': '<(use_third_party_translations)',
  536. 'remoting%': '<(remoting)',
  537. 'enable_one_click_signin%': '<(enable_one_click_signin)',
  538. 'enable_webrtc%': '<(enable_webrtc)',
  539. 'chromium_win_pch%': '<(chromium_win_pch)',
  540. 'configuration_policy%': '<(configuration_policy)',
  541. 'safe_browsing%': '<(safe_browsing)',
  542. 'input_speech%': '<(input_speech)',
  543. 'notifications%': '<(notifications)',
  544. 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
  545. 'asan%': '<(asan)',
  546. 'tsan%': '<(tsan)',
  547. 'clang_type_profiler%': '<(clang_type_profiler)',
  548. 'order_profiling%': '<(order_profiling)',
  549. 'order_text_section%': '<(order_text_section)',
  550. 'enable_extensions%': '<(enable_extensions)',
  551. 'enable_web_intents%': '<(enable_web_intents)',
  552. 'enable_web_intents_tag%': '<(enable_web_intents_tag)',
  553. 'enable_plugin_installation%': '<(enable_plugin_installation)',
  554. 'enable_protector_service%': '<(enable_protector_service)',
  555. 'enable_session_service%': '<(enable_session_service)',
  556. 'enable_themes%': '<(enable_themes)',
  557. 'use_oem_wallpaper%': '<(use_oem_wallpaper)',
  558. 'enable_background%': '<(enable_background)',
  559. 'linux_use_gold_binary%': '<(linux_use_gold_binary)',
  560. 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
  561. 'use_canvas_skia%': '<(use_canvas_skia)',
  562. 'test_isolation_mode%': '<(test_isolation_mode)',
  563. 'test_isolation_outdir%': '<(test_isolation_outdir)',
  564. 'enable_automation%': '<(enable_automation)',
  565. 'enable_printing%': '<(enable_printing)',
  566. 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
  567. 'disable_ftp_support%': '<(disable_ftp_support)',
  568. 'force_rlz_use_chrome_net%': '<(force_rlz_use_chrome_net)',
  569. 'enable_task_manager%': '<(enable_task_manager)',
  570. 'sas_dll_path%': '<(sas_dll_path)',
  571. 'wix_path%': '<(wix_path)',
  572. 'android_upstream_bringup%': '<(android_upstream_bringup)',
  573. 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
  574. 'use_system_libjpeg%': '<(use_system_libjpeg)',
  575. 'android_build_type%': '<(android_build_type)',
  576. 'use_official_google_api_keys%': '<(use_official_google_api_keys)',
  577. 'google_api_key%': '<(google_api_key)',
  578. 'google_default_client_id%': '<(google_default_client_id)',
  579. 'google_default_client_secret%': '<(google_default_client_secret)',
  580. # Use system yasm instead of bundled one.
  581. 'use_system_yasm%': 0,
  582. # Default to enabled PIE; this is important for ASLR but we may need to be
  583. # able to turn it off for various reasons.
  584. 'linux_disable_pie%': 0,
  585. # The release channel that this build targets. This is used to restrict
  586. # channel-specific build options, like which installer packages to create.
  587. # The default is 'all', which does no channel-specific filtering.
  588. 'channel%': 'all',
  589. # Override chromium_mac_pch and set it to 0 to suppress the use of
  590. # precompiled headers on the Mac. Prefix header injection may still be
  591. # used, but prefix headers will not be precompiled. This is useful when
  592. # using distcc to distribute a build to compile slaves that don't
  593. # share the same compiler executable as the system driving the compilation,
  594. # because precompiled headers rely on pointers into a specific compiler
  595. # executable's image. Setting this to 0 is needed to use an experimental
  596. # Linux-Mac cross compiler distcc farm.
  597. 'chromium_mac_pch%': 1,
  598. # The default value for mac_strip in target_defaults. This cannot be
  599. # set there, per the comment about variable% in a target_defaults.
  600. 'mac_strip_release%': 1,
  601. # Set to 1 to enable code coverage. In addition to build changes
  602. # (e.g. extra CFLAGS), also creates a new target in the src/chrome
  603. # project file called "coverage".
  604. # Currently ignored on Windows.
  605. 'coverage%': 0,
  606. # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
  607. # This is useful for parallel compilation tools which can't support /Zi.
  608. # Only used on Windows.
  609. 'win_z7%' : 0,
  610. # Although base/allocator lets you select a heap library via an
  611. # environment variable, the libcmt shim it uses sometimes gets in
  612. # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
  613. # 'win_use_allocator_shim': 0,
  614. # 'win_release_RuntimeLibrary': 2
  615. # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
  616. 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
  617. # Whether usage of OpenMAX is enabled.
  618. 'enable_openmax%': 0,
  619. # Whether proprietary audio/video codecs are assumed to be included with
  620. # this build (only meaningful if branding!=Chrome).
  621. 'proprietary_codecs%': 0,
  622. # TODO(bradnelson): eliminate this when possible.
  623. # To allow local gyp files to prevent release.vsprops from being included.
  624. # Yes(1) means include release.vsprops.
  625. # Once all vsprops settings are migrated into gyp, this can go away.
  626. 'msvs_use_common_release%': 1,
  627. # TODO(bradnelson): eliminate this when possible.
  628. # To allow local gyp files to override additional linker options for msvs.
  629. # Yes(1) means set use the common linker options.
  630. 'msvs_use_common_linker_extras%': 1,
  631. # TODO(sgk): eliminate this if possible.
  632. # It would be nicer to support this via a setting in 'target_defaults'
  633. # in chrome/app/locales/locales.gypi overriding the setting in the
  634. # 'Debug' configuration in the 'target_defaults' dict below,
  635. # but that doesn't work as we'd like.
  636. 'msvs_debug_link_incremental%': '2',
  637. # Needed for some of the largest modules.
  638. 'msvs_debug_link_nonincremental%': '1',
  639. # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
  640. # to get incremental linking to be faster in debug builds.
  641. 'incremental_chrome_dll%': '0',
  642. # The default settings for third party code for treating
  643. # warnings-as-errors. Ideally, this would not be required, however there
  644. # is some third party code that takes a long time to fix/roll. So, this
  645. # flag allows us to have warnings as errors in general to prevent
  646. # regressions in most modules, while working on the bits that are
  647. # remaining.
  648. 'win_third_party_warn_as_error%': 'true',
  649. # This is the location of the sandbox binary. Chrome looks for this before
  650. # running the zygote process. If found, and SUID, it will be used to
  651. # sandbox the zygote process and, thus, all renderer processes.
  652. 'linux_sandbox_path%': '',
  653. # Set this to true to enable SELinux support.
  654. 'selinux%': 0,
  655. # Clang stuff.
  656. 'clang%': '<(clang)',
  657. 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
  658. # These two variables can be set in GYP_DEFINES while running
  659. # |gclient runhooks| to let clang run a plugin in every compilation.
  660. # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
  661. # Example:
  662. # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
  663. 'clang_load%': '',
  664. 'clang_add_plugin%': '',
  665. # The default type of gtest.
  666. 'gtest_target_type%': 'executable',
  667. # Enable sampling based profiler.
  668. # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
  669. 'profiling%': '0',
  670. # Enable strict glibc debug mode.
  671. 'glibcxx_debug%': 0,
  672. # Override whether we should use Breakpad on Linux. I.e. for Chrome bot.
  673. 'linux_breakpad%': 0,
  674. # And if we want to dump symbols for Breakpad-enabled builds.
  675. 'linux_dump_symbols%': 0,
  676. # And if we want to strip the binary after dumping symbols.
  677. 'linux_strip_binary%': 0,
  678. # Strip the test binaries needed for Linux reliability tests.
  679. 'linux_strip_reliability_tests%': 0,
  680. # Enable TCMalloc.
  681. 'linux_use_tcmalloc%': 1,
  682. # Disable TCMalloc's debugallocation.
  683. 'linux_use_debugallocation%': 0,
  684. # Disable TCMalloc's heapchecker.
  685. 'linux_use_heapchecker%': 0,
  686. # Disable shadow stack keeping used by heapcheck to unwind the stacks
  687. # better.
  688. 'linux_keep_shadow_stacks%': 0,
  689. # Set to 1 to link against libgnome-keyring instead of using dlopen().
  690. 'linux_link_gnome_keyring%': 0,
  691. # Set to 1 to link against gsettings APIs instead of using dlopen().
  692. 'linux_link_gsettings%': 0,
  693. # Set Thumb compilation flags.
  694. 'arm_thumb%': 0,
  695. # Set ARM fpu compilation flags (only meaningful if armv7==1 and
  696. # arm_neon==0).
  697. 'arm_fpu%': 'vfpv3',
  698. # Set ARM float abi compilation flag.
  699. 'arm_float_abi%': 'softfp',
  700. # Enable new NPDevice API.
  701. 'enable_new_npdevice_api%': 0,
  702. # Enable EGLImage support in OpenMAX
  703. 'enable_eglimage%': 1,
  704. # Enable a variable used elsewhere throughout the GYP files to determine
  705. # whether to compile in the sources for the GPU plugin / process.
  706. 'enable_gpu%': 1,
  707. # .gyp files or targets should set chromium_code to 1 if they build
  708. # Chromium-specific code, as opposed to external code. This variable is
  709. # used to control such things as the set of warnings to enable, and
  710. # whether warnings are treated as errors.
  711. 'chromium_code%': 0,
  712. 'release_valgrind_build%': 0,
  713. # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
  714. 'enable_wexit_time_destructors%': 0,
  715. # Set to 1 to compile with the built in pdf viewer.
  716. 'internal_pdf%': 0,
  717. # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
  718. 'internal_gles2_conform_tests%': 0,
  719. # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
  720. # so Cocoa is happy (http://crbug.com/20441).
  721. 'locales': [
  722. 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
  723. 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
  724. 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
  725. 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
  726. 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
  727. 'vi', 'zh-CN', 'zh-TW',
  728. ],
  729. # Pseudo locales are special locales which are used for testing and
  730. # debugging. They don't get copied to the final app. For more info,
  731. # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
  732. 'pseudo_locales': [
  733. 'fake-bidi',
  734. ],
  735. 'grit_defines': [],
  736. # If debug_devtools is set to 1, JavaScript files for DevTools are
  737. # stored as is and loaded from disk. Otherwise, a concatenated file
  738. # is stored in resources.pak. It is still possible to load JS files
  739. # from disk by passing --debug-devtools cmdline switch.
  740. 'debug_devtools%': 0,
  741. # The Java Bridge is not compiled in by default.
  742. 'java_bridge%': 0,
  743. # Code signing for iOS binaries. The bots need to be able to disable this.
  744. 'chromium_ios_signing%': 1,
  745. # This flag is only used when disable_nacl==0 and disables all those
  746. # subcomponents which would require the installation of a native_client
  747. # untrusted toolchain.
  748. 'disable_nacl_untrusted%': 0,
  749. # Disable Dart by default.
  750. 'enable_dart%': 0,
  751. # The desired version of Windows SDK can be set in ~/.gyp/include.gypi.
  752. 'msbuild_toolset%': '',
  753. # Native Client is enabled by default.
  754. 'disable_nacl%': 0,
  755. # Whether to build full debug version for Debug configuration on Android.
  756. # Compared to full debug version, the default Debug configuration on Android
  757. # has no full v8 debug, has size optimization and linker gc section, so that
  758. # we can build a debug version with acceptable size and performance.
  759. 'android_full_debug%': 0,
  760. # Sets the default version name and code for Android app, by default we
  761. # do a developer build.
  762. 'android_app_version_name%': 'Developer Build',
  763. 'android_app_version_code%': 0,
  764. 'sas_dll_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(sas_dll_path))',
  765. 'wix_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(wix_path))',
  766. 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
  767. 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
  768. 'conditions': [
  769. ['"<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
  770. 'windows_sdk_path%': '<(windows_sdk_default_path)',
  771. }, {
  772. 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
  773. }],
  774. ['OS=="win" and "<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', {
  775. 'directx_sdk_path%': '<(directx_sdk_default_path)',
  776. }, {
  777. 'directx_sdk_path%': '$(DXSDK_DIR)',
  778. }],
  779. # If use_official_google_api_keys is already set (to 0 or 1), we
  780. # do none of the implicit checking. If it is set to 1 and the
  781. # internal keys file is missing, the build will fail at compile
  782. # time. If it is set to 0 and keys are not provided by other
  783. # means, a warning will be printed at compile time.
  784. ['use_official_google_api_keys==2', {
  785. 'use_official_google_api_keys%':
  786. '<!(<(PYTHON) <(DEPTH)/google_apis/build/check_internal.py <(DEPTH)/google_apis/internal/google_chrome_api_keys.h)',
  787. }],
  788. ['os_posix==1 and OS!="mac" and OS!="ios"', {
  789. # Figure out the python architecture to decide if we build pyauto.
  790. # disabled for mozilla because windows != mac and this runs a shell script
  791. # 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/<(system_libdir)/libpython<(python_ver).so.1.0)',
  792. 'conditions': [
  793. # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
  794. # that it takes effect here.
  795. # disabled for Mozilla since it doesn't use this, and 'msys' messes $(CXX) up
  796. ['build_with_mozilla==0 and clang==0 and asan==0 and tsan==0', {
  797. # This will set gcc_version to XY if you are running gcc X.Y.*.
  798. 'gcc_version%': '<!(<(PYTHON) <(DEPTH)/build/compiler_version.py)',
  799. }, {
  800. 'gcc_version%': 0,
  801. }],
  802. ['branding=="Chrome"', {
  803. 'linux_breakpad%': 1,
  804. }],
  805. # All Chrome builds have breakpad symbols, but only process the
  806. # symbols from official builds.
  807. ['(branding=="Chrome" and buildtype=="Official")', {
  808. 'linux_dump_symbols%': 1,
  809. }],
  810. ],
  811. }], # os_posix==1 and OS!="mac" and OS!="ios"
  812. ['OS=="ios"', {
  813. 'disable_nacl%': 1,
  814. 'enable_gpu%': 0,
  815. 'icu_use_data_file_flag%': 1,
  816. 'use_system_bzip2%': 1,
  817. 'use_system_libxml%': 1,
  818. 'use_system_sqlite%': 1,
  819. # The Mac SDK is set for iOS builds and passed through to Mac
  820. # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
  821. # overridden from the command line the same way it is for a Mac build.
  822. 'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py 10.6)',
  823. # iOS SDK and deployment target support. The iOS 5.0 SDK is actually
  824. # what is required, but the value is left blank so when it is set in
  825. # the project files it will be the "current" iOS SDK. Forcing 5.0
  826. # even though it is "current" causes Xcode to spit out a warning for
  827. # every single project file for not using the "current" SDK.
  828. 'ios_sdk%': '',
  829. 'ios_sdk_path%': '',
  830. 'ios_deployment_target%': '4.3',
  831. 'conditions': [
  832. # ios_product_name is set to the name of the .app bundle as it should
  833. # appear on disk.
  834. ['branding=="Chrome"', {
  835. 'ios_product_name%': 'Chrome',
  836. }, { # else: branding!="Chrome"
  837. 'ios_product_name%': 'Chromium',
  838. }],
  839. ['branding=="Chrome" and buildtype=="Official"', {
  840. 'ios_breakpad%': 1,
  841. }, { # else: branding!="Chrome" or buildtype!="Official"
  842. 'ios_breakpad%': 0,
  843. }],
  844. ],
  845. }], # OS=="ios"
  846. ['OS=="android"', {
  847. # Location of Android NDK.
  848. 'variables': {
  849. 'variables': {
  850. 'variables': {
  851. 'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)',
  852. },
  853. 'android_ndk_root%': '<(android_ndk_root)',
  854. 'conditions': [
  855. ['target_arch == "ia32"', {
  856. 'android_app_abi%': 'x86',
  857. 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-9/arch-x86',
  858. }],
  859. ['target_arch=="arm"', {
  860. 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-9/arch-arm',
  861. 'conditions': [
  862. ['armv7==0', {
  863. 'android_app_abi%': 'armeabi',
  864. }, {
  865. 'android_app_abi%': 'armeabi-v7a',
  866. }],
  867. ],
  868. }],
  869. ['target_arch=="arm64"', {
  870. 'android_app_abi%': 'arm64-v8a',
  871. 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
  872. }],
  873. ],
  874. },
  875. 'android_ndk_root%': '<(android_ndk_root)',
  876. 'android_app_abi%': '<(android_app_abi)',
  877. 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
  878. },
  879. 'android_ndk_root%': '<(android_ndk_root)',
  880. 'android_ndk_sysroot': '<(android_ndk_sysroot)',
  881. 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
  882. 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib',
  883. 'android_app_abi%': '<(android_app_abi)',
  884. # Location of the "strip" binary, used by both gyp and scripts.
  885. 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
  886. # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used
  887. # to specify the output directory for Ant in the Android build.
  888. 'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`',
  889. # Uses Android's crash report system
  890. 'linux_breakpad%': 0,
  891. # Always uses openssl.
  892. 'use_openssl%': 1,
  893. 'proprietary_codecs%': '<(proprietary_codecs)',
  894. 'enable_task_manager%': 0,
  895. 'safe_browsing%': 0,
  896. 'configuration_policy%': 0,
  897. 'input_speech%': 0,
  898. 'enable_web_intents%': 0,
  899. 'enable_automation%': 0,
  900. 'java_bridge%': 1,
  901. 'build_ffmpegsumo%': 0,
  902. 'linux_use_tcmalloc%': 0,
  903. # Disable Native Client.
  904. 'disable_nacl%': 1,
  905. # Android does not support background apps.
  906. 'enable_background%': 0,
  907. # Sessions are store separately in the Java side.
  908. 'enable_session_service%': 0,
  909. # Set to 1 once we have a notification system for Android.
  910. # http://crbug.com/115320
  911. 'notifications%': 0,
  912. 'p2p_apis%' : 0,
  913. # TODO(jrg): when 'gtest_target_type'=='shared_library' and
  914. # OS==android, make all gtest_targets depend on
  915. # testing/android/native_test.gyp:native_test_apk.
  916. 'gtest_target_type%': 'shared_library',
  917. # Uses system APIs for decoding audio and video.
  918. 'use_libffmpeg%': '0',
  919. # Always use the chromium skia. The use_system_harfbuzz needs to
  920. # match use_system_skia.
  921. 'use_system_skia%': '0',
  922. 'use_system_harfbuzz%': '0',
  923. # Configure crash reporting and build options based on release type.
  924. 'conditions': [
  925. ['buildtype=="Official"', {
  926. # Only report crash dumps for Official builds.
  927. 'linux_breakpad%': 1,
  928. }, {
  929. 'linux_breakpad%': 0,
  930. }],
  931. ],
  932. # When building as part of the Android system, use system libraries
  933. # where possible to reduce ROM size.
  934. # TODO(steveblock): Investigate using the system version of sqlite.
  935. 'use_system_sqlite%': 0, # '<(android_build_type)',
  936. 'use_system_expat%': '<(android_build_type)',
  937. 'use_system_icu%': '<(android_build_type)',
  938. 'use_system_stlport%': '<(android_build_type)',
  939. # Copy it out one scope.
  940. 'android_build_type%': '<(android_build_type)',
  941. }], # OS=="android"
  942. ['OS=="mac"', {
  943. 'variables': {
  944. # Mac OS X SDK and deployment target support. The SDK identifies
  945. # the version of the system headers that will be used, and
  946. # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
  947. # macro. "Maximum allowed" refers to the operating system version
  948. # whose APIs are available in the headers. The deployment target
  949. # identifies the minimum system version that the built products are
  950. # expected to function on. It corresponds to the
  951. # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
  952. # macros are available, #include <AvailabilityMacros.h>. Additional
  953. # documentation on these macros is available at
  954. # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
  955. # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
  956. # deployment target to 10.6. Other projects, such as O3D, may
  957. # override these defaults.
  958. # Normally, mac_sdk_min is used to find an SDK that Xcode knows
  959. # about that is at least the specified version. In official builds,
  960. # the SDK must match mac_sdk_min exactly. If the SDK is installed
  961. # someplace that Xcode doesn't know about, set mac_sdk_path to the
  962. # path to the SDK; when set to a non-empty string, SDK detection
  963. # based on mac_sdk_min will be bypassed entirely.
  964. 'mac_sdk_min%': '10.6',
  965. 'mac_sdk_path%': '',
  966. 'mac_deployment_target%': '10.6',
  967. },
  968. 'mac_sdk_min': '<(mac_sdk_min)',
  969. 'mac_sdk_path': '<(mac_sdk_path)',
  970. 'mac_deployment_target': '<(mac_deployment_target)',
  971. # Enable clang on mac by default!
  972. 'clang%': 1,
  973. # Compile in Breakpad support by default so that it can be
  974. # tested, even if it is not enabled by default at runtime.
  975. 'mac_breakpad_compiled_in%': 1,
  976. 'conditions': [
  977. # mac_product_name is set to the name of the .app bundle as it should
  978. # appear on disk. This duplicates data from
  979. # chrome/app/theme/chromium/BRANDING and
  980. # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
  981. # these names into the build system.
  982. ['branding=="Chrome"', {
  983. 'mac_product_name%': 'Google Chrome',
  984. }, { # else: branding!="Chrome"
  985. 'mac_product_name%': 'Chromium',
  986. }],
  987. ['branding=="Chrome" and buildtype=="Official"', {
  988. 'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
  989. # Enable uploading crash dumps.
  990. 'mac_breakpad_uploads%': 1,
  991. # Enable dumping symbols at build time for use by Mac Breakpad.
  992. 'mac_breakpad%': 1,
  993. # Enable Keystone auto-update support.
  994. 'mac_keystone%': 1,
  995. }, { # else: branding!="Chrome" or buildtype!="Official"
  996. 'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk_uxp.py <(mac_sdk_path))',
  997. 'mac_breakpad_uploads%': 0,
  998. 'mac_breakpad%': 0,
  999. 'mac_keystone%': 0,
  1000. }],
  1001. ],
  1002. }], # OS=="mac"
  1003. ['OS=="win"', {
  1004. 'conditions': [
  1005. ['component=="shared_library"', {
  1006. 'win_use_allocator_shim%': 0,
  1007. }],
  1008. ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
  1009. # Only enabled by default for ninja because it's buggy in VS.
  1010. # Not enabled for component=static_library because some targets
  1011. # are too large and the toolchain fails due to the size of the
  1012. # .obj files.
  1013. 'incremental_chrome_dll%': 1,
  1014. }],
  1015. # Don't do incremental linking for large modules on 32-bit.
  1016. ['MSVS_OS_BITS==32', {
  1017. 'msvs_large_module_debug_link_mode%': '1', # No
  1018. },{
  1019. 'msvs_large_module_debug_link_mode%': '2', # Yes
  1020. }],
  1021. ['MSVS_VERSION=="2010e" or MSVS_VERSION=="2008e" or MSVS_VERSION=="2005e"', {
  1022. 'msvs_express%': 1,
  1023. 'secure_atl%': 0,
  1024. },{
  1025. 'msvs_express%': 0,
  1026. 'secure_atl%': 1,
  1027. }],
  1028. ],
  1029. 'nacl_win64_defines': [
  1030. # This flag is used to minimize dependencies when building
  1031. # Native Client loader for 64-bit Windows.
  1032. 'NACL_WIN64',
  1033. ],
  1034. }],
  1035. ['os_posix==1 and chromeos==0 and OS!="android"', {
  1036. 'use_cups%': 1,
  1037. }, {
  1038. 'use_cups%': 0,
  1039. }],
  1040. # Native Client glibc toolchain is enabled by default except on arm.
  1041. ['target_arch=="arm"', {
  1042. 'disable_glibc%': 1,
  1043. }, {
  1044. 'disable_glibc%': 0,
  1045. }],
  1046. # Disable SSE2 when building for ARM or MIPS.
  1047. ['target_arch=="arm" or target_arch=="mipsel"', {
  1048. 'disable_sse2%': 1,
  1049. }, {
  1050. 'disable_sse2%': '<(disable_sse2)',
  1051. }],
  1052. # Set the relative path from this file to the GYP file of the JPEG
  1053. # library used by Chromium.
  1054. ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
  1055. # Configuration for using the system libjeg is here.
  1056. 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
  1057. }, {
  1058. 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
  1059. }],
  1060. # Options controlling the use of GConf (the classic GNOME configuration
  1061. # system) and GIO, which contains GSettings (the new GNOME config system).
  1062. ['chromeos==1', {
  1063. 'use_gconf%': 0,
  1064. 'use_gio%': 0,
  1065. }, {
  1066. 'use_gconf%': 1,
  1067. 'use_gio%': 1,
  1068. }],
  1069. # Set up -D and -E flags passed into grit.
  1070. ['branding=="Chrome"', {
  1071. # TODO(mmoss) The .grd files look for _google_chrome, but for
  1072. # consistency they should look for google_chrome_build like C++.
  1073. 'grit_defines': ['-D', '_google_chrome',
  1074. '-E', 'CHROMIUM_BUILD=google_chrome'],
  1075. }, {
  1076. 'grit_defines': ['-D', '_chromium',
  1077. '-E', 'CHROMIUM_BUILD=chromium'],
  1078. }],
  1079. ['chromeos==1', {
  1080. 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
  1081. }],
  1082. ['toolkit_views==1', {
  1083. 'grit_defines': ['-D', 'toolkit_views'],
  1084. }],
  1085. ['use_aura==1', {
  1086. 'grit_defines': ['-D', 'use_aura'],
  1087. }],
  1088. ['use_ash==1', {
  1089. 'grit_defines': ['-D', 'use_ash'],
  1090. }],
  1091. ['use_nss==1', {
  1092. 'grit_defines': ['-D', 'use_nss'],
  1093. }],
  1094. ['file_manager_extension==1', {
  1095. 'grit_defines': ['-D', 'file_manager_extension'],
  1096. }],
  1097. ['remoting==1', {
  1098. 'grit_defines': ['-D', 'remoting'],
  1099. }],
  1100. ['use_titlecase_in_grd_files==1', {
  1101. 'grit_defines': ['-D', 'use_titlecase'],
  1102. }],
  1103. ['use_third_party_translations==1', {
  1104. 'grit_defines': ['-D', 'use_third_party_translations'],
  1105. 'locales': [
  1106. 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
  1107. 'ka', 'ku', 'kw', 'ms', 'ug'
  1108. ],
  1109. }],
  1110. ['OS=="android"', {
  1111. 'grit_defines': ['-D', 'android'],
  1112. }],
  1113. ['OS=="mac"', {
  1114. 'grit_defines': ['-D', 'scale_factors=2x'],
  1115. }],
  1116. ['OS == "ios"', {
  1117. 'grit_defines': [
  1118. # define for iOS specific resources.
  1119. '-D', 'ios',
  1120. # iOS uses a whitelist to filter resources.
  1121. '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
  1122. ],
  1123. }],
  1124. ['enable_extensions==1', {
  1125. 'grit_defines': ['-D', 'enable_extensions'],
  1126. }],
  1127. ['enable_printing==1', {
  1128. 'grit_defines': ['-D', 'enable_printing'],
  1129. }],
  1130. ['enable_themes==1', {
  1131. 'grit_defines': ['-D', 'enable_themes'],
  1132. }],
  1133. ['use_oem_wallpaper==1', {
  1134. 'grit_defines': ['-D', 'use_oem_wallpaper'],
  1135. }],
  1136. ['clang_use_chrome_plugins==1 and OS!="win"', {
  1137. 'clang_chrome_plugins_flags': [
  1138. '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
  1139. ],
  1140. }],
  1141. ['enable_web_intents_tag==1', {
  1142. 'grit_defines': ['-D', 'enable_web_intents_tag'],
  1143. }],
  1144. ['asan==1', {
  1145. 'clang%': 1,
  1146. }],
  1147. ['asan==1 and OS=="mac"', {
  1148. # See http://crbug.com/145503.
  1149. 'component': "static_library",
  1150. }],
  1151. ['tsan==1', {
  1152. 'clang%': 1,
  1153. }],
  1154. ['OS=="linux" and clang_type_profiler==1', {
  1155. 'clang%': 1,
  1156. 'clang_use_chrome_plugins%': 0,
  1157. 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
  1158. }],
  1159. # On valgrind bots, override the optimizer settings so we don't inline too
  1160. # much and make the stacks harder to figure out.
  1161. #
  1162. # TODO(rnk): Kill off variables that no one else uses and just implement
  1163. # them under a build_for_tool== condition.
  1164. ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
  1165. # gcc flags
  1166. 'mac_debug_optimization': '1',
  1167. 'mac_release_optimization': '1',
  1168. 'release_optimize': '1',
  1169. 'no_gc_sections': 1,
  1170. 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
  1171. '-fno-builtin -fno-optimize-sibling-calls',
  1172. 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
  1173. '-fno-builtin -fno-optimize-sibling-calls',
  1174. # MSVS flags for TSan on Pin and Windows.
  1175. 'win_debug_RuntimeChecks': '0',
  1176. 'win_debug_disable_iterator_debugging': '1',
  1177. 'win_debug_Optimization': '1',
  1178. 'win_debug_InlineFunctionExpansion': '0',
  1179. 'win_release_InlineFunctionExpansion': '0',
  1180. 'win_release_OmitFramePointers': '0',
  1181. 'linux_use_tcmalloc': 1,
  1182. 'release_valgrind_build': 1,
  1183. 'werror': '',
  1184. 'component': 'static_library',
  1185. 'use_system_zlib': 0,
  1186. }],
  1187. # Build tweaks for DrMemory.
  1188. # TODO(rnk): Combine with tsan config to share the builder.
  1189. # http://crbug.com/108155
  1190. ['build_for_tool=="drmemory"', {
  1191. # These runtime checks force initialization of stack vars which blocks
  1192. # DrMemory's uninit detection.
  1193. 'win_debug_RuntimeChecks': '0',
  1194. # Iterator debugging is slow.
  1195. 'win_debug_disable_iterator_debugging': '1',
  1196. # Try to disable optimizations that mess up stacks in a release build.
  1197. 'win_release_InlineFunctionExpansion': '0',
  1198. 'win_release_OmitFramePointers': '0',
  1199. # Ditto for debug, to support bumping win_debug_Optimization.
  1200. 'win_debug_InlineFunctionExpansion': 0,
  1201. 'win_debug_OmitFramePointers': 0,
  1202. # Keep the code under #ifndef NVALGRIND.
  1203. 'release_valgrind_build': 1,
  1204. }],
  1205. ],
  1206. # List of default apps to install in new profiles. The first list contains
  1207. # the source files as found in svn. The second list, used only for linux,
  1208. # contains the destination location for each of the files. When a crx
  1209. # is added or removed from the list, the chrome/browser/resources/
  1210. # default_apps/external_extensions.json file must also be updated.
  1211. 'default_apps_list': [
  1212. 'browser/resources/default_apps/external_extensions.json',
  1213. 'browser/resources/default_apps/gmail.crx',
  1214. 'browser/resources/default_apps/search.crx',
  1215. 'browser/resources/default_apps/youtube.crx',
  1216. 'browser/resources/default_apps/drive.crx',
  1217. 'browser/resources/default_apps/docs.crx',
  1218. ],
  1219. 'default_apps_list_linux_dest': [
  1220. '<(PRODUCT_DIR)/default_apps/external_extensions.json',
  1221. '<(PRODUCT_DIR)/default_apps/gmail.crx',
  1222. '<(PRODUCT_DIR)/default_apps/search.crx',
  1223. '<(PRODUCT_DIR)/default_apps/youtube.crx',
  1224. '<(PRODUCT_DIR)/default_apps/drive.crx',
  1225. '<(PRODUCT_DIR)/default_apps/docs.crx',
  1226. ],
  1227. },
  1228. 'target_defaults': {
  1229. 'variables': {
  1230. # The condition that operates on chromium_code is in a target_conditions
  1231. # section, and will not have access to the default fallback value of
  1232. # chromium_code at the top of this file, or to the chromium_code
  1233. # variable placed at the root variables scope of .gyp files, because
  1234. # those variables are not set at target scope. As a workaround,
  1235. # if chromium_code is not set at target scope, define it in target scope
  1236. # to contain whatever value it has during early variable expansion.
  1237. # That's enough to make it available during target conditional
  1238. # processing.
  1239. 'chromium_code%': '<(chromium_code)',
  1240. # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
  1241. 'win_release_Optimization%': '2', # 2 = /Os
  1242. 'win_debug_Optimization%': '0', # 0 = /Od
  1243. # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
  1244. # Tri-state: blank is default, 1 on, 0 off
  1245. 'win_release_OmitFramePointers%': '0',
  1246. # Tri-state: blank is default, 1 on, 0 off
  1247. 'win_debug_OmitFramePointers%': '',
  1248. # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
  1249. 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
  1250. # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
  1251. 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
  1252. 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
  1253. # VS inserts quite a lot of extra checks to algorithms like
  1254. # std::partial_sort in Debug build which make them O(N^2)
  1255. # instead of O(N*logN). This is particularly slow under memory
  1256. # tools like ThreadSanitizer so we want it to be disablable.
  1257. # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
  1258. 'win_debug_disable_iterator_debugging%': '0',
  1259. 'release_extra_cflags%': '',
  1260. 'debug_extra_cflags%': '',
  1261. 'release_valgrind_build%': '<(release_valgrind_build)',
  1262. # the non-qualified versions are widely assumed to be *nix-only
  1263. 'win_release_extra_cflags%': '',
  1264. 'win_debug_extra_cflags%': '',
  1265. # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
  1266. 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
  1267. # Only used by Windows build for now. Can be used to build into a
  1268. # differet output directory, e.g., a build_dir_prefix of VS2010_ would
  1269. # output files in src/build/VS2010_{Debug,Release}.
  1270. 'build_dir_prefix%': '',
  1271. # Targets are by default not nacl untrusted code.
  1272. 'nacl_untrusted_build%': 0,
  1273. 'conditions': [
  1274. ['OS=="win" and component=="shared_library"', {
  1275. # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
  1276. 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
  1277. 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
  1278. }, {
  1279. # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
  1280. 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
  1281. 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
  1282. }],
  1283. ['OS=="ios"', {
  1284. # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
  1285. 'mac_release_optimization%': 's', # Use -Os unless overridden
  1286. 'mac_debug_optimization%': '0', # Use -O0 unless overridden
  1287. }, {
  1288. # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
  1289. 'mac_release_optimization%': '3', # Use -O3 unless overridden
  1290. 'mac_debug_optimization%': '0', # Use -O0 unless overridden
  1291. }],
  1292. ],
  1293. },
  1294. 'conditions': [
  1295. ['OS=="linux" and linux_use_tcmalloc==1 and clang_type_profiler==1', {
  1296. 'cflags_cc!': ['-fno-rtti'],
  1297. 'cflags_cc+': [
  1298. '-frtti',
  1299. '-gline-tables-only',
  1300. '-fintercept-allocation-functions',
  1301. ],
  1302. 'defines': ['TYPE_PROFILING'],
  1303. 'dependencies': [
  1304. '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
  1305. ],
  1306. }],
  1307. ['OS=="win" and "<(msbuild_toolset)"!=""', {
  1308. 'msbuild_toolset': '<(msbuild_toolset)',
  1309. }],
  1310. ['branding=="Chrome"', {
  1311. 'defines': ['GOOGLE_CHROME_BUILD'],
  1312. }, { # else: branding!="Chrome"
  1313. 'defines': ['CHROMIUM_BUILD'],
  1314. }],
  1315. ['OS=="mac" and component=="shared_library"', {
  1316. 'xcode_settings': {
  1317. 'DYLIB_INSTALL_NAME_BASE': '@rpath',
  1318. 'LD_RUNPATH_SEARCH_PATHS': [
  1319. # For unbundled binaries.
  1320. '@loader_path/.',
  1321. # For bundled binaries, to get back from Binary.app/Contents/MacOS.
  1322. '@loader_path/../../..',
  1323. ],
  1324. },
  1325. }],
  1326. ['branding=="Chrome" and (OS=="win" or OS=="mac")', {
  1327. 'defines': ['ENABLE_RLZ'],
  1328. }],
  1329. ['component=="shared_library"', {
  1330. 'defines': ['COMPONENT_BUILD'],
  1331. }],
  1332. ['toolkit_views==1', {
  1333. 'defines': ['TOOLKIT_VIEWS=1'],
  1334. }],
  1335. ['ui_compositor_image_transport==1', {
  1336. 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
  1337. }],
  1338. ['use_aura==1', {
  1339. 'defines': ['USE_AURA=1'],
  1340. }],
  1341. ['use_ash==1', {
  1342. 'defines': ['USE_ASH=1'],
  1343. }],
  1344. ['use_libjpeg_turbo==1', {
  1345. 'defines': ['USE_LIBJPEG_TURBO=1'],
  1346. }],
  1347. ['use_nss==1', {
  1348. 'defines': ['USE_NSS=1'],
  1349. }],
  1350. ['enable_one_click_signin==1', {
  1351. 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
  1352. }],
  1353. ['toolkit_uses_gtk==1 and toolkit_views==0', {
  1354. # TODO(erg): We are progressively sealing up use of deprecated features
  1355. # in gtk in preparation for an eventual porting to gtk3.
  1356. 'defines': ['GTK_DISABLE_SINGLE_INCLUDES=1'],
  1357. }],
  1358. ['chromeos==1', {
  1359. 'defines': ['OS_CHROMEOS=1'],
  1360. }],
  1361. ['use_xi2_mt!=0', {
  1362. 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
  1363. }],
  1364. ['file_manager_extension==1', {
  1365. 'defines': ['FILE_MANAGER_EXTENSION=1'],
  1366. }],
  1367. ['profiling==1', {
  1368. 'defines': ['ENABLE_PROFILING=1'],
  1369. }],
  1370. ['OS=="linux" and glibcxx_debug==1', {
  1371. 'defines': ['_GLIBCXX_DEBUG=1',],
  1372. 'cflags_cc!': ['-fno-rtti'],
  1373. 'cflags_cc+': ['-frtti', '-g'],
  1374. }],
  1375. ['OS=="linux"', {
  1376. # we need lrint(), which is ISOC99, and Xcode
  1377. # already forces -std=c99 for mac below
  1378. 'defines': ['_ISOC99_SOURCE=1'],
  1379. }],
  1380. ['remoting==1', {
  1381. 'defines': ['ENABLE_REMOTING=1'],
  1382. }],
  1383. ['enable_webrtc==1', {
  1384. 'defines': ['ENABLE_WEBRTC=1'],
  1385. }],
  1386. ['proprietary_codecs==1', {
  1387. 'defines': ['USE_PROPRIETARY_CODECS'],
  1388. }],
  1389. ['enable_pepper_threading==1', {
  1390. 'defines': ['ENABLE_PEPPER_THREADING'],
  1391. }],
  1392. ['enable_viewport==1', {
  1393. 'defines': ['ENABLE_VIEWPORT'],
  1394. }],
  1395. ['configuration_policy==1', {
  1396. 'defines': ['ENABLE_CONFIGURATION_POLICY'],
  1397. }],
  1398. ['input_speech==1', {
  1399. 'defines': ['ENABLE_INPUT_SPEECH'],
  1400. }],
  1401. ['notifications==1', {
  1402. 'defines': ['ENABLE_NOTIFICATIONS'],
  1403. }],
  1404. ['enable_hidpi==1', {
  1405. 'defines': ['ENABLE_HIDPI=1'],
  1406. }],
  1407. ['fastbuild!=0', {
  1408. 'conditions': [
  1409. # For Windows and Mac, we don't genererate debug information.
  1410. ['OS=="win" or OS=="mac"', {
  1411. 'msvs_settings': {
  1412. 'VCLinkerTool': {
  1413. 'GenerateDebugInformation': 'false',
  1414. },
  1415. 'VCCLCompilerTool': {
  1416. 'DebugInformationFormat': '0',
  1417. }
  1418. },
  1419. 'xcode_settings': {
  1420. 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
  1421. },
  1422. }, { # else: OS != "win", generate less debug information.
  1423. 'variables': {
  1424. 'debug_extra_cflags': '-g1',
  1425. },
  1426. }],
  1427. # Clang creates chubby debug information, which makes linking very
  1428. # slow. For now, don't create debug information with clang. See
  1429. # http://crbug.com/70000
  1430. ['(OS=="linux" or OS=="android") and clang==1', {
  1431. 'variables': {
  1432. 'debug_extra_cflags': '-g0',
  1433. },
  1434. }],
  1435. ], # conditions for fastbuild.
  1436. }], # fastbuild!=0
  1437. ['dcheck_always_on!=0', {
  1438. 'defines': ['DCHECK_ALWAYS_ON=1'],
  1439. }], # dcheck_always_on!=0
  1440. ['selinux==1', {
  1441. 'defines': ['CHROMIUM_SELINUX=1'],
  1442. }],
  1443. ['win_use_allocator_shim==0', {
  1444. 'conditions': [
  1445. ['OS=="win"', {
  1446. 'defines': ['NO_TCMALLOC'],
  1447. }],
  1448. ],
  1449. }],
  1450. ['enable_gpu==1', {
  1451. 'defines': [
  1452. 'ENABLE_GPU=1',
  1453. ],
  1454. }],
  1455. ['use_openssl==1', {
  1456. 'defines': [
  1457. 'USE_OPENSSL=1',
  1458. ],
  1459. }],
  1460. ['enable_eglimage==1', {
  1461. 'defines': [
  1462. 'ENABLE_EGLIMAGE=1',
  1463. ],
  1464. }],
  1465. ['use_skia==1', {
  1466. 'defines': [
  1467. 'USE_SKIA=1',
  1468. ],
  1469. }],
  1470. ['coverage!=0', {
  1471. 'conditions': [
  1472. ['OS=="mac" or OS=="ios"', {
  1473. 'xcode_settings': {
  1474. 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
  1475. 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
  1476. },
  1477. }],
  1478. ['OS=="mac"', {
  1479. # Add -lgcov for types executable, shared_library, and
  1480. # loadable_module; not for static_library.
  1481. # This is a delayed conditional.
  1482. 'target_conditions': [
  1483. ['_type!="static_library"', {
  1484. 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
  1485. }],
  1486. ],
  1487. }],
  1488. ['OS=="linux" or OS=="android"', {
  1489. 'cflags': [ '-ftest-coverage',
  1490. '-fprofile-arcs' ],
  1491. 'link_settings': { 'libraries': [ '-lgcov' ] },
  1492. }],
  1493. # Finally, for Windows, we simply turn on profiling.
  1494. ['OS=="win"', {
  1495. 'msvs_settings': {
  1496. 'VCLinkerTool': {
  1497. 'Profile': 'true',
  1498. },
  1499. 'VCCLCompilerTool': {
  1500. # /Z7, not /Zi, so coverage is happyb
  1501. 'DebugInformationFormat': '1',
  1502. 'AdditionalOptions': ['/Yd'],
  1503. }
  1504. }
  1505. }], # OS==win
  1506. ], # conditions for coverage
  1507. }], # coverage!=0
  1508. ['OS=="win"', {
  1509. 'defines': [
  1510. '__STD_C',
  1511. '_CRT_SECURE_NO_DEPRECATE',
  1512. '_SCL_SECURE_NO_DEPRECATE',
  1513. ],
  1514. 'include_dirs': [
  1515. '<(DEPTH)/third_party/wtl/include',
  1516. ],
  1517. 'conditions': [
  1518. ['win_z7!=0', {
  1519. 'msvs_settings': {
  1520. # Generates debug info when win_z7=1
  1521. # even if fastbuild=1 (that makes GenerateDebugInformation false).
  1522. 'VCLinkerTool': {
  1523. 'GenerateDebugInformation': 'true',
  1524. },
  1525. 'VCCLCompilerTool': {
  1526. 'DebugInformationFormat': '1',
  1527. }
  1528. }
  1529. }],
  1530. ], # win_z7!=0
  1531. }], # OS==win
  1532. ['enable_task_manager==1', {
  1533. 'defines': [
  1534. 'ENABLE_TASK_MANAGER=1',
  1535. ],
  1536. }],
  1537. ['enable_web_intents==1', {
  1538. 'defines': [
  1539. 'ENABLE_WEB_INTENTS=1',
  1540. ],
  1541. }],
  1542. ['enable_extensions==1', {
  1543. 'defines': [
  1544. 'ENABLE_EXTENSIONS=1',
  1545. ],
  1546. }],
  1547. ['OS=="win" and branding=="Chrome"', {
  1548. 'defines': ['ENABLE_SWIFTSHADER'],
  1549. }],
  1550. ['enable_dart==1', {
  1551. 'defines': ['WEBKIT_USING_DART=1'],
  1552. }],
  1553. ['enable_plugin_installation==1', {
  1554. 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
  1555. }],
  1556. ['enable_protector_service==1', {
  1557. 'defines': ['ENABLE_PROTECTOR_SERVICE=1'],
  1558. }],
  1559. ['enable_session_service==1', {
  1560. 'defines': ['ENABLE_SESSION_SERVICE=1'],
  1561. }],
  1562. ['enable_themes==1', {
  1563. 'defines': ['ENABLE_THEMES=1'],
  1564. }],
  1565. ['enable_background==1', {
  1566. 'defines': ['ENABLE_BACKGROUND=1'],
  1567. }],
  1568. ['enable_automation==1', {
  1569. 'defines': ['ENABLE_AUTOMATION=1'],
  1570. }],
  1571. ['enable_printing==1', {
  1572. 'defines': ['ENABLE_PRINTING=1'],
  1573. }],
  1574. ['enable_captive_portal_detection==1', {
  1575. 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
  1576. }],
  1577. ['disable_ftp_support==1', {
  1578. 'defines': ['DISABLE_FTP_SUPPORT=1'],
  1579. }],
  1580. ], # conditions for 'target_defaults'
  1581. 'target_conditions': [
  1582. ['enable_wexit_time_destructors==1', {
  1583. 'conditions': [
  1584. [ 'clang==1', {
  1585. 'cflags': [
  1586. '-Wexit-time-destructors',
  1587. ],
  1588. 'xcode_settings': {
  1589. 'WARNING_CFLAGS': [
  1590. '-Wexit-time-destructors',
  1591. ],
  1592. },
  1593. }],
  1594. ],
  1595. }],
  1596. ['chromium_code==0', {
  1597. 'conditions': [
  1598. [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
  1599. # We don't want to get warnings from third-party code,
  1600. # so remove any existing warning-enabling flags like -Wall.
  1601. 'cflags!': [
  1602. '-Wall',
  1603. '-Wextra',
  1604. ],
  1605. 'cflags_cc': [
  1606. # Don't warn about hash_map in third-party code.
  1607. '-Wno-deprecated',
  1608. ],
  1609. 'cflags': [
  1610. # Don't warn about printf format problems.
  1611. # This is off by default in gcc but on in Ubuntu's gcc(!).
  1612. '-Wno-format',
  1613. ],
  1614. 'cflags_cc!': [
  1615. # TODO(fischman): remove this.
  1616. # http://code.google.com/p/chromium/issues/detail?id=90453
  1617. '-Wsign-compare',
  1618. ]
  1619. }],
  1620. # TODO: Fix all warnings on chromeos too.
  1621. [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
  1622. 'cflags!': [
  1623. '-Werror',
  1624. ],
  1625. }],
  1626. [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
  1627. 'cflags': [
  1628. # Don't warn about ignoring the return value from e.g. close().
  1629. # This is off by default in some gccs but on by default in others.
  1630. # BSD systems do not support this option, since they are usually
  1631. # using gcc 4.2.1, which does not have this flag yet.
  1632. '-Wno-unused-result',
  1633. ],
  1634. }],
  1635. [ 'OS=="win"', {
  1636. 'defines': [
  1637. '_CRT_SECURE_NO_DEPRECATE',
  1638. '_CRT_NONSTDC_NO_WARNINGS',
  1639. '_CRT_NONSTDC_NO_DEPRECATE',
  1640. '_SCL_SECURE_NO_DEPRECATE',
  1641. ],
  1642. 'msvs_disabled_warnings': [4800],
  1643. 'msvs_settings': {
  1644. 'VCCLCompilerTool': {
  1645. 'WarningLevel': '3',
  1646. 'WarnAsError': '<(win_third_party_warn_as_error)',
  1647. 'Detect64BitPortabilityProblems': 'false',
  1648. },
  1649. },
  1650. 'conditions': [
  1651. ['buildtype=="Official"', {
  1652. 'msvs_settings': {
  1653. 'VCCLCompilerTool': { 'WarnAsError': 'false' },
  1654. }
  1655. }],
  1656. ],
  1657. }],
  1658. # TODO(darin): Unfortunately, some third_party code depends on base/
  1659. [ 'OS=="win" and component=="shared_library"', {
  1660. 'msvs_disabled_warnings': [
  1661. 4251, # class 'std::xx' needs to have dll-interface.
  1662. ],
  1663. }],
  1664. [ 'OS=="mac" or OS=="ios"', {
  1665. 'xcode_settings': {
  1666. 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
  1667. },
  1668. 'conditions': [
  1669. ['buildtype=="Official"', {
  1670. 'xcode_settings': {
  1671. 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
  1672. },
  1673. }],
  1674. ],
  1675. }],
  1676. [ 'OS=="ios"', {
  1677. 'xcode_settings': {
  1678. # TODO(ios): Fix remaining warnings in third-party code, then
  1679. # remove this; the Mac cleanup didn't get everything that's
  1680. # flagged in an iOS build.
  1681. 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
  1682. 'RUN_CLANG_STATIC_ANALYZER': 'NO',
  1683. },
  1684. }],
  1685. ],
  1686. }, {
  1687. 'includes': [
  1688. # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
  1689. 'filename_rules.gypi',
  1690. ],
  1691. # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
  1692. # C99 macros on Mac and Linux.
  1693. 'defines': [
  1694. '__STDC_FORMAT_MACROS',
  1695. ],
  1696. 'conditions': [
  1697. ['OS=="win"', {
  1698. # turn on warnings for signed/unsigned mismatch on chromium code.
  1699. 'msvs_settings': {
  1700. 'VCCLCompilerTool': {
  1701. 'AdditionalOptions': ['/we4389'],
  1702. },
  1703. },
  1704. }],
  1705. ['OS=="win" and component=="shared_library"', {
  1706. 'msvs_disabled_warnings': [
  1707. 4251, # class 'std::xx' needs to have dll-interface.
  1708. ],
  1709. }],
  1710. ],
  1711. }],
  1712. ], # target_conditions for 'target_defaults'
  1713. 'default_configuration': 'Debug',
  1714. 'configurations': {
  1715. # VCLinkerTool LinkIncremental values below:
  1716. # 0 == default
  1717. # 1 == /INCREMENTAL:NO
  1718. # 2 == /INCREMENTAL
  1719. # Debug links incremental, Release does not.
  1720. #
  1721. # Abstract base configurations to cover common attributes.
  1722. #
  1723. 'Common_Base': {
  1724. 'abstract': 1,
  1725. 'msvs_configuration_attributes': {
  1726. 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
  1727. 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
  1728. 'CharacterSet': '1',
  1729. },
  1730. },
  1731. 'x86_Base': {
  1732. 'abstract': 1,
  1733. 'msvs_settings': {
  1734. 'VCLinkerTool': {
  1735. 'TargetMachine': '1',
  1736. },
  1737. },
  1738. 'msvs_configuration_platform': 'Win32',
  1739. },
  1740. 'x64_Base': {
  1741. 'abstract': 1,
  1742. 'msvs_configuration_platform': 'x64',
  1743. 'msvs_settings': {
  1744. 'VCLinkerTool': {
  1745. 'TargetMachine': '17', # x86 - 64
  1746. 'AdditionalLibraryDirectories!':
  1747. ['<(windows_sdk_path)/Lib/win8/um/x86'],
  1748. 'AdditionalLibraryDirectories':
  1749. ['<(windows_sdk_path)/Lib/win8/um/x64'],
  1750. },
  1751. 'VCLibrarianTool': {
  1752. 'AdditionalLibraryDirectories!':
  1753. ['<(windows_sdk_path)/Lib/win8/um/x86'],
  1754. 'AdditionalLibraryDirectories':
  1755. ['<(windows_sdk_path)/Lib/win8/um/x64'],
  1756. },
  1757. },
  1758. 'defines': [
  1759. # Not sure if tcmalloc works on 64-bit Windows.
  1760. 'NO_TCMALLOC',
  1761. ],
  1762. },
  1763. 'Debug_Base': {
  1764. 'abstract': 1,
  1765. 'defines': [
  1766. 'DYNAMIC_ANNOTATIONS_ENABLED=1',
  1767. 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
  1768. ],
  1769. 'xcode_settings': {
  1770. 'COPY_PHASE_STRIP': 'NO',
  1771. 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
  1772. 'OTHER_CFLAGS': [
  1773. '<@(debug_extra_cflags)',
  1774. ],
  1775. },
  1776. 'msvs_settings': {
  1777. 'VCCLCompilerTool': {
  1778. 'Optimization': '<(win_debug_Optimization)',
  1779. 'PreprocessorDefinitions': ['_DEBUG'],
  1780. 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
  1781. 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
  1782. 'conditions': [
  1783. # According to MSVS, InlineFunctionExpansion=0 means
  1784. # "default inlining", not "/Ob0".
  1785. # Thus, we have to handle InlineFunctionExpansion==0 separately.
  1786. ['win_debug_InlineFunctionExpansion==0', {
  1787. 'AdditionalOptions': ['/Ob0'],
  1788. }],
  1789. ['win_debug_InlineFunctionExpansion!=""', {
  1790. 'InlineFunctionExpansion':
  1791. '<(win_debug_InlineFunctionExpansion)',
  1792. }],
  1793. ['win_debug_disable_iterator_debugging==1', {
  1794. 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
  1795. }],
  1796. # if win_debug_OmitFramePointers is blank, leave as default
  1797. ['win_debug_OmitFramePointers==1', {
  1798. 'OmitFramePointers': 'true',
  1799. }],
  1800. ['win_debug_OmitFramePointers==0', {
  1801. 'OmitFramePointers': 'false',
  1802. # The above is not sufficient (http://crbug.com/106711): it
  1803. # simply eliminates an explicit "/Oy", but both /O2 and /Ox
  1804. # perform FPO regardless, so we must explicitly disable.
  1805. # We still want the false setting above to avoid having
  1806. # "/Oy /Oy-" and warnings about overriding.
  1807. 'AdditionalOptions': ['/Oy-'],
  1808. }],
  1809. ],
  1810. 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
  1811. },
  1812. 'VCLinkerTool': {
  1813. 'LinkIncremental': '<(msvs_debug_link_incremental)',
  1814. # ASLR makes debugging with windbg difficult because Chrome.exe and
  1815. # Chrome.dll share the same base name. As result, windbg will
  1816. # name the Chrome.dll module like chrome_<base address>, where
  1817. # <base address> typically changes with each launch. This in turn
  1818. # means that breakpoints in Chrome.dll don't stick from one launch
  1819. # to the next. For this reason, we turn ASLR off in debug builds.
  1820. # Note that this is a three-way bool, where 0 means to pick up
  1821. # the default setting, 1 is off and 2 is on.
  1822. 'RandomizedBaseAddress': 1,
  1823. },
  1824. 'VCResourceCompilerTool': {
  1825. 'PreprocessorDefinitions': ['_DEBUG'],
  1826. },
  1827. },
  1828. 'conditions': [
  1829. ['OS=="linux" or OS=="android"', {
  1830. 'target_conditions': [
  1831. ['_toolset=="target"', {
  1832. 'cflags': [
  1833. '<@(debug_extra_cflags)',
  1834. ],
  1835. }],
  1836. ],
  1837. }],
  1838. # Disabled on iOS because it was causing a crash on startup.
  1839. # TODO(michelea): investigate, create a reduced test and possibly
  1840. # submit a radar.
  1841. ['release_valgrind_build==0 and OS!="ios"', {
  1842. 'xcode_settings': {
  1843. 'OTHER_CFLAGS': [
  1844. '-fstack-protector-all', # Implies -fstack-protector
  1845. ],
  1846. },
  1847. }],
  1848. ],
  1849. },
  1850. 'Release_Base': {
  1851. 'abstract': 1,
  1852. 'defines': [
  1853. 'NDEBUG',
  1854. ],
  1855. 'xcode_settings': {
  1856. 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
  1857. 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
  1858. 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
  1859. },
  1860. 'msvs_settings': {
  1861. 'VCCLCompilerTool': {
  1862. 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
  1863. 'conditions': [
  1864. # In official builds, each target will self-select
  1865. # an optimization level.
  1866. ['buildtype!="Official"', {
  1867. 'Optimization': '<(win_release_Optimization)',
  1868. },
  1869. ],
  1870. # According to MSVS, InlineFunctionExpansion=0 means
  1871. # "default inlining", not "/Ob0".
  1872. # Thus, we have to handle InlineFunctionExpansion==0 separately.
  1873. ['win_release_InlineFunctionExpansion==0', {
  1874. 'AdditionalOptions': ['/Ob0'],
  1875. }],
  1876. ['win_release_InlineFunctionExpansion!=""', {
  1877. 'InlineFunctionExpansion':
  1878. '<(win_release_InlineFunctionExpansion)',
  1879. }],
  1880. # if win_release_OmitFramePointers is blank, leave as default
  1881. ['win_release_OmitFramePointers==1', {
  1882. 'OmitFramePointers': 'true',
  1883. }],
  1884. ['win_release_OmitFramePointers==0', {
  1885. 'OmitFramePointers': 'false',
  1886. # The above is not sufficient (http://crbug.com/106711): it
  1887. # simply eliminates an explicit "/Oy", but both /O2 and /Ox
  1888. # perform FPO regardless, so we must explicitly disable.
  1889. # We still want the false setting above to avoid having
  1890. # "/Oy /Oy-" and warnings about overriding.
  1891. 'AdditionalOptions': ['/Oy-'],
  1892. }],
  1893. ],
  1894. 'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
  1895. },
  1896. 'VCLinkerTool': {
  1897. # LinkIncremental is a tri-state boolean, where 0 means default
  1898. # (i.e., inherit from parent solution), 1 means false, and
  1899. # 2 means true.
  1900. 'LinkIncremental': '1',
  1901. # This corresponds to the /PROFILE flag which ensures the PDB
  1902. # file contains FIXUP information (growing the PDB file by about
  1903. # 5%) but does not otherwise alter the output binary. This
  1904. # information is used by the Syzygy optimization tool when
  1905. # decomposing the release image.
  1906. 'Profile': 'true',
  1907. },
  1908. },
  1909. 'conditions': [
  1910. ['msvs_use_common_release', {
  1911. 'includes': ['release.gypi'],
  1912. }],
  1913. ['release_valgrind_build==0', {
  1914. 'defines': [
  1915. 'NVALGRIND',
  1916. 'DYNAMIC_ANNOTATIONS_ENABLED=0',
  1917. ],
  1918. }, {
  1919. 'defines': [
  1920. 'DYNAMIC_ANNOTATIONS_ENABLED=1',
  1921. 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
  1922. ],
  1923. }],
  1924. ['win_use_allocator_shim==0', {
  1925. 'defines': ['NO_TCMALLOC'],
  1926. }],
  1927. ['OS=="linux"', {
  1928. 'target_conditions': [
  1929. ['_toolset=="target"', {
  1930. 'cflags': [
  1931. '<@(release_extra_cflags)',
  1932. ],
  1933. }],
  1934. ],
  1935. }],
  1936. ],
  1937. },
  1938. #
  1939. # Concrete configurations
  1940. #
  1941. 'Debug': {
  1942. 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
  1943. },
  1944. 'Release': {
  1945. 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
  1946. },
  1947. 'conditions': [
  1948. [ 'OS=="win"', {
  1949. # TODO(bradnelson): add a gyp mechanism to make this more graceful.
  1950. 'Debug_x64': {
  1951. 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
  1952. },
  1953. 'Release_x64': {
  1954. 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
  1955. },
  1956. }],
  1957. ],
  1958. },
  1959. },
  1960. 'conditions': [
  1961. ['os_posix==1 and OS!="mac" and OS!="ios"', {
  1962. 'target_defaults': {
  1963. # Enable -Werror by default, but put it in a variable so it can
  1964. # be disabled in ~/.gyp/include.gypi on the valgrind builders.
  1965. 'variables': {
  1966. 'werror%': '-Werror',
  1967. 'libraries_for_target%': '',
  1968. },
  1969. 'defines': [
  1970. '_FILE_OFFSET_BITS=64',
  1971. ],
  1972. 'cflags': [
  1973. '<(werror)', # See note above about the werror variable.
  1974. '-pthread',
  1975. '-fno-exceptions',
  1976. '-fno-strict-aliasing', # See http://crbug.com/32204
  1977. '-Wall',
  1978. # TODO(evan): turn this back on once all the builds work.
  1979. # '-Wextra',
  1980. # Don't warn about unused function params. We use those everywhere.
  1981. '-Wno-unused-parameter',
  1982. # Don't warn about the "struct foo f = {0};" initialization pattern.
  1983. '-Wno-missing-field-initializers',
  1984. # Don't export any symbols (for example, to plugins we dlopen()).
  1985. # Note: this is *required* to make some plugins work.
  1986. '-fvisibility=hidden',
  1987. '-pipe',
  1988. ],
  1989. 'cflags_cc': [
  1990. '-fno-rtti',
  1991. '-fno-threadsafe-statics',
  1992. # Make inline functions have hidden visiblity by default.
  1993. # Surprisingly, not covered by -fvisibility=hidden.
  1994. '-fvisibility-inlines-hidden',
  1995. # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
  1996. # so we specify it explicitly.
  1997. # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it.
  1998. # http://code.google.com/p/chromium/issues/detail?id=90453
  1999. '-Wsign-compare',
  2000. ],
  2001. 'ldflags': [
  2002. '-pthread', '-Wl,-z,noexecstack',
  2003. ],
  2004. 'libraries' : [
  2005. '<(libraries_for_target)',
  2006. ],
  2007. 'configurations': {
  2008. 'Debug_Base': {
  2009. 'variables': {
  2010. 'debug_optimize%': '0',
  2011. },
  2012. 'defines': [
  2013. '_DEBUG',
  2014. ],
  2015. 'cflags': [
  2016. '-O>(debug_optimize)',
  2017. '-g',
  2018. ],
  2019. 'conditions' : [
  2020. ['OS=="android" and android_full_debug==0', {
  2021. # Some configurations are copied from Release_Base to reduce
  2022. # the binary size.
  2023. 'variables': {
  2024. 'debug_optimize%': 's',
  2025. },
  2026. 'cflags': [
  2027. '-fomit-frame-pointer',
  2028. '-fdata-sections',
  2029. '-ffunction-sections',
  2030. ],
  2031. 'ldflags': [
  2032. '-Wl,-O1',
  2033. '-Wl,--as-needed',
  2034. '-Wl,--gc-sections',
  2035. ],
  2036. }],
  2037. ],
  2038. },
  2039. 'Release_Base': {
  2040. 'variables': {
  2041. 'release_optimize%': '2',
  2042. # Binaries become big and gold is unable to perform GC
  2043. # and remove unused sections for some of test targets
  2044. # on 32 bit platform.
  2045. # (This is currently observed only in chromeos valgrind bots)
  2046. # The following flag is to disable --gc-sections linker
  2047. # option for these bots.
  2048. 'no_gc_sections%': 0,
  2049. # TODO(bradnelson): reexamine how this is done if we change the
  2050. # expansion of configurations
  2051. 'release_valgrind_build%': 0,
  2052. },
  2053. 'cflags': [
  2054. '-O<(release_optimize)',
  2055. # Don't emit the GCC version ident directives, they just end up
  2056. # in the .comment section taking up binary size.
  2057. '-fno-ident',
  2058. # Put data and code in their own sections, so that unused symbols
  2059. # can be removed at link time with --gc-sections.
  2060. '-fdata-sections',
  2061. '-ffunction-sections',
  2062. ],
  2063. 'ldflags': [
  2064. # Specifically tell the linker to perform optimizations.
  2065. # See http://lwn.net/Articles/192624/ .
  2066. '-Wl,-O1',
  2067. '-Wl,--as-needed',
  2068. ],
  2069. 'conditions' : [
  2070. ['no_gc_sections==0', {
  2071. 'ldflags': [
  2072. '-Wl,--gc-sections',
  2073. ],
  2074. }],
  2075. ['OS=="android"', {
  2076. 'variables': {
  2077. 'release_optimize%': 's',
  2078. },
  2079. 'cflags': [
  2080. '-fomit-frame-pointer',
  2081. ],
  2082. }],
  2083. ['clang==1', {
  2084. 'cflags!': [
  2085. '-fno-ident',
  2086. ],
  2087. }],
  2088. ['profiling==1', {
  2089. 'cflags': [
  2090. '-fno-omit-frame-pointer',
  2091. '-g',
  2092. ],
  2093. }],
  2094. ],
  2095. },
  2096. },
  2097. 'variants': {
  2098. 'coverage': {
  2099. 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
  2100. 'ldflags': ['-fprofile-arcs'],
  2101. },
  2102. 'profile': {
  2103. 'cflags': ['-pg', '-g'],
  2104. 'ldflags': ['-pg'],
  2105. },
  2106. 'symbols': {
  2107. 'cflags': ['-g'],
  2108. },
  2109. },
  2110. 'conditions': [
  2111. ['target_arch=="ia32"', {
  2112. 'target_conditions': [
  2113. ['_toolset=="target"', {
  2114. 'asflags': [
  2115. # Needed so that libs with .s files (e.g. libicudata.a)
  2116. # are compatible with the general 32-bit-ness.
  2117. '-32',
  2118. ],
  2119. # All floating-point computations on x87 happens in 80-bit
  2120. # precision. Because the C and C++ language standards allow
  2121. # the compiler to keep the floating-point values in higher
  2122. # precision than what's specified in the source and doing so
  2123. # is more efficient than constantly rounding up to 64-bit or
  2124. # 32-bit precision as specified in the source, the compiler,
  2125. # especially in the optimized mode, tries very hard to keep
  2126. # values in x87 floating-point stack (in 80-bit precision)
  2127. # as long as possible. This has important side effects, that
  2128. # the real value used in computation may change depending on
  2129. # how the compiler did the optimization - that is, the value
  2130. # kept in 80-bit is different than the value rounded down to
  2131. # 64-bit or 32-bit. There are possible compiler options to
  2132. # make this behavior consistent (e.g. -ffloat-store would keep
  2133. # all floating-values in the memory, thus force them to be
  2134. # rounded to its original precision) but they have significant
  2135. # runtime performance penalty.
  2136. #
  2137. # -mfpmath=sse -msse2 makes the compiler use SSE instructions
  2138. # which keep floating-point values in SSE registers in its
  2139. # native precision (32-bit for single precision, and 64-bit
  2140. # for double precision values). This means the floating-point
  2141. # value used during computation does not change depending on
  2142. # how the compiler optimized the code, since the value is
  2143. # always kept in its specified precision.
  2144. 'conditions': [
  2145. ['branding=="Chromium" and disable_sse2==0', {
  2146. 'cflags': [
  2147. '-march=pentium4',
  2148. '-msse2',
  2149. '-mfpmath=sse',
  2150. ],
  2151. }],
  2152. # ChromeOS targets Pinetrail, which is sse3, but most of the
  2153. # benefit comes from sse2 so this setting allows ChromeOS
  2154. # to build on other CPUs. In the future -march=atom would
  2155. # help but requires a newer compiler.
  2156. ['chromeos==1 and disable_sse2==0', {
  2157. 'cflags': [
  2158. '-msse2',
  2159. ],
  2160. }],
  2161. # Install packages have started cropping up with
  2162. # different headers between the 32-bit and 64-bit
  2163. # versions, so we have to shadow those differences off
  2164. # and make sure a 32-bit-on-64-bit build picks up the
  2165. # right files.
  2166. # For android build, use NDK headers instead of host headers
  2167. ['host_arch!="ia32" and OS!="android"', {
  2168. 'include_dirs+': [
  2169. '/usr/include32',
  2170. ],
  2171. }],
  2172. ],
  2173. 'target_conditions': [
  2174. ['_toolset=="target" and OS!="android"', {
  2175. # -mmmx allows mmintrin.h to be used for mmx intrinsics.
  2176. # video playback is mmx and sse2 optimized.
  2177. 'cflags': [
  2178. '-m32',
  2179. '-mmmx',
  2180. ],
  2181. 'ldflags': [
  2182. '-m32',
  2183. ],
  2184. 'cflags_mozilla': [
  2185. '-m32',
  2186. '-mmmx',
  2187. ],
  2188. }],
  2189. ],
  2190. }],
  2191. ],
  2192. }],
  2193. ['target_arch=="arm"', {
  2194. 'target_conditions': [
  2195. ['_toolset=="target"', {
  2196. 'cflags_cc': [
  2197. # The codesourcery arm-2009q3 toolchain warns at that the ABI
  2198. # has changed whenever it encounters a varargs function. This
  2199. # silences those warnings, as they are not helpful and
  2200. # clutter legitimate warnings.
  2201. '-Wno-abi',
  2202. ],
  2203. 'conditions': [
  2204. ['arm_thumb==1', {
  2205. 'cflags': [
  2206. '-mthumb',
  2207. ]
  2208. }],
  2209. ['armv7==1', {
  2210. 'cflags': [
  2211. '-march=armv7-a',
  2212. '-mtune=cortex-a8',
  2213. '-mfloat-abi=<(arm_float_abi)',
  2214. ],
  2215. 'conditions': [
  2216. ['arm_neon==1', {
  2217. 'cflags': [ '-mfpu=neon', ],
  2218. }, {
  2219. 'cflags': [ '-mfpu=<(arm_fpu)', ],
  2220. }],
  2221. ],
  2222. }],
  2223. ['OS=="android"', {
  2224. # Most of the following flags are derived from what Android
  2225. # uses by default when building for arm, reference for which
  2226. # can be found in the following file in the Android NDK:
  2227. # toolchains/arm-linux-androideabi-4.4.3/setup.mk
  2228. 'cflags': [
  2229. # The tree-sra optimization (scalar replacement for
  2230. # aggregates enabling subsequent optimizations) leads to
  2231. # invalid code generation when using the Android NDK's
  2232. # compiler (r5-r7). This can be verified using
  2233. # TestWebKitAPI's WTF.Checked_int8_t test.
  2234. '-fno-tree-sra',
  2235. '-fuse-ld=gold',
  2236. '-Wno-psabi',
  2237. ],
  2238. # Android now supports .relro sections properly.
  2239. # NOTE: While these flags enable the generation of .relro
  2240. # sections, the generated libraries can still be loaded on
  2241. # older Android platform versions.
  2242. 'ldflags': [
  2243. '-Wl,-z,relro',
  2244. '-Wl,-z,now',
  2245. '-fuse-ld=gold',
  2246. ],
  2247. 'conditions': [
  2248. ['arm_thumb == 1', {
  2249. # Android toolchain doesn't support -mimplicit-it=thumb
  2250. 'cflags!': [ '-Wa,-mimplicit-it=thumb', ],
  2251. 'cflags': [ '-mthumb-interwork', ],
  2252. }],
  2253. ['armv7==0', {
  2254. # Flags suitable for Android emulator
  2255. 'cflags': [
  2256. '-march=armv5te',
  2257. '-mtune=xscale',
  2258. '-msoft-float',
  2259. ],
  2260. 'defines': [
  2261. '__ARM_ARCH_5__',
  2262. '__ARM_ARCH_5T__',
  2263. '__ARM_ARCH_5E__',
  2264. '__ARM_ARCH_5TE__',
  2265. ],
  2266. }],
  2267. ['clang==1', {
  2268. 'cflags!': [
  2269. # Clang does not support the following options.
  2270. '-mthumb-interwork',
  2271. '-finline-limit=64',
  2272. '-fno-tree-sra',
  2273. '-fuse-ld=gold',
  2274. '-Wno-psabi',
  2275. ],
  2276. }],
  2277. ],
  2278. }],
  2279. ],
  2280. }],
  2281. ],
  2282. }],
  2283. ['linux_fpic==1', {
  2284. 'cflags': [
  2285. '-fPIC',
  2286. ],
  2287. 'ldflags': [
  2288. '-fPIC',
  2289. ],
  2290. }],
  2291. ['sysroot!=""', {
  2292. 'target_conditions': [
  2293. ['_toolset=="target"', {
  2294. 'cflags': [
  2295. '--sysroot=<(sysroot)',
  2296. ],
  2297. 'ldflags': [
  2298. '--sysroot=<(sysroot)',
  2299. ],
  2300. }]]
  2301. }],
  2302. ['clang==1', {
  2303. 'cflags': [
  2304. '-Wheader-hygiene',
  2305. # Clang spots more unused functions.
  2306. '-Wno-unused-function',
  2307. # Don't die on dtoa code that uses a char as an array index.
  2308. '-Wno-char-subscripts',
  2309. # Especially needed for gtest macros using enum values from Mac
  2310. # system headers.
  2311. # TODO(pkasting): In C++11 this is legal, so this should be
  2312. # removed when we change to that. (This is also why we don't
  2313. # bother fixing all these cases today.)
  2314. '-Wno-unnamed-type-template-args',
  2315. # This (rightyfully) complains about 'override', which we use
  2316. # heavily.
  2317. '-Wno-c++11-extensions',
  2318. # Warns on switches on enums that cover all enum values but
  2319. # also contain a default: branch. Chrome is full of that.
  2320. '-Wno-covered-switch-default',
  2321. # TODO(thakis): Remove this.
  2322. '-Wno-implicit-conversion-floating-point-to-bool',
  2323. ],
  2324. 'cflags!': [
  2325. # Clang doesn't seem to know know this flag.
  2326. '-mfpmath=sse',
  2327. ],
  2328. }],
  2329. ['clang==1 and clang_use_chrome_plugins==1', {
  2330. 'cflags': [
  2331. '<@(clang_chrome_plugins_flags)',
  2332. ],
  2333. }],
  2334. ['clang==1 and clang_load!=""', {
  2335. 'cflags': [
  2336. '-Xclang', '-load', '-Xclang', '<(clang_load)',
  2337. ],
  2338. }],
  2339. ['clang==1 and clang_add_plugin!=""', {
  2340. 'cflags': [
  2341. '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
  2342. ],
  2343. }],
  2344. ['clang==1 and "<(GENERATOR)"=="ninja"', {
  2345. 'cflags': [
  2346. # See http://crbug.com/110262
  2347. '-fcolor-diagnostics',
  2348. ],
  2349. }],
  2350. ['asan==1', {
  2351. 'target_conditions': [
  2352. ['_toolset=="target"', {
  2353. 'cflags': [
  2354. '-faddress-sanitizer',
  2355. '-fno-omit-frame-pointer',
  2356. ],
  2357. 'ldflags': [
  2358. '-faddress-sanitizer',
  2359. ],
  2360. 'defines': [
  2361. 'ADDRESS_SANITIZER',
  2362. ],
  2363. }],
  2364. ],
  2365. }],
  2366. ['tsan==1', {
  2367. 'target_conditions': [
  2368. ['_toolset=="target"', {
  2369. 'cflags': [
  2370. '-fthread-sanitizer',
  2371. '-fno-omit-frame-pointer',
  2372. '-fPIE',
  2373. ],
  2374. 'ldflags': [
  2375. '-fthread-sanitizer',
  2376. ],
  2377. 'defines': [
  2378. 'THREAD_SANITIZER',
  2379. 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
  2380. ],
  2381. 'target_conditions': [
  2382. ['_type=="executable"', {
  2383. 'ldflags': [
  2384. '-pie',
  2385. ],
  2386. }],
  2387. ],
  2388. }],
  2389. ],
  2390. }],
  2391. ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
  2392. 'target_conditions' : [
  2393. ['_toolset=="target"', {
  2394. 'cflags': [
  2395. '-finstrument-functions',
  2396. # Allow mmx intrinsics to inline, so that the
  2397. # compiler can expand the intrinsics.
  2398. '-finstrument-functions-exclude-file-list=mmintrin.h',
  2399. ],
  2400. }],
  2401. ],
  2402. }],
  2403. ['linux_breakpad==1', {
  2404. 'cflags': [ '-g' ],
  2405. 'defines': ['USE_LINUX_BREAKPAD'],
  2406. }],
  2407. ['linux_use_heapchecker==1', {
  2408. 'variables': {'linux_use_tcmalloc%': 1},
  2409. 'defines': ['USE_HEAPCHECKER'],
  2410. }],
  2411. ['linux_use_tcmalloc==0', {
  2412. 'defines': ['NO_TCMALLOC'],
  2413. }],
  2414. ['linux_keep_shadow_stacks==1', {
  2415. 'defines': ['KEEP_SHADOW_STACKS'],
  2416. 'cflags': [
  2417. '-finstrument-functions',
  2418. # Allow mmx intrinsics to inline, so that the compiler can expand
  2419. # the intrinsics.
  2420. '-finstrument-functions-exclude-file-list=mmintrin.h',
  2421. ],
  2422. }],
  2423. ['linux_use_gold_flags==1', {
  2424. 'ldflags': [
  2425. # Experimentation found that using four linking threads
  2426. # saved ~20% of link time.
  2427. # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
  2428. '-Wl,--threads',
  2429. '-Wl,--thread-count=4',
  2430. ],
  2431. 'conditions': [
  2432. ['release_valgrind_build==0', {
  2433. 'target_conditions': [
  2434. ['_toolset=="target"', {
  2435. 'ldflags': [
  2436. # There seems to be a conflict of --icf and -pie
  2437. # in gold which can generate crashy binaries. As
  2438. # a security measure, -pie takes precendence for
  2439. # now.
  2440. #'-Wl,--icf=safe',
  2441. '-Wl,--icf=none',
  2442. ],
  2443. }],
  2444. ],
  2445. }],
  2446. ],
  2447. }],
  2448. ['linux_use_gold_binary==1', {
  2449. 'variables': {
  2450. 'conditions': [
  2451. ['inside_chromium_build==1', {
  2452. # We pass the path to gold to the compiler. gyp leaves
  2453. # unspecified what the cwd is when running the compiler,
  2454. # so the normal gyp path-munging fails us. This hack
  2455. # gets the right path.
  2456. 'gold_path': '<(PRODUCT_DIR)/../../third_party/gold',
  2457. }, {
  2458. 'gold_path': '<(PRODUCT_DIR)/../../Source/WebKit/chromium/third_party/gold',
  2459. }]
  2460. ]
  2461. },
  2462. 'ldflags': [
  2463. # Put our gold binary in the search path for the linker.
  2464. '-B<(gold_path)',
  2465. ],
  2466. }],
  2467. ],
  2468. },
  2469. }],
  2470. # FreeBSD-specific options; note that most FreeBSD options are set above,
  2471. # with Linux.
  2472. ['OS=="freebsd"', {
  2473. 'target_defaults': {
  2474. 'ldflags': [
  2475. '-Wl,--no-keep-memory',
  2476. ],
  2477. },
  2478. }],
  2479. # Android-specific options; note that most are set above with Linux.
  2480. ['OS=="android"', {
  2481. 'variables': {
  2482. # This is the id for the archived chrome symbols. Each build that
  2483. # archives symbols is assigned an id which is then added to GYP_DEFINES.
  2484. # This is written to the device log on crashes just prior to dropping a
  2485. # tombstone. Tools can determine the location of the archived symbols
  2486. # from the id.
  2487. 'chrome_symbols_id%': '',
  2488. 'conditions': [
  2489. # Use shared stlport library when system one used.
  2490. # Figure this out early since it needs symbols from libgcc.a, so it
  2491. # has to be before that in the set of libraries.
  2492. ['use_system_stlport==1', {
  2493. 'android_stlport_library': 'stlport',
  2494. }, {
  2495. 'android_stlport_library': 'stlport_static',
  2496. }],
  2497. ],
  2498. # Placing this variable here prevents from forking libvpx, used
  2499. # by remoting. Remoting is off, so it needn't built,
  2500. # so forking it's deps seems like overkill.
  2501. # But this variable need defined to properly run gyp.
  2502. # A proper solution is to have an OS==android conditional
  2503. # in third_party/libvpx/libvpx.gyp to define it.
  2504. 'libvpx_path': 'lib/linux/arm',
  2505. },
  2506. 'target_defaults': {
  2507. 'variables': {
  2508. 'release_extra_cflags%': '',
  2509. },
  2510. 'target_conditions': [
  2511. # Settings for building device targets using Android's toolchain.
  2512. # These are based on the setup.mk file from the Android NDK.
  2513. #
  2514. # The NDK Android executable link step looks as follows:
  2515. # $LDFLAGS
  2516. # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
  2517. # $(PRIVATE_OBJECTS) <-- The .o that we built
  2518. # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
  2519. # $(TARGET_LIBGCC) <-- libgcc.a
  2520. # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
  2521. # $(PRIVATE_LDLIBS) <-- System .so
  2522. # $(TARGET_CRTEND_O) <-- crtend.o
  2523. #
  2524. # For now the above are approximated for executables by adding
  2525. # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
  2526. # of 'libraries'.
  2527. #
  2528. # The NDK Android shared library link step looks as follows:
  2529. # $LDFLAGS
  2530. # $(PRIVATE_OBJECTS) <-- The .o that we built
  2531. # -l,--whole-archive
  2532. # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
  2533. # -l,--no-whole-archive
  2534. # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
  2535. # $(TARGET_LIBGCC) <-- libgcc.a
  2536. # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
  2537. # $(PRIVATE_LDLIBS) <-- System .so
  2538. #
  2539. # For now, assume that whole static libraries are not needed.
  2540. #
  2541. # For both executables and shared libraries, add the proper
  2542. # libgcc.a to the start of libraries which puts it in the
  2543. # proper spot after .o and .a files get linked in.
  2544. #
  2545. # TODO: The proper thing to do longer-tem would be proper gyp
  2546. # support for a custom link command line.
  2547. ['_toolset=="target"', {
  2548. 'conditions': [
  2549. ['build_with_mozilla==0', {
  2550. 'cflags!': [
  2551. '-pthread', # Not supported by Android toolchain.
  2552. ],
  2553. 'cflags': [
  2554. '-ffunction-sections',
  2555. '-funwind-tables',
  2556. '-g',
  2557. '-fstack-protector',
  2558. '-fno-short-enums',
  2559. '-finline-limit=64',
  2560. '-Wa,--noexecstack',
  2561. '<@(release_extra_cflags)',
  2562. ],
  2563. 'ldflags!': [
  2564. '-pthread', # Not supported by Android toolchain.
  2565. ],
  2566. 'ldflags': [
  2567. '-nostdlib',
  2568. '-Wl,--no-undefined',
  2569. # Don't export symbols from statically linked libraries.
  2570. '-Wl,--exclude-libs=ALL',
  2571. ],
  2572. 'libraries': [
  2573. '-l<(android_stlport_library)',
  2574. # Manually link the libgcc.a that the cross compiler uses.
  2575. '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
  2576. '-lc',
  2577. '-ldl',
  2578. '-lstdc++',
  2579. '-lm',
  2580. ],
  2581. 'conditions': [
  2582. ['android_upstream_bringup==1', {
  2583. 'defines': ['ANDROID_UPSTREAM_BRINGUP=1',],
  2584. }],
  2585. ['clang==1', {
  2586. 'cflags': [
  2587. # Work around incompatibilities between bionic and clang
  2588. # headers.
  2589. '-D__compiler_offsetof=__builtin_offsetof',
  2590. '-Dnan=__builtin_nan',
  2591. ],
  2592. 'conditions': [
  2593. ['target_arch=="arm"', {
  2594. 'cflags': [
  2595. '-target arm-linux-androideabi',
  2596. '-mllvm -arm-enable-ehabi',
  2597. ],
  2598. 'ldflags': [
  2599. '-target arm-linux-androideabi',
  2600. ],
  2601. }],
  2602. ['target_arch=="ia32"', {
  2603. 'cflags': [
  2604. '-target x86-linux-androideabi',
  2605. ],
  2606. 'ldflags': [
  2607. '-target x86-linux-androideabi',
  2608. ],
  2609. }],
  2610. ],
  2611. }],
  2612. ['android_build_type==0', {
  2613. 'defines': [
  2614. # The NDK has these things, but doesn't define the constants
  2615. # to say that it does. Define them here instead.
  2616. 'HAVE_SYS_UIO_H',
  2617. ],
  2618. 'cflags': [
  2619. '--sysroot=<(android_ndk_sysroot)',
  2620. ],
  2621. 'ldflags': [
  2622. '--sysroot=<(android_ndk_sysroot)',
  2623. ],
  2624. }],
  2625. ['android_build_type==1', {
  2626. 'include_dirs': [
  2627. # OpenAL headers from the Android tree.
  2628. '<(android_src)/frameworks/wilhelm/include',
  2629. ],
  2630. 'cflags': [
  2631. # Chromium builds its own (non-third-party) code with
  2632. # -Werror to make all warnings into errors. However, Android
  2633. # enables warnings that Chromium doesn't, so some of these
  2634. # extra warnings trip and break things.
  2635. # For now, we leave these warnings enabled but prevent them
  2636. # from being treated as errors.
  2637. #
  2638. # Things that are part of -Wextra:
  2639. '-Wno-error=extra', # Enabled by -Wextra, but no specific flag
  2640. '-Wno-error=ignored-qualifiers',
  2641. '-Wno-error=type-limits',
  2642. # Other things unrelated to -Wextra:
  2643. '-Wno-error=non-virtual-dtor',
  2644. '-Wno-error=sign-promo',
  2645. ],
  2646. 'cflags_cc': [
  2647. # Disabling c++0x-compat should be handled in WebKit, but
  2648. # this currently doesn't work because gcc_version is not set
  2649. # correctly when building with the Android build system.
  2650. # TODO(torne): Fix this in WebKit.
  2651. '-Wno-error=c++0x-compat',
  2652. ],
  2653. }],
  2654. ['android_build_type==1 and chromium_code==0', {
  2655. 'cflags': [
  2656. # There is a class of warning which:
  2657. # 1) Android always enables and also treats as errors
  2658. # 2) Chromium ignores in third party code
  2659. # For now, I am leaving these warnings enabled but preventing
  2660. # them from being treated as errors here.
  2661. '-Wno-error=address',
  2662. '-Wno-error=format-security',
  2663. '-Wno-error=non-virtual-dtor',
  2664. '-Wno-error=return-type',
  2665. '-Wno-error=sequence-point',
  2666. ],
  2667. }],
  2668. ['target_arch == "arm"', {
  2669. 'ldflags': [
  2670. # Enable identical code folding to reduce size.
  2671. '-Wl,--icf=safe',
  2672. ],
  2673. }],
  2674. # NOTE: The stlport header include paths below are specified in
  2675. # cflags rather than include_dirs because they need to come
  2676. # after include_dirs. Think of them like system headers, but
  2677. # don't use '-isystem' because the arm-linux-androideabi-4.4.3
  2678. # toolchain (circa Gingerbread) will exhibit strange errors.
  2679. # The include ordering here is important; change with caution.
  2680. ['use_system_stlport==1', {
  2681. 'cflags': [
  2682. # For libstdc++/include, which is used by stlport.
  2683. '-I<(android_src)/bionic',
  2684. '-I<(android_src)/external/stlport/stlport',
  2685. ],
  2686. }, { # else: use_system_stlport!=1
  2687. 'cflags': [
  2688. '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
  2689. ],
  2690. 'conditions': [
  2691. ['target_arch=="arm" and armv7==1', {
  2692. 'ldflags': [
  2693. '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi-v7a',
  2694. ],
  2695. }],
  2696. ['target_arch=="arm" and armv7==0', {
  2697. 'ldflags': [
  2698. '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi',
  2699. ],
  2700. }],
  2701. ['target_arch=="ia32"', {
  2702. 'ldflags': [
  2703. '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/x86',
  2704. ],
  2705. }],
  2706. ],
  2707. }],
  2708. ['target_arch=="ia32"', {
  2709. # The x86 toolchain currently has problems with stack-protector.
  2710. 'cflags!': [
  2711. '-fstack-protector',
  2712. ],
  2713. 'cflags': [
  2714. '-fno-stack-protector',
  2715. ],
  2716. }],
  2717. ],
  2718. 'target_conditions': [
  2719. ['_type=="executable"', {
  2720. 'ldflags': [
  2721. '-Bdynamic',
  2722. '-Wl,-dynamic-linker,/system/bin/linker',
  2723. '-Wl,--gc-sections',
  2724. '-Wl,-z,nocopyreloc',
  2725. # crtbegin_dynamic.o should be the last item in ldflags.
  2726. '<(android_ndk_lib)/crtbegin_dynamic.o',
  2727. ],
  2728. 'libraries': [
  2729. # crtend_android.o needs to be the last item in libraries.
  2730. # Do not add any libraries after this!
  2731. '<(android_ndk_lib)/crtend_android.o',
  2732. ],
  2733. }],
  2734. ['_type=="shared_library" or _type=="loadable_module"', {
  2735. 'ldflags': [
  2736. '-Wl,-shared,-Bsymbolic',
  2737. # crtbegin_so.o should be the last item in ldflags.
  2738. '<(android_ndk_lib)/crtbegin_so.o',
  2739. ],
  2740. 'libraries': [
  2741. # crtend_so.o needs to be the last item in libraries.
  2742. # Do not add any libraries after this!
  2743. '<(android_ndk_lib)/crtend_so.o',
  2744. ],
  2745. }],
  2746. ],
  2747. }], # build_with_mozilla== 0
  2748. ],
  2749. 'defines': [
  2750. 'ANDROID',
  2751. '__GNU_SOURCE=1', # Necessary for clone()
  2752. 'USE_STLPORT=1',
  2753. '_STLP_USE_PTR_SPECIALIZATIONS=1',
  2754. 'CHROME_SYMBOLS_ID="<(chrome_symbols_id)"',
  2755. ],
  2756. }],
  2757. # Settings for building host targets using the system toolchain.
  2758. ['_toolset=="host"', {
  2759. 'cflags!': [
  2760. # Due to issues in Clang build system, using ASan on 32-bit
  2761. # binaries on x86_64 host is problematic.
  2762. # TODO(eugenis): re-enable.
  2763. '-faddress-sanitizer',
  2764. ],
  2765. 'ldflags!': [
  2766. '-faddress-sanitizer',
  2767. '-Wl,-z,noexecstack',
  2768. '-Wl,--gc-sections',
  2769. '-Wl,-O1',
  2770. '-Wl,--as-needed',
  2771. ],
  2772. 'sources/': [
  2773. ['exclude', '_android(_unittest)?\\.cc$'],
  2774. ['exclude', '(^|/)android/']
  2775. ],
  2776. }],
  2777. ],
  2778. },
  2779. }],
  2780. ['OS=="solaris"', {
  2781. 'cflags!': ['-fvisibility=hidden'],
  2782. 'cflags_cc!': ['-fvisibility-inlines-hidden'],
  2783. }],
  2784. ['OS=="mac" or OS=="ios"', {
  2785. 'target_defaults': {
  2786. 'mac_bundle': 0,
  2787. 'xcode_settings': {
  2788. 'ALWAYS_SEARCH_USER_PATHS': 'NO',
  2789. 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
  2790. 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
  2791. 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
  2792. 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
  2793. 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
  2794. # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
  2795. 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
  2796. 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
  2797. 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
  2798. 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
  2799. 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
  2800. 'GCC_VERSION': '4.2',
  2801. 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
  2802. 'USE_HEADERMAP': 'NO',
  2803. 'WARNING_CFLAGS': [
  2804. '-Wall',
  2805. '-Wendif-labels',
  2806. '-Wextra',
  2807. # Don't warn about unused function parameters.
  2808. '-Wno-unused-parameter',
  2809. # Don't warn about the "struct foo f = {0};" initialization
  2810. # pattern.
  2811. '-Wno-missing-field-initializers',
  2812. ],
  2813. 'conditions': [
  2814. ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
  2815. {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
  2816. ],
  2817. ],
  2818. },
  2819. 'target_conditions': [
  2820. ['_type!="static_library"', {
  2821. 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
  2822. }],
  2823. ['_mac_bundle', {
  2824. 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
  2825. }],
  2826. ], # target_conditions
  2827. }, # target_defaults
  2828. }], # OS=="mac" or OS=="ios"
  2829. ['OS=="mac"', {
  2830. 'target_defaults': {
  2831. 'variables': {
  2832. # These should end with %, but there seems to be a bug with % in
  2833. # variables that are intended to be set to different values in
  2834. # different targets, like these.
  2835. 'mac_pie': 1, # Most executables can be position-independent.
  2836. 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
  2837. # Strip debugging symbols from the target.
  2838. 'mac_strip': '<(mac_strip_release)',
  2839. },
  2840. 'xcode_settings': {
  2841. 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
  2842. # (Equivalent to -fPIC)
  2843. # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
  2844. 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
  2845. # Keep pch files below xcodebuild/.
  2846. 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
  2847. 'OTHER_CFLAGS': [
  2848. '-fno-strict-aliasing', # See http://crbug.com/32204
  2849. ],
  2850. 'conditions': [
  2851. ['clang==1', {
  2852. 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
  2853. 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
  2854. # Don't use -Wc++0x-extensions, which Xcode 4 enables by default
  2855. # when buliding with clang. This warning is triggered when the
  2856. # override keyword is used via the OVERRIDE macro from
  2857. # base/compiler_specific.h.
  2858. 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
  2859. 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
  2860. 'WARNING_CFLAGS': [
  2861. '-Wheader-hygiene',
  2862. # Don't die on dtoa code that uses a char as an array index.
  2863. # This is required solely for base/third_party/dmg_fp/dtoa.cc.
  2864. '-Wno-char-subscripts',
  2865. # Clang spots more unused functions.
  2866. '-Wno-unused-function',
  2867. # See comments on this flag higher up in this file.
  2868. '-Wno-unnamed-type-template-args',
  2869. # This (rightyfully) complains about 'override', which we use
  2870. # heavily.
  2871. '-Wno-c++11-extensions',
  2872. # Warns on switches on enums that cover all enum values but
  2873. # also contain a default: branch. Chrome is full of that.
  2874. '-Wno-covered-switch-default',
  2875. # TODO(thakis): Remove this.
  2876. '-Wno-implicit-conversion-floating-point-to-bool',
  2877. ],
  2878. }],
  2879. ['clang==1 and clang_use_chrome_plugins==1', {
  2880. 'OTHER_CFLAGS': [
  2881. '<@(clang_chrome_plugins_flags)',
  2882. ],
  2883. }],
  2884. ['clang==1 and clang_load!=""', {
  2885. 'OTHER_CFLAGS': [
  2886. '-Xclang', '-load', '-Xclang', '<(clang_load)',
  2887. ],
  2888. }],
  2889. ['clang==1 and clang_add_plugin!=""', {
  2890. 'OTHER_CFLAGS': [
  2891. '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
  2892. ],
  2893. }],
  2894. ['clang==1 and "<(GENERATOR)"=="ninja"', {
  2895. 'OTHER_CFLAGS': [
  2896. # See http://crbug.com/110262
  2897. '-fcolor-diagnostics',
  2898. ],
  2899. }],
  2900. ],
  2901. },
  2902. 'conditions': [
  2903. ['clang==1', {
  2904. 'variables': {
  2905. 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
  2906. },
  2907. }],
  2908. ['asan==1', {
  2909. 'xcode_settings': {
  2910. 'OTHER_CFLAGS': [
  2911. '-faddress-sanitizer',
  2912. ],
  2913. },
  2914. 'defines': [
  2915. 'ADDRESS_SANITIZER',
  2916. ],
  2917. }],
  2918. ],
  2919. 'target_conditions': [
  2920. ['_type!="static_library"', {
  2921. 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
  2922. 'conditions': [
  2923. ['asan==1', {
  2924. 'xcode_settings': {
  2925. 'OTHER_LDFLAGS': [
  2926. '-faddress-sanitizer',
  2927. ],
  2928. },
  2929. }],
  2930. ],
  2931. }],
  2932. ['_mac_bundle', {
  2933. 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
  2934. }],
  2935. ['_type=="executable"', {
  2936. 'postbuilds': [
  2937. {
  2938. # Arranges for data (heap) pages to be protected against
  2939. # code execution when running on Mac OS X 10.7 ("Lion"), and
  2940. # ensures that the position-independent executable (PIE) bit
  2941. # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
  2942. 'variables': {
  2943. # Define change_mach_o_flags in a variable ending in _path
  2944. # so that GYP understands it's a path and performs proper
  2945. # relativization during dict merging.
  2946. 'change_mach_o_flags':
  2947. 'mac/change_mach_o_flags_from_xcode.sh',
  2948. 'change_mach_o_flags_options%': [
  2949. ],
  2950. 'target_conditions': [
  2951. ['mac_pie==0 or release_valgrind_build==1', {
  2952. # Don't enable PIE if it's unwanted. It's unwanted if
  2953. # the target specifies mac_pie=0 or if building for
  2954. # Valgrind, because Valgrind doesn't understand slide.
  2955. # See the similar mac_pie/release_valgrind_build check
  2956. # below.
  2957. 'change_mach_o_flags_options': [
  2958. '--no-pie',
  2959. ],
  2960. }],
  2961. ],
  2962. },
  2963. 'postbuild_name': 'Change Mach-O Flags',
  2964. 'action': [
  2965. '$(srcdir)$(os_sep)build$(os_sep)<(change_mach_o_flags)',
  2966. '>@(change_mach_o_flags_options)',
  2967. ],
  2968. },
  2969. ],
  2970. 'conditions': [
  2971. ['asan==1', {
  2972. 'variables': {
  2973. 'asan_saves_file': 'asan.saves',
  2974. },
  2975. 'xcode_settings': {
  2976. 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
  2977. },
  2978. }],
  2979. ],
  2980. 'target_conditions': [
  2981. ['mac_pie==1 and release_valgrind_build==0', {
  2982. # Turn on position-independence (ASLR) for executables. When
  2983. # PIE is on for the Chrome executables, the framework will
  2984. # also be subject to ASLR.
  2985. # Don't do this when building for Valgrind, because Valgrind
  2986. # doesn't understand slide. TODO: Make Valgrind on Mac OS X
  2987. # understand slide, and get rid of the Valgrind check.
  2988. 'xcode_settings': {
  2989. 'OTHER_LDFLAGS': [
  2990. '-Wl,-pie', # Position-independent executable (MH_PIE)
  2991. ],
  2992. },
  2993. }],
  2994. ],
  2995. }],
  2996. ['(_type=="executable" or _type=="shared_library" or \
  2997. _type=="loadable_module") and mac_strip!=0', {
  2998. 'target_conditions': [
  2999. ['mac_real_dsym == 1', {
  3000. # To get a real .dSYM bundle produced by dsymutil, set the
  3001. # debug information format to dwarf-with-dsym. Since
  3002. # strip_from_xcode will not be used, set Xcode to do the
  3003. # stripping as well.
  3004. 'configurations': {
  3005. 'Release_Base': {
  3006. 'xcode_settings': {
  3007. 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
  3008. 'DEPLOYMENT_POSTPROCESSING': 'YES',
  3009. 'STRIP_INSTALLED_PRODUCT': 'YES',
  3010. 'target_conditions': [
  3011. ['_type=="shared_library" or _type=="loadable_module"', {
  3012. # The Xcode default is to strip debugging symbols
  3013. # only (-S). Local symbols should be stripped as
  3014. # well, which will be handled by -x. Xcode will
  3015. # continue to insert -S when stripping even when
  3016. # additional flags are added with STRIPFLAGS.
  3017. 'STRIPFLAGS': '-x',
  3018. }], # _type=="shared_library" or _type=="loadable_module"'
  3019. ], # target_conditions
  3020. }, # xcode_settings
  3021. }, # configuration "Release"
  3022. }, # configurations
  3023. }, { # mac_real_dsym != 1
  3024. # To get a fast fake .dSYM bundle, use a post-build step to
  3025. # produce the .dSYM and strip the executable. strip_from_xcode
  3026. # only operates in the Release configuration.
  3027. 'postbuilds': [
  3028. {
  3029. 'variables': {
  3030. # Define strip_from_xcode in a variable ending in _path
  3031. # so that gyp understands it's a path and performs proper
  3032. # relativization during dict merging.
  3033. 'strip_from_xcode': 'mac/strip_from_xcode',
  3034. },
  3035. 'postbuild_name': 'Strip If Needed',
  3036. 'action': ['$(srcdir)$(os_sep)build$(os_sep)<(strip_from_xcode)'],
  3037. },
  3038. ], # postbuilds
  3039. }], # mac_real_dsym
  3040. ], # target_conditions
  3041. }], # (_type=="executable" or _type=="shared_library" or
  3042. # _type=="loadable_module") and mac_strip!=0
  3043. ], # target_conditions
  3044. }, # target_defaults
  3045. }], # OS=="mac"
  3046. ['OS=="ios"', {
  3047. 'target_defaults': {
  3048. 'xcode_settings' : {
  3049. 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
  3050. # This next block is mostly common with the 'mac' section above,
  3051. # but keying off (or setting) 'clang' isn't valid for iOS as it
  3052. # also seems to mean using the custom build of clang.
  3053. # Don't use -Wc++0x-extensions, which Xcode 4 enables by default
  3054. # when buliding with clang. This warning is triggered when the
  3055. # override keyword is used via the OVERRIDE macro from
  3056. # base/compiler_specific.h.
  3057. 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
  3058. 'WARNING_CFLAGS': [
  3059. '-Wheader-hygiene',
  3060. # Don't die on dtoa code that uses a char as an array index.
  3061. # This is required solely for base/third_party/dmg_fp/dtoa.cc.
  3062. '-Wno-char-subscripts',
  3063. # Clang spots more unused functions.
  3064. '-Wno-unused-function',
  3065. # See comments on this flag higher up in this file.
  3066. '-Wno-unnamed-type-template-args',
  3067. # This (rightyfully) complains about 'override', which we use
  3068. # heavily.
  3069. '-Wno-c++11-extensions',
  3070. ],
  3071. },
  3072. 'target_conditions': [
  3073. ['_type=="executable"', {
  3074. 'configurations': {
  3075. 'Release_Base': {
  3076. 'xcode_settings': {
  3077. 'DEPLOYMENT_POSTPROCESSING': 'YES',
  3078. 'STRIP_INSTALLED_PRODUCT': 'YES',
  3079. },
  3080. },
  3081. },
  3082. 'xcode_settings': {
  3083. 'conditions': [
  3084. ['chromium_ios_signing', {
  3085. # iOS SDK wants everything for device signed.
  3086. 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
  3087. }, {
  3088. 'CODE_SIGNING_REQUIRED': 'NO',
  3089. 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
  3090. }],
  3091. ],
  3092. },
  3093. }],
  3094. ], # target_conditions
  3095. }, # target_defaults
  3096. }], # OS=="ios"
  3097. ['OS=="win"', {
  3098. 'target_defaults': {
  3099. 'defines': [
  3100. 'WIN32',
  3101. '_WINDOWS',
  3102. 'NOMINMAX',
  3103. 'PSAPI_VERSION=1',
  3104. '_CRT_RAND_S',
  3105. 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
  3106. 'WIN32_LEAN_AND_MEAN',
  3107. '_ATL_NO_OPENGL',
  3108. ],
  3109. 'conditions': [
  3110. ['build_with_mozilla==0', {
  3111. 'defines': [
  3112. '_WIN32_WINNT=0x0602',
  3113. 'WINVER=0x0602',
  3114. ],
  3115. }],
  3116. ['buildtype=="Official"', {
  3117. # In official builds, targets can self-select an optimization
  3118. # level by defining a variable named 'optimize', and setting it
  3119. # to one of
  3120. # - "size", optimizes for minimal code size - the default.
  3121. # - "speed", optimizes for speed over code size.
  3122. # - "max", whole program optimization and link-time code
  3123. # generation. This is very expensive and should be used
  3124. # sparingly.
  3125. 'variables': {
  3126. 'optimize%': 'size',
  3127. },
  3128. 'target_conditions': [
  3129. ['optimize=="size"', {
  3130. 'msvs_settings': {
  3131. 'VCCLCompilerTool': {
  3132. # 1, optimizeMinSpace, Minimize Size (/O1)
  3133. 'Optimization': '1',
  3134. # 2, favorSize - Favor small code (/Os)
  3135. 'FavorSizeOrSpeed': '2',
  3136. },
  3137. },
  3138. },
  3139. ],
  3140. ['optimize=="speed"', {
  3141. 'msvs_settings': {
  3142. 'VCCLCompilerTool': {
  3143. # 2, optimizeMaxSpeed, Maximize Speed (/O2)
  3144. 'Optimization': '2',
  3145. # 1, favorSpeed - Favor fast code (/Ot)
  3146. 'FavorSizeOrSpeed': '1',
  3147. },
  3148. },
  3149. },
  3150. ],
  3151. ['optimize=="max"', {
  3152. 'msvs_settings': {
  3153. 'VCCLCompilerTool': {
  3154. # 2, optimizeMaxSpeed, Maximize Speed (/O2)
  3155. 'Optimization': '2',
  3156. # 1, favorSpeed - Favor fast code (/Ot)
  3157. 'FavorSizeOrSpeed': '1',
  3158. # This implies link time code generation.
  3159. 'WholeProgramOptimization': 'true',
  3160. },
  3161. },
  3162. },
  3163. ],
  3164. ],
  3165. },
  3166. ],
  3167. ['component=="static_library"', {
  3168. 'defines': [
  3169. '_HAS_EXCEPTIONS=0',
  3170. ],
  3171. }],
  3172. ['MSVS_VERSION=="2008"', {
  3173. 'defines': [
  3174. '_HAS_TR1=0',
  3175. ],
  3176. }],
  3177. ['secure_atl', {
  3178. 'defines': [
  3179. '_SECURE_ATL',
  3180. ],
  3181. }],
  3182. ],
  3183. 'msvs_system_include_dirs': [
  3184. '<(windows_sdk_path)/Include/shared',
  3185. '<(windows_sdk_path)/Include/um',
  3186. '<(windows_sdk_path)/Include/winrt',
  3187. '<(directx_sdk_path)/Include',
  3188. '$(VSInstallDir)/VC/atlmfc/include',
  3189. ],
  3190. 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
  3191. 'msvs_disabled_warnings': [4351, 4396, 4503, 4819,
  3192. # TODO(maruel): These warnings are level 4. They will be slowly
  3193. # removed as code is fixed.
  3194. 4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
  3195. 4310, 4355, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701,
  3196. 4702, 4706,
  3197. ],
  3198. 'msvs_settings': {
  3199. 'VCCLCompilerTool': {
  3200. 'AdditionalOptions': ['/MP'],
  3201. 'MinimalRebuild': 'false',
  3202. 'BufferSecurityCheck': 'true',
  3203. 'EnableFunctionLevelLinking': 'true',
  3204. 'RuntimeTypeInfo': 'false',
  3205. 'WarningLevel': '4',
  3206. 'WarnAsError': 'true',
  3207. 'DebugInformationFormat': '3',
  3208. 'conditions': [
  3209. ['component=="shared_library"', {
  3210. 'ExceptionHandling': '1', # /EHsc
  3211. }, {
  3212. 'ExceptionHandling': '0',
  3213. }],
  3214. ],
  3215. },
  3216. 'VCLibrarianTool': {
  3217. 'AdditionalOptions': ['/ignore:4221'],
  3218. 'AdditionalLibraryDirectories': [
  3219. '<(directx_sdk_path)/Lib/x86',
  3220. '<(windows_sdk_path)/Lib/win8/um/x86',
  3221. ],
  3222. },
  3223. 'VCLinkerTool': {
  3224. 'AdditionalDependencies': [
  3225. 'wininet.lib',
  3226. 'dnsapi.lib',
  3227. 'version.lib',
  3228. 'msimg32.lib',
  3229. 'ws2_32.lib',
  3230. 'usp10.lib',
  3231. 'psapi.lib',
  3232. 'dbghelp.lib',
  3233. 'winmm.lib',
  3234. 'shlwapi.lib',
  3235. ],
  3236. 'conditions': [
  3237. ['msvs_express', {
  3238. # Explicitly required when using the ATL with express
  3239. 'AdditionalDependencies': [
  3240. 'atlthunk.lib',
  3241. ],
  3242. # ATL 8.0 included in WDK 7.1 makes the linker to generate
  3243. # almost eight hundred LNK4254 and LNK4078 warnings:
  3244. # - warning LNK4254: section 'ATL' (50000040) merged into
  3245. # '.rdata' (40000040) with different attributes
  3246. # - warning LNK4078: multiple 'ATL' sections found with
  3247. # different attributes
  3248. 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
  3249. }],
  3250. ['MSVS_VERSION=="2005e"', {
  3251. # Non-express versions link automatically to these
  3252. 'AdditionalDependencies': [
  3253. 'advapi32.lib',
  3254. 'comdlg32.lib',
  3255. 'ole32.lib',
  3256. 'shell32.lib',
  3257. 'user32.lib',
  3258. 'winspool.lib',
  3259. ],
  3260. }],
  3261. ],
  3262. 'AdditionalLibraryDirectories': [
  3263. '<(directx_sdk_path)/Lib/x86',
  3264. '<(windows_sdk_path)/Lib/win8/um/x86',
  3265. ],
  3266. 'GenerateDebugInformation': 'true',
  3267. 'MapFileName': '$(OutDir)\\$(TargetName).map',
  3268. 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
  3269. 'FixedBaseAddress': '1',
  3270. # SubSystem values:
  3271. # 0 == not set
  3272. # 1 == /SUBSYSTEM:CONSOLE
  3273. # 2 == /SUBSYSTEM:WINDOWS
  3274. # Most of the executables we'll ever create are tests
  3275. # and utilities with console output.
  3276. 'SubSystem': '1',
  3277. },
  3278. 'VCMIDLTool': {
  3279. 'GenerateStublessProxies': 'true',
  3280. 'TypeLibraryName': '$(InputName).tlb',
  3281. 'OutputDirectory': '$(IntDir)',
  3282. 'HeaderFileName': '$(InputName).h',
  3283. 'DLLDataFileName': '$(InputName).dlldata.c',
  3284. 'InterfaceIdentifierFileName': '$(InputName)_i.c',
  3285. 'ProxyFileName': '$(InputName)_p.c',
  3286. },
  3287. 'VCResourceCompilerTool': {
  3288. 'Culture' : '1033',
  3289. 'AdditionalIncludeDirectories': [
  3290. '<(DEPTH)',
  3291. '<(SHARED_INTERMEDIATE_DIR)',
  3292. ],
  3293. },
  3294. },
  3295. },
  3296. }],
  3297. ['disable_nacl==1', {
  3298. 'target_defaults': {
  3299. 'defines': [
  3300. 'DISABLE_NACL',
  3301. ],
  3302. },
  3303. }],
  3304. ['OS=="win" and msvs_use_common_linker_extras', {
  3305. 'target_defaults': {
  3306. 'msvs_settings': {
  3307. 'VCLinkerTool': {
  3308. 'DelayLoadDLLs': [
  3309. 'dbghelp.dll',
  3310. 'dwmapi.dll',
  3311. 'shell32.dll',
  3312. 'uxtheme.dll',
  3313. ],
  3314. },
  3315. },
  3316. 'configurations': {
  3317. 'x86_Base': {
  3318. 'msvs_settings': {
  3319. 'VCLinkerTool': {
  3320. 'AdditionalOptions': [
  3321. '/safeseh',
  3322. '/dynamicbase',
  3323. '/ignore:4199',
  3324. '/ignore:4221',
  3325. '/nxcompat',
  3326. ],
  3327. },
  3328. },
  3329. },
  3330. 'x64_Base': {
  3331. 'msvs_settings': {
  3332. 'VCLinkerTool': {
  3333. 'AdditionalOptions': [
  3334. # safeseh is not compatible with x64
  3335. '/dynamicbase',
  3336. '/ignore:4199',
  3337. '/ignore:4221',
  3338. '/nxcompat',
  3339. ],
  3340. },
  3341. },
  3342. },
  3343. },
  3344. },
  3345. }],
  3346. ['enable_new_npdevice_api==1', {
  3347. 'target_defaults': {
  3348. 'defines': [
  3349. 'ENABLE_NEW_NPDEVICE_API',
  3350. ],
  3351. },
  3352. }],
  3353. ['clang==1', {
  3354. 'conditions': [
  3355. ['OS=="android"', {
  3356. # Android could use the goma with clang.
  3357. 'make_global_settings': [
  3358. ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang)'],
  3359. ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'],
  3360. ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'],
  3361. ['CC.host', '$(CC)'],
  3362. ['CXX.host', '$(CXX)'],
  3363. ['LINK.host', '$(LINK)'],
  3364. ],
  3365. }, {
  3366. 'make_global_settings': [
  3367. ['CC', '<(make_clang_dir)/bin/clang'],
  3368. ['CXX', '<(make_clang_dir)/bin/clang++'],
  3369. ['LINK', '$(CXX)'],
  3370. ['CC.host', '$(CC)'],
  3371. ['CXX.host', '$(CXX)'],
  3372. ['LINK.host', '$(LINK)'],
  3373. ],
  3374. }],
  3375. ],
  3376. }],
  3377. ['OS=="android" and clang==0', {
  3378. # Hardcode the compiler names in the Makefile so that
  3379. # it won't depend on the environment at make time.
  3380. 'make_global_settings': [
  3381. ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'],
  3382. ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-g++)'],
  3383. ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'],
  3384. ['CC.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which gcc))'],
  3385. ['CXX.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'],
  3386. ['LINK.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'],
  3387. ],
  3388. }],
  3389. ],
  3390. 'xcode_settings': {
  3391. # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
  3392. # This block adds *project-wide* configuration settings to each project
  3393. # file. It's almost always wrong to put things here. Specify your
  3394. # custom xcode_settings in target_defaults to add them to targets instead.
  3395. 'conditions': [
  3396. # In an Xcode Project Info window, the "Base SDK for All Configurations"
  3397. # setting sets the SDK on a project-wide basis. In order to get the
  3398. # configured SDK to show properly in the Xcode UI, SDKROOT must be set
  3399. # here at the project level.
  3400. ['OS=="mac"', {
  3401. 'conditions': [
  3402. ['mac_sdk_path==""', {
  3403. 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
  3404. }, {
  3405. 'SDKROOT': '<(mac_sdk_path)', # -isysroot
  3406. }],
  3407. ],
  3408. }],
  3409. ['OS=="ios"', {
  3410. 'conditions': [
  3411. ['ios_sdk_path==""', {
  3412. 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
  3413. }, {
  3414. 'SDKROOT': '<(ios_sdk_path)', # -isysroot
  3415. }],
  3416. ],
  3417. }],
  3418. ['OS=="ios"', {
  3419. # Just build armv7 since iOS 4.3+ only supports armv7.
  3420. 'ARCHS': '$(ARCHS_UNIVERSAL_IPHONE_OS)',
  3421. 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
  3422. # Target both iPhone and iPad.
  3423. 'TARGETED_DEVICE_FAMILY': '1,2',
  3424. }],
  3425. ],
  3426. # The Xcode generator will look for an xcode_settings section at the root
  3427. # of each dict and use it to apply settings on a file-wide basis. Most
  3428. # settings should not be here, they should be in target-specific
  3429. # xcode_settings sections, or better yet, should use non-Xcode-specific
  3430. # settings in target dicts. SYMROOT is a special case, because many other
  3431. # Xcode variables depend on it, including variables such as
  3432. # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
  3433. # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
  3434. # files to appear (when present) in the UI as actual files and not red
  3435. # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
  3436. # and therefore SYMROOT, needs to be set at the project level.
  3437. 'SYMROOT': '<(DEPTH)/xcodebuild',
  3438. },
  3439. }