constants.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import collections
  2. import multiprocessing
  3. import os
  4. import platform
  5. # Make flavors, across the various kinds of Windows environments & POSIX...
  6. if 'MSYSTEM' in os.environ: # MSYS
  7. MAKE_CMD = 'make'
  8. MAKE_GENERATOR = 'MSYS Makefiles'
  9. elif os.name == 'nt': # other Windows
  10. MAKE_CMD = 'mingw32-make'
  11. MAKE_GENERATOR = 'MinGW Makefiles'
  12. elif platform.system() == 'FreeBSD':
  13. MAKE_CMD = 'gmake'
  14. MAKE_GENERATOR = 'Unix Makefiles'
  15. else:
  16. MAKE_CMD = 'make'
  17. MAKE_GENERATOR = 'Unix Makefiles'
  18. GENERATORS = collections.OrderedDict([
  19. # - command: build command line
  20. # - version: version command line
  21. # - dry_run: command to run in dry run mode
  22. # - verbose_flag: verbose flag
  23. ('Ninja', {
  24. 'command': ['ninja'],
  25. 'version': ['ninja', '--version'],
  26. 'dry_run': ['ninja', '-n'],
  27. 'verbose_flag': '-v'
  28. }),
  29. (MAKE_GENERATOR, {
  30. 'command': [MAKE_CMD, '-j', str(multiprocessing.cpu_count() + 2)],
  31. 'version': [MAKE_CMD, '--version'],
  32. 'dry_run': [MAKE_CMD, '-n'],
  33. 'verbose_flag': 'VERBOSE=1',
  34. })
  35. ])
  36. SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3']
  37. PREVIEW_TARGETS = ['esp32s3', 'linux']