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

Replace the quirky cfg.h comp. ctrl. header with a safer build config method #15

Closed
xparq opened this issue Jan 22, 2023 · 3 comments
Closed
Labels
tooling Something about the dev. infrastructure
Milestone

Comments

@xparq
Copy link
Owner

xparq commented Jan 22, 2023

Quoting from #14:

such a "config header" for manual inclusion is VERY BAD PRACTICE, and should be replaced with a proper, more robust build config mechanism

@xparq xparq added tooling Something about the dev. infrastructure implementation Internal code, design, archit., tech. etc. change labels Jan 22, 2023
@xparq
Copy link
Owner Author

xparq commented Jan 23, 2023

Well, now that the manual #include "cfg.h" is gone, I've created an even bigger problem...

Even though NMAKE macros aren't automatically passed to the compiler, eventually the supported flags should be (manually, in the makefile), and it's gonna be all too easy to just do e.g.

build DISABLE_HUD=1

which would not trigger rebuilding of affected modules (or anything, for that matter), unlike the previous dependency rule on cfg.h!...

:-/

So, for now, khhm..., we'll need to rely on the even weaker "assurance" of: "please don't use the cfg flags directly on the build command, without first doing a build clean!"... :-o :)

Well, in fact this ugly requirement has already existed for all the other cfg. switches in use from the very beginning, like DEBUG or SFML_DLL, or the stock SFML_STATIC, so in that sense we haven't introduced a new weakness...

Anyway, it's a kinda separate issue that could only be addressed by some sophisticated build control mechanism for detecting changes in the build command line...

@xparq
Copy link
Owner Author

xparq commented Jan 23, 2023

...mmm, well, now that the build is done in proper (busybox sh) shell scripts (-> #17), monitoring the build command line suddenly isn't that much of a sci-fi vision! In fact, I've already started saving the command used for the last build, so a next run could check it, and perform a full rebuild on any changes detected (also in the environment, which is also being saved)...

@xparq
Copy link
Owner Author

xparq commented Jan 23, 2023

OK, wow, it works: a(ny) change in the build command from the previous run would trigger a full rebuild now.

Note:

  • Even cosmetic changes, like build DEBUG=1 SFML_DLL=1 vs. build SFML_DLL=1 DEBUG=1, sorry.
  • build clean is a recognized special case, it triggers no rebuild next time. ;)
  • Passing the cond. compl. flags (like DISABLE_THREADS) from the build cmdline to the compiler -- for which this feature has been added -- is not even supported yet. ;)

@xparq xparq closed this as completed Jan 23, 2023
@xparq xparq added new feature | enhancement User-visible improvement and removed implementation Internal code, design, archit., tech. etc. change new feature | enhancement User-visible improvement labels Jan 23, 2023
@xparq xparq added this to the Gameplay POC milestone Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Something about the dev. infrastructure
Projects
Status: No status
Development

No branches or pull requests

1 participant