@@ -36,6 +36,9 @@ using MimeType = String;
3636using MimeTypes = std::set<MimeType>;
3737
3838const MimeTypes source_mime_types{
39+ " application/xml" ,
40+ " text/xml" ,
41+
3942 " inode/x-empty" , // empty file
4043
4144 " text/x-asm" ,
@@ -825,7 +828,11 @@ void Project::load(const yaml &root)
825828 if (dependency.ppath .empty ())
826829 throw std::runtime_error (" Could not load local project: " + lp);
827830 }
828- dependency.ppath = ld.value ();
831+
832+ if (dependency.ppath .is_relative () && rd.has_local_package (ld.value () / dependency.ppath ))
833+ dependency.ppath = ld.value () / dependency.ppath ;
834+ else // is this really needed?
835+ dependency.ppath = ld.value ();
829836 }
830837 }
831838
@@ -1055,9 +1062,11 @@ void Project::load(const yaml &root)
10551062 }
10561063 if (defaults_allowed && iempty)
10571064 {
1058- std::function<void (const String &, const String &)> autodetect_source_dir;
1059- autodetect_source_dir = [this , &autodetect_source_dir](const String ¤t, const String &next = String () )
1065+ std::function<void (const Strings &)> autodetect_source_dir;
1066+ autodetect_source_dir = [this , &autodetect_source_dir](const Strings &dirs )
10601067 {
1068+ const auto ¤t = dirs[0 ];
1069+ const auto &next = dirs[1 ];
10611070 if (fs::exists (current))
10621071 {
10631072 if (fs::exists (" include" ))
@@ -1081,11 +1090,12 @@ void Project::load(const yaml &root)
10811090 {
10821091 // now check next dir
10831092 if (!next.empty ())
1084- autodetect_source_dir (next, " " );
1093+ autodetect_source_dir ({ dirs. begin () + 1 , dirs. end () } );
10851094 }
10861095 }
10871096 };
1088- autodetect_source_dir (" src" , " lib" );
1097+ // keep empty entry at the end
1098+ autodetect_source_dir ({ " src" , " source" , " sources" , " lib" , " " });
10891099 }
10901100 include_directories.public_ .insert (" ${BDIR}" );
10911101
0 commit comments