@@ -1181,59 +1181,60 @@ private command __MapCodeLibraryForIDE pFolder
11811181 delete the last item of tLibrary
11821182 if tLibrary is not empty then
11831183 set the revLibraryMapping[tLibrary ] to "./" & tExtension & "/" & tLibrary
1184+ return empty
11841185 end if
11851186 end repeat
11861187 end if
1187- else
1188- -- code folders should be platform ID triples however for the
1189- -- time being as we have no way to access the data required to
1190- -- determine the options section of the platform ID so we filter only
1191- -- arch and platform and hope for the best. Ideally we would have
1192- -- access to a build options string and give a complete match precedence.
1193- local tCodeFolders
1194- put folders (pFolder ) into tCodeFolders
1195- switch the platform
1196- case "MacOS"
1197- filter tCodeFolders with "*-mac*"
1198- break
1199- case "Win32"
1200- filter tCodeFolders with "*-win32*"
1201- break
1202- default
1203- filter tCodeFolders with "*-" & toLower (the platform ) & "*"
1204- break
1205- end switch
1188+ end if
1189+
1190+ -- code folders should be platform ID triples however for the
1191+ -- time being as we have no way to access the data required to
1192+ -- determine the options section of the platform ID so we filter only
1193+ -- arch and platform and hope for the best. Ideally we would have
1194+ -- access to a build options string and give a complete match precedence.
1195+ local tCodeFolders
1196+ put folders (pFolder ) into tCodeFolders
1197+ switch the platform
1198+ case "MacOS"
1199+ filter tCodeFolders with "*-mac*"
1200+ break
1201+ case "Win32"
1202+ filter tCodeFolders with "*-win32*"
1203+ break
1204+ default
1205+ filter tCodeFolders with "*-" & toLower (the platform ) & "*"
1206+ break
1207+ end switch
1208+
1209+ local tFilteredCodeFolders
1210+ filter tCodeFolders with the processor & "-*" into tFilteredCodeFolders
1211+ split tFilteredCodeFolders by return as set
1212+ if the platform is "MacOS" then
1213+ -- explicit processor should take precedence over universal builds but
1214+ -- in the event multiple libraries are included and some are universal
1215+ -- we must merge
1216+ local tUniveralFilteredCodeFolders
1217+ filter tCodeFolders with "universal-*" into tUniveralFilteredCodeFolders
1218+ split tUniveralFilteredCodeFolders by return as set
1219+ union tFilteredCodeFolders with tUniveralFilteredCodeFolders
1220+ end if
1221+
1222+ repeat for each key tFolder in tFilteredCodeFolders
1223+ put files (pFolder & "/" & tFolder ) & return & \
1224+ folders (pFolder & "/" & tFolder ) into tLibraries
1225+ filter tLibraries without ".*"
12061226
1207- local tFilteredCodeFolders
1208- filter tCodeFolders with the processor & "-*" into tFilteredCodeFolders
1209- split tFilteredCodeFolders by return as set
1210- if the platform is "MacOS" then
1211- -- explicit processor should take precedence over universal builds but
1212- -- in the event multiple libraries are included and some are universal
1213- -- we must merge
1214- local tUniveralFilteredCodeFolders
1215- filter tCodeFolders with "universal-*" into tUniveralFilteredCodeFolders
1216- split tUniveralFilteredCodeFolders by return as set
1217- union tFilteredCodeFolders with tUniveralFilteredCodeFolders
1227+ if tLibraries is not empty then
1228+ set the itemDelimiter to "."
1229+ repeat for each line tLibrary in tLibraries
1230+ -- remove extension
1231+ delete the last item of tLibrary
1232+ if tLibrary is not empty then
1233+ set the revLibraryMapping[tLibrary ] to pFolder & "/" & tFolder & "/" & tLibrary
1234+ end if
1235+ end repeat
12181236 end if
1219-
1220- repeat for each key tFolder in tFilteredCodeFolders
1221- put files (pFolder & "/" & tFolder ) & return & \
1222- folders (pFolder & "/" & tFolder ) into tLibraries
1223- filter tLibraries without ".*"
1224-
1225- if tLibraries is not empty then
1226- set the itemDelimiter to "."
1227- repeat for each line tLibrary in tLibraries
1228- -- remove extension
1229- delete the last item of tLibrary
1230- if tLibrary is not empty then
1231- set the revLibraryMapping[tLibrary ] to pFolder & "/" & tFolder & "/" & tLibrary
1232- end if
1233- end repeat
1234- end if
1235- end repeat
1236- end if
1237+ end repeat
12371238end __MapCodeLibraryForIDE
12381239
12391240private command __LoadExtension pCacheIndex, pSourceType, pSourceFile, pFolder, pStatus, @xError
0 commit comments