Cross-platform SDL2: how to write a decent makefile?

Started by
4 comments, last by AbandonedAccount 10 years, 4 months ago

I'm currently working with SDL 2 and trying to make use of it's multiplatform features. I have a simple CMake project on top of it, allowing me to easily compile to Windows and Linux. However, i wanted to know more about other workflows, as well how other developers handle compiling for iOS and Android.

Do you guys recommend cmake? Or a custom-tailored makefile is easier for handling different nuances in each platform?

Advertisement

CMake is fine. Are you having trouble with CMake for iOS or Android?

How you handle setting up the builds is pretty much personal preference. As an example, think of -l libraryName or a #pragma in the code. Neither is better. It's just whether you put the complexity in the source files or the makefiles.

Actually, i have no idea on how to setup NDK and other parts of the Android toolset with CMake. =x

https://code.google.com/p/android-cmake/ is one resource you can use. The link to documentation walks you through setting things up. If you're having problems, can you maybe link to what resource you've been using to try to set things up? It's hard to know what would help you most when you don't say where you're running into trouble.

How can i streamline the generation of Android projects across platforms? As well running NDK and other steps from SDL2 android. The same for iOS...

If you haven't even run Android NDK yet and you say it is required, I'd strongly suggest doing that before trying to get CMake and SDL2 involved. Once you understand how to actually build an Android app, you'll probably find the instructions people provide for setting up CMake and SDL2 are a lot easier to follow and understand. The same for iOS.

If you have trouble following any of the tutorials for iOS or Android, people can probably point you to alternatives that might fit your learning style better. You'd just need to explain what tutorial you tried, and where you got hung up with it. But if you haven't even tried to learn how to develop for iOS or Android, I'm not sure how people can help you set up CMake and SDL2 for platforms you have no familiarity with.

This topic is closed to new replies.

Advertisement