From 1d769d35834f8ed92e20583525f5b8c9d6ad0a65 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 15 Aug 2015 09:28:56 +0200 Subject: [PATCH] libman, improved register from project. - libraries made of a single source are more likely to be registered without having to patch the path - some exception still exist, for example the libraries with several leading empty sub folders (shitty example src/org/eclipse/swt...) :poop: --- src/ce_libmaneditor.pas | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ce_libmaneditor.pas b/src/ce_libmaneditor.pas index cbdb2366..8e8d7e5a 100644 --- a/src/ce_libmaneditor.pas +++ b/src/ce_libmaneditor.pas @@ -187,8 +187,14 @@ begin try for i := 0 to fProj.Sources.Count-1 do str.Add(fProj.getAbsoluteSourceName(i)); - root := commonFolder(str); - root := ExtractFileDir(root); + // single source libs usually have the structure "src/" + if str.Count = 1 then + root := ExtractFileDir(str.Strings[0]) + // multi source libs have the structure "src/LibName/"/... + else begin + root := commonFolder(str); + root := ExtractFileDir(root); + end; if root = '' then begin dlgOkInfo('the static library can not be registered because its source files have no common folder');