We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3017 - Refactor Cmake scripts
Summary: Refactor Cmake scripts
Status: REOPENED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.1
Hardware: x86 Windows Vista
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-15 13:38 UTC by DarioOO
Modified: 2016-06-12 23:54 UTC (History)
2 users (show)

See Also:


Attachments
Patch enabling switching of debug Symbols (GCC only) (1.18 KB, patch)
2015-06-19 05:48 UTC, DarioOO
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description DarioOO 2015-06-15 13:38:19 UTC
I asked previously improvements in the CMake script files, but I just saw the cmake build script is broken (again!) and there are already many open tickets for Cmake. 

Most big c++ projects are switching to Cmake as primary build system, It's just disappointing you not have Cmake as priority and often I see it is actually broken for SDL2 making other framworks more appealing. (I know Cmake it's not a panacea, but if used properly has great benefits)

The build system needs heavy refactoring in my opinion, I marked that as enanchment because I already filed a bug for the broken build in 2.0.4 RC1, But in general if you do not improve the CMake scripts you would end up having broken build everytime you apply small changes.

Not everyone will just spent time even reporting bugs (I also tried to fix that script but it is just too complex for the occasional user)

I hope you see that as a priority. (I can even give some help if there's someone that want to explain me certain weird stuff done at low level like: checking if "printf" is available O_O)
Comment 1 Sam Lantinga 2015-06-16 06:40:11 UTC
Sure, can you coordinate with Ryan to see how the CMake scripts can be improved? I don't use CMake myself for various reasons, so I leave it in y'all's capable hands. :)
Comment 2 DarioOO 2015-06-18 23:34:04 UTC
Ok I partially QUICK fixed the problem. I submitted the patch with HG (it don't asked credentials, so I hope I was already granted write access and that is not a security breach XD).

- Now debug symbols can be disabled for GCC reducing binary size from 5 MB to 1.3 MB (default is now without debug symbols)

- There's much more margin for improvement

I think that's enough for RC1, but I'm willing to do more work for improving Cmake scripts :).

Can someone confirm the patch is in the "trunk" (sorry I used mostly SVN and GIT so I don't know if I did the commit correctly with HG)
Comment 3 Ryan C. Gordon 2015-06-19 01:28:45 UTC
(In reply to DarioOO from comment #2)
> Ok I partially QUICK fixed the problem. I submitted the patch with HG (it
> don't asked credentials, so I hope I was already granted write access and
> that is not a security breach XD).

If you "committed" the change, that means it's committed to your local copy of the repository; it doesn't work like Subversion in this case.

You would have to "push" the change to our repository, but you don't have access to do that. You can do "hg export tip" and attach the output of that to this bug report, though, and we'll review and push it!

Thanks,
--ryan.
Comment 4 DarioOO 2015-06-19 05:48:58 UTC
Created attachment 2187 [details]
Patch enabling switching of debug Symbols (GCC only)

Here the patch. It does not any major change. It just add the chance to change compile settings
Comment 5 Ryan C. Gordon 2015-06-22 15:54:50 UTC
We're going to wait on this until 2.0.5; the thing we _should_ be doing is not forcing debug symbols at all (that's what the built in CMAKE_BUILD_TYPE=Debug is for). There's a couple things like that we need to fix.

--ryan.
Comment 6 Cyberunner23 2016-06-12 23:54:52 UTC
I would like to volunteer for the refactoring if you don't mind. Perhaps I could actually work on it right now and show it to you, test it, change it if you want and so on once I'm done.