non-root installed CL compiler & conditional env var

Discussion about CodeLite development process and patches
petah
CodeLite Expert
Posts: 231
Joined: Sat Nov 24, 2012 8:04 pm
Genuine User: Yes
IDE Question: c++
Location: Los Angeles
Contact:

non-root installed CL compiler & conditional env var

Post by petah »

Hi again,

I got gcc49 working as a non-root installed compiler from CL. When using gcc49 to compile CL projects I just need to override the default libstdc++ with the one from gcc49 by appending the following to the linker options

Code: Select all

-Wl,-rpath,</path/to/gcc49/libs/>;-lstdc++;
To move this compiler dependency out of the project settings I tried to conditionally set an env variable in the pre-build commands by grep-testing $(CXX) against "g++49^". It works on a standalone shell, but not inside pre-build commands.

Input variables expand fine, I figured out it's running Dash and can escape $ with $$ (so a variable is expanded later), but can't assign the env var. Either it's empty or the cmd line triggers a syntax error.

Is there a trivial way to make this work? or at least some trick to see what the expanded (var-resolved) command looks like before execution?

thx & cheers,

-- p
main: Debian Jessie x64 + custom wxTrunk