File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1038,10 +1038,15 @@ def compile_source_files(
1038
1038
rel = src_path_obj .relative_to (components_dir_path )
1039
1039
obj_path = str (Path (obj_path ) / str (rel ))
1040
1040
except ValueError :
1041
- if not os .path .isabs (source ["path" ]):
1042
- obj_path = str (Path (obj_path ) / source ["path" ])
1043
- else :
1044
- obj_path = str (Path (obj_path ) / os .path .basename (src_path ))
1041
+ # Preserve project substructure when possible
1042
+ try :
1043
+ rel_prj = src_path_obj .relative_to (Path (project_src_dir ).resolve ())
1044
+ obj_path = str (Path (obj_path ) / str (rel_prj ))
1045
+ except ValueError :
1046
+ if not os .path .isabs (source ["path" ]):
1047
+ obj_path = str (Path (obj_path ) / source ["path" ])
1048
+ else :
1049
+ obj_path = str (Path (obj_path ) / os .path .basename (src_path ))
1045
1050
1046
1051
preserve_source_file_extension = board .get (
1047
1052
"build.esp-idf.preserve_source_file_extension" , "yes"
You can’t perform that action at this time.
0 commit comments