moz.build 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
  2. # This Source Code Form is subject to the terms of the Mozilla Public
  3. # License, v. 2.0. If a copy of the MPL was not distributed with this
  4. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. with Files('**'):
  6. BUG_COMPONENT = ('Core', 'Build Config')
  7. # This cannot be named "build" because of bug 922191.
  8. SPHINX_TREES['buildsystem'] = 'docs'
  9. if CONFIG['OS_ARCH'] == 'WINNT':
  10. DIRS += ['win32']
  11. else:
  12. DIRS += ['unix']
  13. if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
  14. DIRS += ['annotationProcessors']
  15. for var in ('GRE_MILESTONE',
  16. 'MOZ_APP_VERSION',
  17. 'MOZ_APP_BASENAME',
  18. 'MOZ_APP_VENDOR',
  19. 'MOZ_APP_ID',
  20. 'MAR_CHANNEL_ID',
  21. 'ACCEPTED_MAR_CHANNEL_IDS',
  22. 'MOZ_APP_REMOTINGNAME',
  23. 'MOZ_BUILD_APP'):
  24. DEFINES[var] = CONFIG[var]
  25. if CONFIG['MOZ_APP_DISPLAYNAME'] != CONFIG['MOZ_APP_BASENAME']:
  26. DEFINES['MOZ_APP_DISPLAYNAME'] = CONFIG['MOZ_APP_DISPLAYNAME']
  27. if CONFIG['MOZ_PHOENIX']:
  28. DEFINES['MOZ_PHOENIX'] = CONFIG['MOZ_PHOENIX']
  29. DEFINES['MOZ_BUILD_APP_IS_BROWSER'] = True
  30. if CONFIG['MC_OFFICIAL']:
  31. DEFINES['MC_OFFICIAL'] = CONFIG['MC_OFFICIAL']
  32. if CONFIG['MOZ_APP_PROFILE']:
  33. DEFINES['MOZ_APP_PROFILE'] = CONFIG['MOZ_APP_PROFILE']
  34. for var in ('MOZ_PROFILE_MIGRATOR',
  35. 'MOZ_APP_STATIC_INI'):
  36. if CONFIG[var]:
  37. DEFINES[var] = True
  38. if CONFIG['MOZ_PHOENIX']:
  39. PYTHON_UNIT_TESTS += [
  40. 'compare-mozconfig/compare-mozconfigs-wrapper.py',
  41. ]
  42. if CONFIG['ENABLE_TESTS']:
  43. FINAL_TARGET_FILES += ['/tools/rb/fix_stack_using_bpsyms.py']
  44. if CONFIG['OS_ARCH'] == 'Darwin':
  45. FINAL_TARGET_FILES += ['/tools/rb/fix_macosx_stack.py']
  46. if CONFIG['OS_ARCH'] == 'Linux':
  47. FINAL_TARGET_FILES += ['/tools/rb/fix_linux_stack.py']
  48. # Put a useful .gdbinit in the bin directory, to be picked up automatically
  49. # by GDB when we debug executables there.
  50. FINAL_TARGET_FILES += ['/.gdbinit']
  51. FINAL_TARGET_PP_FILES += ['.gdbinit_python.in']
  52. OBJDIR_FILES += ['!/dist/bin/.gdbinit_python']
  53. # Install the clang-cl runtime library for ASAN next to the binaries we produce.
  54. if CONFIG['MOZ_ASAN'] and CONFIG['CLANG_CL']:
  55. FINAL_TARGET_FILES += ['%' + CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']]
  56. if CONFIG['MOZ_APP_BASENAME']:
  57. FINAL_TARGET_PP_FILES += ['application.ini']
  58. if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']:
  59. FINAL_TARGET_PP_FILES += ['update-settings.ini']
  60. if CONFIG['MOZ_APP_STATIC_INI']:
  61. GENERATED_FILES += ['application.ini.h']
  62. appini = GENERATED_FILES['application.ini.h']
  63. appini.script = 'appini_header.py'
  64. appini.inputs = ['!/dist/bin/application.ini']
  65. DEFINES['TOPSRCDIR'] = TOPSRCDIR
  66. DEFINES['TOPOBJDIR'] = TOPOBJDIR
  67. # NOTE: Keep .gdbinit in the topsrcdir for people who run gdb from the topsrcdir.
  68. OBJDIR_FILES += ['/.gdbinit']
  69. # Put a .lldbinit in the bin directory and the objdir, to be picked up
  70. # automatically by LLDB when we debug executables using either of those two
  71. # directories as the current working directory. The .lldbinit file will
  72. # load $(topsrcdir)/.lldbinit, which is where the actual debugging commands are.
  73. DEFINES['topsrcdir'] = TOPSRCDIR
  74. FINAL_TARGET_PP_FILES += ['.lldbinit.in']
  75. OBJDIR_FILES += ['!/dist/bin/.lldbinit']
  76. # Put the .ycm_extra_conf.py file at the root of the objdir. It is used by
  77. # the vim plugin YouCompleteMe.
  78. OBJDIR_FILES += ['/.ycm_extra_conf.py']
  79. if CONFIG['MOZ_VALGRIND']:
  80. OBJDIR_FILES._valgrind += [
  81. 'valgrind/cross-architecture.sup',
  82. 'valgrind/i386-redhat-linux-gnu.sup',
  83. 'valgrind/x86_64-redhat-linux-gnu.sup',
  84. ]
  85. if CONFIG['MOZ_ARTIFACT_BUILDS']:
  86. # Ensure a pre-built interfaces.xpt installed to the objdir by the artifact
  87. # code is included by the top-level chrome.manifest.
  88. EXTRA_COMPONENTS += [
  89. 'prebuilt-interfaces.manifest',
  90. ]