53
53
env = DefaultEnvironment ()
54
54
env .SConscript ("_embed_files.py" , exports = "env" )
55
55
56
+ # Allow changes in folders of managed components
57
+ os .environ ["IDF_COMPONENT_OVERWRITE_MANAGED_COMPONENTS" ] = "1"
58
+
56
59
platform = env .PioPlatform ()
57
60
board = env .BoardConfig ()
58
61
mcu = board .get ("build.mcu" , "esp32" )
@@ -252,9 +255,6 @@ def populate_idf_env_vars(idf_env):
252
255
os .path .join (platform .get_package_dir ("toolchain-esp32ulp" ), "bin" ),
253
256
)
254
257
255
- # if IS_WINDOWS:
256
- # additional_packages.append(platform.get_package_dir("tool-mconf"))
257
-
258
258
idf_env ["PATH" ] = os .pathsep .join (additional_packages + [idf_env ["PATH" ]])
259
259
260
260
# Some users reported that the `IDF_TOOLS_PATH` var can seep into the
@@ -321,8 +321,9 @@ def _normalize_define(define_string):
321
321
define_string = define_string .strip ()
322
322
if "=" in define_string :
323
323
define , value = define_string .split ("=" , maxsplit = 1 )
324
- if '"' in value and not value .startswith ("\\ " ):
325
- # Escape only raw values
324
+ if any (char in value for char in (' ' , '<' , '>' )):
325
+ value = f'"{ value } "'
326
+ elif '"' in value and not value .startswith ("\\ " ):
326
327
value = value .replace ('"' , '\\ "' )
327
328
return (define , value )
328
329
return define_string
@@ -333,8 +334,11 @@ def _normalize_define(define_string):
333
334
]
334
335
335
336
for f in compile_group .get ("compileCommandFragments" , []):
336
- if f .get ("fragment" , "" ).startswith ("-D" ):
337
- result .append (_normalize_define (f ["fragment" ][2 :]))
337
+ fragment = f .get ("fragment" , "" ).strip ()
338
+ if fragment .startswith ('"' ):
339
+ fragment = fragment .strip ('"' )
340
+ if fragment .startswith ("-D" ):
341
+ result .append (_normalize_define (fragment [2 :]))
338
342
339
343
return result
340
344
@@ -420,8 +424,8 @@ def _extract_flags(config):
420
424
for cg in config ["compileGroups" ]:
421
425
flags [cg ["language" ]] = []
422
426
for ccfragment in cg ["compileCommandFragments" ]:
423
- fragment = ccfragment .get ("fragment" , "" )
424
- if not fragment . strip () or fragment .startswith ("-D" ):
427
+ fragment = ccfragment .get ("fragment" , "" ). strip ( " \" " )
428
+ if not fragment or fragment .startswith ("-D" ):
425
429
continue
426
430
flags [cg ["language" ]].extend (
427
431
click .parser .split_arg_string (fragment .strip ())
@@ -706,7 +710,7 @@ def prepare_build_envs(config, default_env, debug_allowed=True):
706
710
build_env = default_env .Clone ()
707
711
build_env .SetOption ("implicit_cache" , 1 )
708
712
for cc in compile_commands :
709
- build_flags = cc .get ("fragment" )
713
+ build_flags = cc .get ("fragment" , "" ). strip ( " \" " )
710
714
if not build_flags .startswith ("-D" ):
711
715
if build_flags .startswith ("-include" ) and ".." in build_flags :
712
716
source_index = cg .get ("sourceIndexes" )[0 ]
@@ -1255,7 +1259,7 @@ def _get_installed_pip_packages(python_exe_path):
1255
1259
"future" : ">=0.18.3" ,
1256
1260
"pyparsing" : ">=3.1.0,<4" if IDF5 else ">=2.0.3,<2.4.0" ,
1257
1261
"kconfiglib" : "~=14.1.0" if IDF5 else "~=13.7.1" ,
1258
- "idf-component-manager" : "~=1.5.2 " if IDF5 else "~=1.0" ,
1262
+ "idf-component-manager" : "~=2.0.1 " if IDF5 else "~=1.0" ,
1259
1263
"esp-idf-kconfig" : ">=1.4.2,<2.0.0"
1260
1264
}
1261
1265
@@ -1292,17 +1296,6 @@ def _get_installed_pip_packages(python_exe_path):
1292
1296
)
1293
1297
)
1294
1298
1295
- # # A special "esp-windows-curses" python package is required on Windows
1296
- # # for Menuconfig on IDF <5
1297
- # if not IDF5 and "esp-windows-curses" not in installed_packages:
1298
- # env.Execute(
1299
- # env.VerboseAction(
1300
- # '"%s" -m pip install "file://%s/tools/kconfig_new/esp-windows-curses"'
1301
- # % (python_exe_path, FRAMEWORK_DIR),
1302
- # "Installing windows-curses package",
1303
- # )
1304
- # )
1305
-
1306
1299
1307
1300
def get_idf_venv_dir ():
1308
1301
# The name of the IDF venv contains the IDF version to avoid possible conflicts and
0 commit comments