From 80a85aed7d279d994b1745a407a8c43dca3e2442 Mon Sep 17 00:00:00 2001 From: Justin Chrysler Date: Tue, 4 Dec 2018 09:08:08 -0500 Subject: [PATCH] Updated code lite to properly add LD_LIBRARY_PATH is set if libdirs is set --- modules/codelite/codelite_project.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/codelite/codelite_project.lua b/modules/codelite/codelite_project.lua index f52049f5..9f41905f 100755 --- a/modules/codelite/codelite_project.lua +++ b/modules/codelite/codelite_project.lua @@ -124,7 +124,6 @@ end, -- source files are handled at the leaves onleaf = function(node, depth) - local excludesFromBuild = {} for cfg in project.eachconfig(prj) do local cfgname = codelite.cfgname(cfg) @@ -140,7 +139,7 @@ _p(depth, '', node.relpath) end end, - }, false, 1) + }, true) end function m.dependencies(prj) @@ -268,9 +267,20 @@ local pauseexec = iif(prj.kind == "ConsoleApp", "yes", "no") local isguiprogram = iif(prj.kind == "WindowedApp", "yes", "no") local isenabled = iif(cfg.flags.ExcludeFromBuild, "no", "yes") + local ldPath = '' - _x(3, '', - targetname, objdir, command, cmdargs, useseparatedebugargs, debugargs, workingdir, pauseexec, isguiprogram, isenabled) + for _, libdir in ipairs(cfg.libdirs) do + ldPath = ldPath .. ":" .. project.getrelative(cfg.project, libdir) + end + + if ldPath == nil or ldPath == '' then + _x(3, '', + targetname, objdir, command, cmdargs, useseparatedebugargs, debugargs, workingdir, pauseexec, isguiprogram, isenabled) + else + ldPath = string.sub(ldPath, 2) + _x(3, '', + targetname, objdir, ldPath, command, cmdargs, useseparatedebugargs, debugargs, workingdir, pauseexec, isguiprogram, isenabled) + end end function m.environment(cfg)