Author Topic: exchndl related patch because win32/lib folder is empty in SVN  (Read 19811 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9528
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #30 on: September 04, 2015, 07:53:08 am »
I'm not sure if I like the Idea of custom vars. Because its quite hard to maintain if you think about all the project files. Often it is easier for a new compiler to either create a new target (based on an existing) within a project or simply add another project.

In the first place I though about relative paths just as we do it with the "devel" directory...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Online stahta01

  • Lives here!
  • ****
  • Posts: 6749
    • My Best Post
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #31 on: September 04, 2015, 01:59:09 pm »
I'm not sure if I like the Idea of custom vars. Because its quite hard to maintain if you think about all the project files. Often it is easier for a new compiler to either create a new target (based on an existing) within a project or simply add another project.

In the first place I though about relative paths just as we do it with the "devel" directory...

But, think of how much easier it is to switch to a new version of wxWidgets by just editing the three custom vars.

Will post my two sets of patches doing it my way if after you see the way I do it you still wish me to do it without CB custom vars I will remove them.

Patch 0001 just is doing a save-as using CB 13.12 to make it easier to see the real changes in patch 0002.
Turned out I only needed to change about dozen projects of the main Windows 32bit wx2.8 projects.

Edit: I am going to start work on removing the CB custom vars in a short while.
Will post a second patch 0002 in a few hours.

Edit: Deleted attachments; will post new message with updated attachments later today.

Tim S.

« Last Edit: September 07, 2015, 01:55:25 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #32 on: September 04, 2015, 02:55:55 pm »
But, think of how much easier it is to switch to a new version of wxWidgets by just editing the three custom vars.
I don't understand this. wx2.8 and wx3.0 already have separate project files and separate output/intermediate folders. Switching to a minor version like say wx3.0 -> wx3.1 is as easy as modifying the associated global variable. Or am I missing something?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5251
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #33 on: September 04, 2015, 02:57:39 pm »
Hi, Tim, I see in the 0001 patch, there are some code snippet
Code: [Select]
diff --git a/src/plugins/contrib/help_plugin/help-plugin.cbp b/src/plugins/contrib/help_plugin/help-plugin.cbp
index bc3500f..7015570 100644
--- a/src/plugins/contrib/help_plugin/help-plugin.cbp
+++ b/src/plugins/contrib/help_plugin/help-plugin.cbp
@@ -64,8 +64,8 @@
  </Compiler>
  <Linker>
  <Add option="-mthreads" />
- <Add library="bzip2/libbzip2.a" />
- <Add library="zlib/libz.a" />
+ <Add library="bzip2\libbzip2.a" />
+ <Add library="zlib\libz.a" />
  </Linker>
  <ExtraCommands>
  <Add after="zip -j9 ..\..\..\devel\share\CodeBlocks\help_plugin.zip manifest.xml *.xrc *.png" />
Is that correct? change the "/" to "\" ?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6749
    • My Best Post
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #34 on: September 04, 2015, 06:23:38 pm »
Hi, Tim, I see in the 0001 patch, there are some code snippet
Code: [Select]
diff --git a/src/plugins/contrib/help_plugin/help-plugin.cbp b/src/plugins/contrib/help_plugin/help-plugin.cbp
index bc3500f..7015570 100644
--- a/src/plugins/contrib/help_plugin/help-plugin.cbp
+++ b/src/plugins/contrib/help_plugin/help-plugin.cbp
@@ -64,8 +64,8 @@
  </Compiler>
  <Linker>
  <Add option="-mthreads" />
- <Add library="bzip2/libbzip2.a" />
- <Add library="zlib/libz.a" />
+ <Add library="bzip2\libbzip2.a" />
+ <Add library="zlib\libz.a" />
  </Linker>
  <ExtraCommands>
  <Add after="zip -j9 ..\..\..\devel\share\CodeBlocks\help_plugin.zip manifest.xml *.xrc *.png" />
Is that correct? change the "/" to "\" ?

Correct, I change nothing myself all I did was do a save-as for each project using CB 13.12.
This way the real changes are all in the second patch.

Otherwise it is real hard to see all the real changes in the same diff with the project formatting changes.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 6749
    • My Best Post
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #35 on: September 04, 2015, 06:28:02 pm »
But, think of how much easier it is to switch to a new version of wxWidgets by just editing the three custom vars.
I don't understand this. wx2.8 and wx3.0 already have separate project files and separate output/intermediate folders. Switching to a minor version like say wx3.0 -> wx3.1 is as easy as modifying the associated global variable. Or am I missing something?

No, you are NOT missing anything; what you stated is clearer than what I said.

Tim S.
« Last Edit: September 04, 2015, 06:33:54 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #36 on: September 04, 2015, 08:42:05 pm »
But, think of how much easier it is to switch to a new version of wxWidgets by just editing the three custom vars.
I don't understand this. wx2.8 and wx3.0 already have separate project files and separate output/intermediate folders. Switching to a minor version like say wx3.0 -> wx3.1 is as easy as modifying the associated global variable. Or am I missing something?
Well, this is the current implementation already, I wasn't referring to your patch if that's what you thought. Is your patch trying to further separate the output/intermediate folders for minor versions (i.e. wx3.0, wx3.1)? If yes, I don't think that's a good idea because then the 'update.bat's scattered all along the project and the plugins need to be modified or duplicated per minor revisions as they will ALSO be dependent on these 3 variables. I think that is very error prone.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6749
    • My Best Post
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #37 on: September 05, 2015, 01:55:35 am »
But, think of how much easier it is to switch to a new version of wxWidgets by just editing the three custom vars.
I don't understand this. wx2.8 and wx3.0 already have separate project files and separate output/intermediate folders. Switching to a minor version like say wx3.0 -> wx3.1 is as easy as modifying the associated global variable. Or am I missing something?
Well, this is the current implementation already, I wasn't referring to your patch if that's what you thought. Is your patch trying to further separate the output/intermediate folders for minor versions (i.e. wx3.0, wx3.1)? If yes, I don't think that's a good idea because then the 'update.bat's scattered all along the project and the plugins need to be modified or duplicated per minor revisions as they will ALSO be dependent on these 3 variables. I think that is very error prone.

So, I guess you are for code duplication?

Because, having to change 10 places is worse than changing one place per CB project in my book.

Edit: Re-reading your post it appears to me that you never looked at my second patch; I suggest you look at it before deciding what it is doing or NOT doing!

Tim S.
« Last Edit: September 05, 2015, 02:18:06 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 6749
    • My Best Post
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #38 on: September 05, 2015, 02:08:14 am »
Patch 2 and 3 that adds lib without using CB custom vars.

Patch 0003 is needed to remove an external dependency warning.

Edit: Deleted attachments; will post new message with updated attachments later today.

Tim S.


« Last Edit: September 07, 2015, 01:56:08 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #39 on: September 05, 2015, 09:09:23 am »
Edit: Re-reading your post it appears to me that you never looked at my second patch; I suggest you look at it before deciding what it is doing or NOT doing!
I've looked at your 2nd patch before I posted, in fact the only download your 2nd patch has is by me. A first glance tells me it replaces the devel and obj folders with cv_bin and cb_obj variables and introduces a cb_lib variable. Now my point is if one changes the output (cb_bin) variable to, say 'output31' in accordance with wx3.1 then the update files for project, codesnippets, doxyblocks, fortran, incrementalsearch, lib_finder etc... all need to be modified to take into account this change. Am I wrong?

Online stahta01

  • Lives here!
  • ****
  • Posts: 6749
    • My Best Post
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #40 on: September 05, 2015, 04:11:59 pm »
Edit: Re-reading your post it appears to me that you never looked at my second patch; I suggest you look at it before deciding what it is doing or NOT doing!
I've looked at your 2nd patch before I posted, in fact the only download your 2nd patch has is by me. A first glance tells me it replaces the devel and obj folders with cv_bin and cb_obj variables and introduces a cb_lib variable. Now my point is if one changes the output (cb_bin) variable to, say 'output31' in accordance with wx3.1 then the update files for project, codesnippets, doxyblocks, fortran, incrementalsearch, lib_finder etc... all need to be modified to take into account this change. Am I wrong?

In theory you are right; but, my long term plan is to remove all update scripts except for the main one that copies from devel to output.
Also, plan to remove from CB projects the use of directly copying files to the output folders.
My plan is also to fix the building using a PCH version of sdk.h for all contrib projects using the cb_obj variable.
Currently non of the contrib projects use the precompiled version of sdk.h!

Tim S.


C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #41 on: September 05, 2015, 05:37:38 pm »
Ok now it's clear. I still think introducing variables for output/intermediate folders is not a good idea because of the main update script but a separate lib folder sounds good.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6749
    • My Best Post
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #42 on: September 05, 2015, 06:35:52 pm »
Ok now it's clear. I still think introducing variables for output/intermediate folders is not a good idea because of the main update script but a separate lib folder sounds good.

I am starting work on adding the lib30 folder to the wx30 CB projects.
Next, will be adding lib30_64 folder.
Last, I will work on adding lib and lib30 to the Linux CB Projects.
All of the work will be without using new CB custom vars; since at least two devs are against that for some reason I fail to follow.

Edit: Feedback wanted a single big patch or as I think best two patches one with the CB reformatting and the second with the real change?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12218
    • Travis build status
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #43 on: September 05, 2015, 09:15:42 pm »
Last, I will work on adding lib and lib30 to the Linux CB Projects.
Why is this needed there or even on windows?
What libs do you plan to put there?
Why are we using import libs at all (.lib next to .dll) on windows?
As far as I know gcc can link directly to a dll file as on unix.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Online stahta01

  • Lives here!
  • ****
  • Posts: 6749
    • My Best Post
Re: exchndl related patch because win32/lib folder is empty in SVN
« Reply #44 on: September 06, 2015, 03:08:05 am »
Last, I will work on adding lib and lib30 to the Linux CB Projects.
Why is this needed there or even on windows?
What libs do you plan to put there?
Why are we using import libs at all (.lib next to .dll) on windows?
As far as I know gcc can link directly to a dll file as on unix.

Linux still has the static libs.

Windows needs the import libs sometimes in this thread it needs them for the exchndl dll because linking directly gives a warning for me and an error for someone else.

Tim S.
« Last Edit: September 06, 2015, 03:10:12 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org