From cd8efb0e5dec29919787b2f80ba1fee56b0ef051 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 8 May 2015 23:05:09 +0200 Subject: [PATCH] libman,nux, automatically adds phobos/druntime --- src/ce_libman.pas | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/ce_libman.pas b/src/ce_libman.pas index d762cdfe..79eddcc4 100644 --- a/src/ce_libman.pas +++ b/src/ce_libman.pas @@ -87,12 +87,38 @@ begin end; end; {$ENDIF} - // TODO-cfeature: add linux paths for druntime/phobos {$IFDEF LINUX} - + // add phobos + if DirectoryExists('/usr/include/dmd/phobos') and FileExists('/usr/lib/libphobos2.a') then + begin + with TLibraryItem(fCol.Add) do begin + libAlias := 'phobos'; + libFile := '/usr/lib/libphobos2.a'; + libSourcePath := '/usr/include/dmd/phobos'; + end; + end; + // add druntime (no lib - only for DCD) + if DirectoryExists('/usr/include/dmd/druntime/import') then + begin + with TLibraryItem(fCol.Add) do begin + libAlias := 'druntime'; + libFile := ''; + libSourcePath := '/usr/include/dmd/druntime/import'; + end; + end; + {$ENDIF} + {$IFDEF DARWIN} + assert(false, 'to be implemented'); {$ENDIF} end; - updateDCD + if fCol.Count = 0 then + begin + ce_common.dlgOkError( + 'Coedit failed to automatically add "druntime" and "phobos" to the library manager.' + + 'These two items have to be added manually following the procedure described in the wiki.' + ); + end; + updateDCD; end; destructor TLibraryManager.destroy;