• Do not use Works in Progress as a way of avoiding the releases system! Works in Progress can be used for sharing early betas and for getting suggestions for improvement. Releases of finished content are not allowed in this forum! If you would like to submit a finished addon, click here for instructions on how to do so.

Easy compiling of SRB2 with CMake

Status
Not open for further replies.

Eidolon

Developer
Sonic Team Junior
Kart Krew™️
Hello everyone, one of your resident insane programmers here.

You can now compile SRB2 (very easily!) using CMake. CMake is a build system that generates project files for several different IDEs based on a set of recipes describing the project. This means you can use any IDE that CMake supports, including Visual Studio Community Edition (free!), Code::Blocks, straight Makefiles with MinGW/GCC, Eclipse CDT, whatever CodeLite is, QtCreator, CLion, XCode on Mac, whatever you prefer, with minimal fuss. (Sorry, not Dev-C++ --- that's horrendously out of date and no longer supported, and frankly a piece of crap)

I have updated the Source code compiling page on the Wiki with instructions on how to set this up.

You need to know how to clone from GitHub (in fact, it is required), and have general sense for compiling things in general, but where it used to be a huge clusterfrack to set up for Windows, it's now fairly painless. Especially now that MSVC works again!

You can also compile for MacOSX now, with full application bundle support! Excitinggggg!

This is part of a personal campaign to make it easier for people to contribute to SRB2 and to develop on it. I will be writing a guide on how to contribute code via GitHub soon. This is the beauty of open source: you can be a part of SRB2's development too!

EDIT:

Known issues:

* Multiplayer is broken on OSX from clang/XCode. Oops. We're working on it.
* Multiplayer is broken for 64-bit linux. Well known issue. No idea what's going on there.
* srb2dd doesn't compile even though the target is there. It's unfinished.
 
Last edited by a moderator:
Given that I have no idea how GitHub works, how to compile, or even what compiling is...is there someone else that could make a OS X port for me? *sweatdrop*
 
Maybe thanks to this i will start making my own source code edits too because i always had problems with compiling :)
 
Given that I have no idea how GitHub works, how to compile, or even what compiling is...is there someone else that could make a OS X port for me? *sweatdrop*
In this case, compiling is the process of converting the source code (written in mostly C), into binary code that a computer can read, using a specialized program called a compiler. Anyone with knowledge of XCode and little research on CMake could compile an OSX version.
 
Now I incredibly think the old compiling page was more friggin easy than what it is now. It was some lil 5 steps to compile, now they are like 200. So much information, can't process, mind blown.... Omg it is like a maze, now I can't even keep up with the reading. Install this, then that, warning, dis thing could crash your system, warning this other thing nedds another plugin of 40 gbs, now install this, now unistall the first program named, then install it again lel, then bingo u have Srb2 compiled. Sounds funny thou. I hope someday I learn everything the new compiling page says. Another side note is that while I hate compiling the game with the SDL2 when I don't even need it (no 1 uses de win 8 m8), it takes space I will need later (lol 40 gbs disk, true story). Why even installing Visual Studio, I can't even install it, it trolls me telling me that I may need to free space on my disk while I have like 85 gbs free.

So, issues that make my life a total burden:

Compiling with SDL2 = whu usez win 8 m8?
Installing a *hit ton of progs = m8 relly?
Why even cloning to desktop = had tu instaull GitHub... which ai will unly use 1 taim for "es er bi two"... f*ck mai laif...
can you name more than 1 prog to compile the source code? = i mean... like... what???

And that's all for a lil review. Don't take this as a troll, this may seem like a joke, but that's because I like writting like one, all I said is totally seriousness.
 
Last edited:
Now I incredibly think the old compiling page was more friggin easy than what it is now.

Yes, it was also horrendously vague, filled with errors, didn't cover things such as SDL2, build flags, compiling on other operating systems, and the new CMake system which makes things much easier. If you can't read through and understand the new article then there is no way in hell you can make proper source edits. These changes aren't to make it easier on the kids who just want to try compiling the game, they're oriented towards programmers as they should be.
 
If you can't read through and understand the new article then there is no way in hell you can make proper source edits. These changes aren't to make it easier on the kids who just want to try compiling the game, they're oriented towards programmers as they should be.

First, I'm not a kid, kids are more interested on garbage like CoD, Battlefield and those stupid noob FPS games. Second, I'm a programmer, I code low javascript and logic coding with Blitz3D.
I never saw something that needs to be compiled with so much toolkits that you will only use to edit one thing. And I'm actually interested on what can I do with Srb2, and make... actual progress.
I've been on some intense stuff the last months so it's possible I'm not fully active to read all the guide properly, lazyness. And school is starting at the end of this month, makes me even more nervous.
 
I've been on some intense stuff the last months so it's possible I'm not fully active to read all the guide properly, lazyness. And school is starting at the end of this month, makes me even more nervous.

I'm sorry our codebase doesn't cater to your exact needs, and that you don't have the patience to learn things? C is not an easy language, and compiling SRB2 is not easy either. CMake makes things easier to maintain. If you actually learn it, you'll see it's a lot more flexible than the original build system was. This is coming from someone who very much knows the ins and outs of both of our build systems, and the benefits and drawbacks of both approaches.

I'm willing to help, but you have to be willing to learn. If you're not willing to learn, you're not ever going to get things done, in C or otherwise. So change your attitude from "I don't know how this works and I don't want to learn" to "I don't understand this, can you please help me?"

The first step is asking questions.

For the record, I will be working on guides that explain how to navigate the codebase and how to submit contributions through GitHub once I have the time. But there's a lot of work to do, and I'm just a college undergrad. Things take time.
 
Last edited:
Yes, I'm sorry, I'll take a day to do some deep reading and try to understand more of the topic.

There's one thing blocking my way to learn compiling Srb2. Visual studio blocks me the Install option, says I need 8 gbs across all disks, my main disk,which is C:, was almost empty when I received this laptop, but from all the sudden it went almost full on space limits, I tried cleaning all unnecessary files and folders, but yeah, it still is almost full, I have 1.28 gbs free actually. So, Visual Studio is the unique program named, I would need another program to keep my way to compiling.
 
You might consider Code::Blocks as a generation target instead of Visual Studio. Or QtCreator. Or CLion (early access preview). All are smaller than Visual Studio. I haven't used Code::Blocks in a very long time and I haven't tested it under the SRB2 CMakeLists.txt, but it should work if it uses MinGW Makefiles.

http://www.cmake.org/cmake/help/v3.0/generator/CodeBlocks.html
http://www.codeblocks.org/

QtCreator doesn't have a generator in CMake perse, but its project system integrates directly with CMake. The same goes for CLion. CLion and CodeBlocks both need MinGW installed to work.

EDIT: Confirming that the Code::Blocks for MinGW Makefiles generator works fine, as long as MinGW is in your operating system PATH when you run CMake GUI. The MinGW installation guide probably has some instructions for setting the PATH up. This will generate an SRB2.cbp for Code::Blocks to work with.
 
Last edited:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top