text_server_adv_builders.py 642 B

123456789101112131415161718192021
  1. """Functions used to generate source files during build time"""
  2. import methods
  3. def make_icu_data(target, source, env):
  4. buffer = methods.get_buffer(str(source[0]))
  5. with methods.generated_wrapper(str(target[0])) as file:
  6. file.write(f"""\
  7. /* (C) 2016 and later: Unicode, Inc. and others. */
  8. /* License & terms of use: https://www.unicode.org/copyright.html */
  9. #include <unicode/utypes.h>
  10. #include <unicode/udata.h>
  11. #include <unicode/uversion.h>
  12. extern "C" U_EXPORT const size_t U_ICUDATA_SIZE = {len(buffer)};
  13. extern "C" U_EXPORT const unsigned char U_ICUDATA_ENTRY_POINT[] = {{
  14. {methods.format_buffer(buffer, 1)}
  15. }};
  16. """)