Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Manage a medium project, export and build on multiple platforms.  (Read 838 times)

0 Members and 1 Guest are viewing this topic.

pinguim

  • Newbie
  • *
  • Posts: 1
    • View Profile
Manage a medium project, export and build on multiple platforms.
« on: February 08, 2023, 12:34:01 am »
Hi everybody

I've been developing SFML projects for a few months, alone and in collaboration, but I always have problems when expanding the scope: adding libraries, managing the code to be compile on linux and windows (this is by the many people working on a project), and exporting the final program.

My current approach is to use a makefile and the pre-compiled SFML libraries (GCC 7.3.0 MinGW (SEH) - 64-bit for windows and GCC - 64-bit for linux). Depending on the host, the makefile uses the version of the library that it needs and works, mostly.

In my last project, I tried to export my compiled program and tried to run on multiple platforms. And with that I think my approach demonstrates not to be the best. The big problem was that by default I was using the shared libraries, and I needed to put every .dll and .so inside the export folder. I tried to compile/use static SFML libraries but for some reason I can't do this. (as I'm not using any kind of IDE, I just got lost using makefiles....).

My big question after that is, how can I create a workflow that works for these needs? By workflow I mean a "simple" way to develop on linux, windows, and a way to export the project (win, linux, maybe mac?). Have any of you had to do something similar with this? Thanks!


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Re: Manage a medium project, export and build on multiple platforms.
« Reply #1 on: February 08, 2023, 08:21:07 am »
If you develop it as open source project, you can use the full power of GitHub Actions or any other similar CI, to build on all the different platforms, and even produce releases.

I personally recommend setting everything up as CMake project and to make your life easier, you can even use FetchContent to directly pull SFML and other libraries, so they get built on the fly and you don't have to ship around SDKs etc.

A good starting point in the CMake SFML template, which also already comes with GitHub Actions builds for all platforms: https://github.com/SFML/cmake-sfml-project

If you're not developing it as open source project, then things get a bit more tricky. You can use some of the limited free offer, pay to extend that offer or try and run your own CI.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything