Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

☂️ Migrating to CMake #3113

Open
2 of 14 tasks
Tracked by #3143
olanti-p opened this issue Sep 1, 2023 · 2 comments
Open
2 of 14 tasks
Tracked by #3143

☂️ Migrating to CMake #3113

olanti-p opened this issue Sep 1, 2023 · 2 comments
Assignees
Labels
enhancement ☂️ umbrella tracks multiple issues at once

Comments

@olanti-p
Copy link
Contributor

olanti-p commented Sep 1, 2023

Is your feature request related to a problem? Please describe.

We currently have 3 4 different build systems:

  1. Makefile
  2. CMake
  3. Visual Studio project
  4. Custom Makefile used by the Android build
  5. Code::Blocks project this one has been removed

All 4 build systems have their own ways of defining various features, so any time we tweak the build files we have to copy over the changes to the other 3. Also, all 4 are out of sync with each other when it comes to build options or utilities supported, which makes it even harder to deal with.

Describe the solution you'd like

Ditch Makefile and Visual Studio projects in favor of single cross-platform CMake project.

CMake can be used to generate both Makefile and VS projects, as well as build files for ninja (which seems to be used these days as the modern faster alternative to Makefile). It's also cross-platform, with customization points for e.g. the same VS project files, so we should be fine on that front, and should be usable for msys2/cygwin builds.

This migration will require some yak shaving:

  1. Bringing CMake build up to date, we could cherry-pick DDA PRs for that (there's a lot of them)
  2. Adding some targets that mirror Makefile utilities (code and JSON formatting, language files manipulations, etc.)

I think in the end this will make it easier to work with the project, say, splitting it up into backend-agnostic game library and sdl + curses backends.

Additional context

No response

Tasks

Preview Give feedback
  1. JSON src tests translation
    scarf005
  2. JSON src tests translation
  3. src
@scarf005
Copy link
Member

scarf005 commented Sep 1, 2023

Adding some targets that mirror Makefile utilities (code and JSON formatting, language files manipulations, etc.)

maybe we could use deno task to simplify some of them. (it's like node package.json scripts but deno)

@olanti-p
Copy link
Contributor Author

olanti-p commented Sep 1, 2023

If they're implemented as CMake targets, then any IDE with CMake integration will be able to show them in ui or run them, and we can make them depend on other targets (e.g. when asked to format json files, Makefile automatically builds the json formatter).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ☂️ umbrella tracks multiple issues at once
Projects
Status: Todo
Development

No branches or pull requests

2 participants