Hello,
Building a code that links against wxwidgets does not work on C::B (trunk) on MacOS because the commands between backticks are not returned.
They are the usual
`wx-config --cxxlibs`
`wx-config --libs std,aui`
- If I run C::B from the Mac bundle from within the terminal:
cd CodeBlocks.app/Contents/MacOS
./codeblocks
then everything works, e.g.:
clang++ -Wall -g -std=c++11 -I/Users/federico/Downloads/wx/3.1.7/build-cocoa-debug/lib/wx/include/osx_cocoa-unicode-3.1 -I/Users/federico/Downloads/wx/3.1.7/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ -c /Users/federico/....
If instead I open C::B by clicking on the package Icon, I get for the same file:
clang++ -Wall -g -std=c++11 -c /Users/federico/.....
Notice there's a double space where the includes should be, so the call to wx-config is returning Codeblocks an empty string.
Anyone experienced that before? I think the Mac may be sending output to that command somewhere else which is not returned properly?
I found that no Mac GUI app has access to the environment variables, they only apply to command-line shells
(see for example https://developer.apple.com/forums/thread/74371 (https://developer.apple.com/forums/thread/74371))
So, the standard way of calling wxwidgets flags via `wx-config --clibs` is never going to work on C::B on Mac if run from the packaged app.
I think the only way is to go back to use the global variable environment and define full-path commands like
`$(#wx)/wx-config --cflags`
where $(#wx) is defined as the path-to-wx-config.
Unfortunately I see that wxwidgets GUI template projects do not use those wx global variables anymore, they've also switched
to using wx-config commands everywhere. I think this is never going to work on Mac apps.