Author Topic: Changing Build Configuration of an existing CB project.  (Read 3116 times)

Offline charles5577

  • Single posting newcomer
  • *
  • Posts: 8
Changing Build Configuration of an existing CB project.
« on: June 07, 2020, 06:31:48 pm »
Hello,p

Not sure if this is where this question belongs but here it is.

First of all, I am using Windows 10 64 bit, Mingw 64 bit compiler, wxWidgets 3.1.3 monolithis, unicode, release build and Codeblocks 20.03 which I build using the downloaded CodeBlocks_wx31_64.cbp file.

My question is "Is it possible to change the build configuration of an existing CB wxWidgets project?" i.e. change the following

Shared to static or vice versa
Monolithic to multiple libraries or vice versa (if shared)
Change unicode setting
Add a debug version even if not selected at the project creation

The question originates from my attempt to build PLPlot. CMake could not locate my wxWidgets location when trying to use CMake. It failed on the command

  find_package(wxWidgets 3.0.0 COMPONENTS base core)

in the file named wxwidgets.cmake in the \plplot-5.15.0.tar\plplot-5.15.0\cmake\modules directory. Looking at the CMake instruction with it looking for base and core libraries, I decided to rebuild wxWidgets with the multiple libraries. This worked and I completed building PLPlot.

I then decided that using the multiple libraries is a good idea to save CPU memory (Don't care about disk space) so I tried to rebuild CodeBlocks using the same cbp file adding the new libraries for each time I got an error that something could not be found. All of this worked until the very end until linking and being told that the monolithic Library could not be found even though the monolithic library is not listed in the library lists. I searched through through the cbp file and could find anything that indicated how to change to multiple libraries.

I can of course use the codebloks executable build with monolithic to to build other projects with multiple libraries, but after thinking decided it could be usefull to be able to change build configurations for existing projects (possibly by changing the cbp file).

Is this possible?



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Changing Build Configuration of an existing CB project.
« Reply #1 on: June 07, 2020, 10:04:06 pm »
Yes, it is possible to build Code::Blocks using a Multilib wxWidgets under the Windows OS.
Edit: It will be very hard or a lot of work to build Code::Blocks using a static wxWidgets lib(s).

You have to remove all the places the monolithic name of wxWidgets is located.
Remember to check both the project and target levels of the linker and compiler settings.

Tim S.
« Last Edit: June 08, 2020, 02:44:53 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline charles5577

  • Single posting newcomer
  • *
  • Posts: 8
Re: Changing Build Configuration of an existing CB project.
« Reply #2 on: June 11, 2020, 10:47:26 am »
Hello Tim S.,

Thanks for the reply. Accually my question was somewhat more general than just just building CB with multiple wxWidgets libraries. it was to know if it is easy to change the build configuration of any wxWidgets project if the wxWidgets project already existed. Your answer suggests that it it not very easy.

No need to spend more time on the question. I think using CB built with the mololithic option is fine. I will just build the wxWidgets libraries with with different configuration possibilites and in this way can use any cbp file.

I have not yet tried, but I wonder what will happen if I start a new project using a monolithic build but link against the PlPlot libraries. In this case the main project will load the monolithic wxWidgets dll, and the PlPlot Library will load the individual dll's. Possible conflict with the same functions in two different libraries and a waste of cpu memory.

Charles A.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Changing Build Configuration of an existing CB project.
« Reply #3 on: June 14, 2020, 07:58:42 pm »
Changing from monolithic to multi-lib is not hard; it could be time consuming.

I thought you wanted to build Code::Blocks, itself, using a static wx library/libraries this is very hard!

Changing from shared/dll to static is only slightly harder to do in an CB Project.

NOTE: The project needs to one that works with static. As I said, the CB Project that builds C::B itself is harder. That is because it requires a lot of code changes and other build related changes.
Edit: The CB Plugin system requires a shared/DLL wxWidgets; so, you need to decide what plugins you wish to always want.

Tim S.
 
« Last Edit: June 14, 2020, 10:32:03 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org