2020-03-02 15:07:49 +00:00
|
|
|
import collections
|
2019-10-03 16:26:44 +00:00
|
|
|
import multiprocessing
|
|
|
|
import os
|
|
|
|
import platform
|
|
|
|
|
|
|
|
# Make flavors, across the various kinds of Windows environments & POSIX...
|
2021-01-26 02:49:01 +00:00
|
|
|
if 'MSYSTEM' in os.environ: # MSYS
|
|
|
|
MAKE_CMD = 'make'
|
|
|
|
MAKE_GENERATOR = 'MSYS Makefiles'
|
|
|
|
elif os.name == 'nt': # other Windows
|
|
|
|
MAKE_CMD = 'mingw32-make'
|
|
|
|
MAKE_GENERATOR = 'MinGW Makefiles'
|
|
|
|
elif platform.system() == 'FreeBSD':
|
|
|
|
MAKE_CMD = 'gmake'
|
|
|
|
MAKE_GENERATOR = 'Unix Makefiles'
|
2019-10-03 16:26:44 +00:00
|
|
|
else:
|
2021-01-26 02:49:01 +00:00
|
|
|
MAKE_CMD = 'make'
|
|
|
|
MAKE_GENERATOR = 'Unix Makefiles'
|
2019-10-03 16:26:44 +00:00
|
|
|
|
2020-03-02 15:07:49 +00:00
|
|
|
GENERATORS = collections.OrderedDict([
|
2019-11-08 15:46:02 +00:00
|
|
|
# - command: build command line
|
|
|
|
# - version: version command line
|
|
|
|
# - dry_run: command to run in dry run mode
|
|
|
|
# - verbose_flag: verbose flag
|
2021-01-26 02:49:01 +00:00
|
|
|
('Ninja', {
|
|
|
|
'command': ['ninja'],
|
|
|
|
'version': ['ninja', '--version'],
|
|
|
|
'dry_run': ['ninja', '-n'],
|
|
|
|
'verbose_flag': '-v'
|
2020-03-02 15:07:49 +00:00
|
|
|
}),
|
|
|
|
(MAKE_GENERATOR, {
|
2021-01-26 02:49:01 +00:00
|
|
|
'command': [MAKE_CMD, '-j', str(multiprocessing.cpu_count() + 2)],
|
|
|
|
'version': [MAKE_CMD, '--version'],
|
|
|
|
'dry_run': [MAKE_CMD, '-n'],
|
|
|
|
'verbose_flag': 'VERBOSE=1',
|
2020-03-02 15:07:49 +00:00
|
|
|
})
|
|
|
|
])
|
2019-10-03 16:26:44 +00:00
|
|
|
|
2021-06-03 15:14:38 +00:00
|
|
|
URL_TO_DOC = 'https://docs.espressif.com/projects/esp-idf'
|
2020-01-15 13:50:19 +00:00
|
|
|
|
2021-06-03 15:14:38 +00:00
|
|
|
SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3']
|
2021-06-28 09:51:48 +00:00
|
|
|
PREVIEW_TARGETS = ['linux', 'esp32h2']
|