File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -865,21 +865,22 @@ def find_default_component(target_configs):
865
865
866
866
sdk_config = get_sdk_configuration ()
867
867
868
- if all (t in target_configs for t in ("__idf_src" , "__idf_main" )):
868
+
869
+ project_target_name = "__idf_%s" % basename (env .subst ("$PROJECT_SRC_DIR" ))
870
+ if project_target_name not in target_configs :
871
+ sys .stderr .write ("Error: Couldn't find the main target of the project!\n " )
872
+ env .Exit (1 )
873
+
874
+ if all (t in target_configs for t in (project_target_name , "__idf_main" )):
869
875
sys .stderr .write (
870
876
(
871
877
"Warning! Detected two different targets with project sources. Please use "
872
- "either 'src' or specify 'main' folder in 'platformio.ini' file.\n "
878
+ "either %s or specify 'main' folder in 'platformio.ini' file.\n "
879
+ % project_target_name
873
880
)
874
881
)
875
882
env .Exit (1 )
876
883
877
-
878
- project_target_name = "__idf_main" if "__idf_main" in target_configs else "__idf_src"
879
- if project_target_name not in target_configs :
880
- sys .stderr .write ("Error: Couldn't find the main target of the project!\n " )
881
- env .Exit (1 )
882
-
883
884
project_ld_scipt = generate_project_ld_script (
884
885
sdk_config , [project_target_name , "__pio_env" ])
885
886
env .Depends ("$BUILD_DIR/$PROGNAME$PROGSUFFIX" , project_ld_scipt )
You can’t perform that action at this time.
0 commit comments