constants.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: Apache-2.0
  3. import collections
  4. import multiprocessing
  5. import os
  6. import platform
  7. from typing import Dict, Union
  8. GENERATORS: Dict[str, Union[str, Dict, list]] = collections.OrderedDict([
  9. # - command: build command line
  10. # - version: version command line
  11. # - dry_run: command to run in dry run mode
  12. # - verbose_flag: verbose flag
  13. # - force_progression: one liner status of the progress
  14. # - envvar: environment variables
  15. ('Ninja', {
  16. 'command': ['ninja'],
  17. 'version': ['ninja', '--version'],
  18. 'dry_run': ['ninja', '-n'],
  19. 'verbose_flag': '-v',
  20. # as opposed to printing the status updates each in a in new line
  21. 'force_progression': True,
  22. 'envvar': {}
  23. }),
  24. ])
  25. if os.name != 'nt':
  26. MAKE_CMD = 'gmake' if platform.system() == 'FreeBSD' else 'make'
  27. GENERATORS['Unix Makefiles'] = {'command': [MAKE_CMD, '-j', str(multiprocessing.cpu_count() + 2)],
  28. 'version': [MAKE_CMD, '--version'],
  29. 'dry_run': [MAKE_CMD, '-n'],
  30. 'verbose_flag': 'VERBOSE=1',
  31. 'force_progression': False,
  32. # CLICOLOR_FORCE if set forcing make to print ANSI escape sequence
  33. 'envvar': {'CLICOLOR_FORCE': '1'}}
  34. URL_TO_DOC = 'https://docs.espressif.com/projects/esp-idf'
  35. SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2']
  36. PREVIEW_TARGETS = ['linux', 'esp32h2', 'esp32c6']