defs.mozbuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. DEFINES.update(
  6. # Don't use icu namespace automatically in client code.
  7. U_USING_ICU_NAMESPACE = 0,
  8. # Don't include obsolete header files.
  9. U_NO_DEFAULT_INCLUDE_UTF_HEADERS = 1,
  10. # Remove chunks of the library that we don't need (yet).
  11. UCONFIG_NO_LEGACY_CONVERSION = True,
  12. UCONFIG_NO_TRANSLITERATION = True,
  13. UCONFIG_NO_REGULAR_EXPRESSIONS = True,
  14. UCONFIG_NO_BREAK_ITERATION = True,
  15. # We don't need to pass data to and from legacy char* APIs.
  16. U_CHARSET_IS_UTF8 = True,
  17. )
  18. if not CONFIG['HAVE_LANGINFO_CODESET']:
  19. DEFINES['U_HAVE_NL_LANGINFO_CODESET'] = 0
  20. if CONFIG['MOZ_DEBUG']:
  21. DEFINES['U_DEBUG'] = 1
  22. # ICU requires RTTI
  23. if CONFIG['GNU_CXX']:
  24. CXXFLAGS += ['-frtti']
  25. elif CONFIG['OS_TARGET'] == 'WINNT':
  26. CXXFLAGS += ['-GR']
  27. DISABLE_STL_WRAPPING = True
  28. ALLOW_COMPILER_WARNINGS = True
  29. # We allow compiler warnings, but we can at least cut down on spammy
  30. # warnings that get triggered for every file.
  31. if CONFIG['CLANG_CL']:
  32. CFLAGS += [
  33. '-Wno-macro-redefined',
  34. '-Wno-microsoft-include',
  35. ]
  36. CXXFLAGS += [
  37. '-Wno-macro-redefined',
  38. '-Wno-microsoft-include',
  39. ]
  40. if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
  41. CFLAGS += [
  42. '-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
  43. '-wd4996', # The compiler encountered a deprecated declaration.
  44. ]
  45. CXXFLAGS += [
  46. '-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
  47. '-wd4333', # '>>' : right shift by too large amount, data loss
  48. '-wd4996', # The compiler encountered a deprecated declaration.
  49. ]