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

cmake: build hardened dll game with sub cmake to use different compilation flags #1484

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

Conversation

illwieckz
Copy link
Member

@illwieckz illwieckz commented Jan 1, 2025

@slipher
Copy link
Member

slipher commented Jan 1, 2025

Please no 😭. Having stuff built in a sub-invocation makes everything suck. For example:

  • When building with Ninja you don't get any progress messages.
  • Can't build targets individually. I often use this ability when working on something in the sgame because of the cgame taking a lot longer to build (due to rmlui).

@illwieckz illwieckz force-pushed the illwieckz/dll-subcmake/sync branch from 07390e2 to 039add7 Compare January 6, 2025 19:31
@illwieckz
Copy link
Member Author

Now it only builds the dll game in a subproject when HARDENING is ON, it builds it as a usual otherwise.

I refactored a lot the code, also fixed some mistakes with nexe (the nacl target strings was parsed also with saigo, but there is none). Actually the build* functions I've done may be refactored too but I postpone that.

@illwieckz illwieckz force-pushed the illwieckz/dll-subcmake/sync branch 3 times, most recently from c835650 to e8919d6 Compare January 6, 2025 19:40
@illwieckz
Copy link
Member Author

Actually the build* functions I've done may be refactored too but I postpone that.

Rethinking about it, I discovered it was easier than what I thought, so I did it.

@illwieckz illwieckz force-pushed the illwieckz/dll-subcmake/sync branch 3 times, most recently from 04c838b to fff11e5 Compare January 6, 2025 21:39
@illwieckz illwieckz changed the title cmake: build dll game with sub cmake to use different compilation flags cmake: build hardened dll game with sub cmake to use different compilation flags Jan 6, 2025
@illwieckz illwieckz force-pushed the illwieckz/dll-subcmake/sync branch 2 times, most recently from 43e01d4 to 55fdd45 Compare January 6, 2025 23:07
@illwieckz
Copy link
Member Author

I'm happy with that deep refactor. It will also make implementing Wasm easier.

I split the changes in two commits:

  • The deep refactor making it easy to build something as subproject without copy-pasting a ton of boiler-plate.
  • A small commit building the dll as subproject when USE_HARDENED is enabled, buit building the dll as usual otherwise.

The same code now being reused for the various builds, it is even more robust than ever.

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