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

Split more things into libraries #7554

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

glebm
Copy link
Collaborator

@glebm glebm commented Nov 23, 2024

This does not fully address the issue of mostly everything being in one giant library but it's a start.

I got here by trying to isolate path.cpp into its own library and quickly realized that it transitively
depends on everything.

This is the point where I got to with splitting things up (and gave up for now).

Most of the diff count is from moving SFX enums into a separate file (so that code that only needs the IDs can avoid depending on the entire sound subsystem).

Also changes the mechanism used to implement transitive dependency support for OBJECT
libraries. The new mechanism is more robust but requires that all OBJECT targets are defined before they can be passed as dependencies to other targets.

@glebm glebm force-pushed the path-test branch 2 times, most recently from 3d9f1b8 to ff7c974 Compare November 23, 2024 13:15
@glebm glebm marked this pull request as draft November 23, 2024 13:25
@glebm glebm force-pushed the path-test branch 18 times, most recently from eed4c8c to 44af477 Compare November 24, 2024 22:12
@glebm glebm marked this pull request as ready for review November 24, 2024 22:23
@glebm glebm enabled auto-merge (rebase) November 24, 2024 22:23
@glebm glebm force-pushed the path-test branch 2 times, most recently from 312eee4 to d96faef Compare November 25, 2024 08:56
This does not fully address the issue of most everything
being a giant library but it's a start.

I got here by trying to isolate `path.cpp` into its own
library and quickly realized that it transitively
depends on everything.

This is the point where I got to with splitting things
up (and gave up for now).

This commit also changes the mechanism used to
implement transitive dependency support for OBJECT
libraries. The new mechanism is more robust but
requires to define all OBJECT targets before
passing them as dependencies to other targets.
Apparently required for `std::visit`
Copy link
Member

@AJenbo AJenbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splitting headless from engine and endian_write are the only things I found a bit odd.

Besides unit tests headless would also make sens if we implement a game server, maybe that gives some better context.

@glebm
Copy link
Collaborator Author

glebm commented Dec 1, 2024

  • endian_write: I wanted to split off the functions that depend on SDL
  • Headless: yeah mostly for unit tests. There is a quite a bit of code that only references headless rather than the whole engine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants