News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to set up my own wx-config?

Started by kagi3624, October 27, 2021, 08:51:50 AM

Previous topic - Next topic

kagi3624

Hello, on my linux machine I have a second config for cross compiling to windows that I gave a symbolic link wx-config-forw and it compiles just fine when my default wx-config is something else:
x86_64-w64-mingw32-g++ minimal.cpp `wx-config-forw --cxxflags --libs` -o minimal.exe

For my wxWidget project I would like to set to set up the debug build over g++ and the default wx-config and my release build over ming and my custom wx-config-forw. So how can I tell code::blocks to use my custom wx-config instead of the default one for the release build? If I add it to 'other linker options' in the build options the default config is still used and my project fails to build.

Miguel Gimenez

You have  different 'other linker options'  for the release and the debug targets, just remove the call to wx-config from the common options.

cacb


kagi3624

Thanks, after some fiddling around I got it now. The most difficult part for me was to understand that common compiler and linker settings are used for both build options. Kinda contra intuitive when you have the option to chose two totally different compilers. Anyway,  you also have to remove compiler settings -> other compiler options in the common build options of your projects too. Or you could just edit your project file with a text editor, I guess it works too

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="myPR" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/myPR" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="0" />
<Option compiler="gcc" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-g" />
<Add option="`wx-config --cflags`" />
</Compiler>
<Linker>
<Add option="`wx-config --libs`" />
</Linker>
</Target>
<Target title="Release">
<Option output="bin/Release/myPR" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="0" />
<Option compiler="mingw32" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-O2" />
<Add option="`wx-config-forw --cflags`" />
</Compiler>
<Linker>
<Add option="-s" />
<Add option="`wx-config-forw --libs`" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="GUIFrame.cpp" />
<Unit filename="GUIFrame.h" />
<Unit filename="WxWizFrame.fbp" />
<Unit filename="myPRApp.cpp" />
<Unit filename="myPRApp.h" />
<Unit filename="myPRMain.cpp" />
<Unit filename="myPRMain.h" />
<Extensions />
</Project>
</CodeBlocks_project_file>