Skip to content

Build system upgrade#279

Merged
tmp64 merged 33 commits intomasterfrom
feature/build-system
Jun 28, 2025
Merged

Build system upgrade#279
tmp64 merged 33 commits intomasterfrom
feature/build-system

Conversation

@tmp64
Copy link
Copy Markdown
Owner

@tmp64 tmp64 commented Jun 18, 2025

  1. Replace pre-built binaries with vcpkg packages
  2. Replace complicated Python scripts with CMake's built-in install functionality
  3. Generate final release ZIPs on GitHub Actions
  4. Generate AMXX offsets automatically on every build
  5. Write new build instructions: https://github.com/tmp64/BugfixedHL-Rebased/wiki/Compiling-guide

Closes #232

@tmp64 tmp64 self-assigned this Jun 18, 2025
@tmp64 tmp64 force-pushed the feature/build-system branch 11 times, most recently from d8665dd to bf4c042 Compare June 18, 2025 14:53
@tmp64 tmp64 force-pushed the feature/build-system branch 3 times, most recently from 63bbb0b to 5f48a1e Compare June 21, 2025 05:38
@tmp64 tmp64 force-pushed the feature/build-system branch from 5f48a1e to ecb7bfd Compare June 21, 2025 05:45
@tmp64 tmp64 marked this pull request as ready for review June 21, 2025 07:12
@tmp64
Copy link
Copy Markdown
Owner Author

tmp64 commented Jun 21, 2025

@rtxa Can you check if you can build this branch using the new instruction?

@rtxa
Copy link
Copy Markdown
Contributor

rtxa commented Jun 22, 2025

Well, I have moved to VSCode since then and it didn't require too much configuration on my side, only to have installed VS 2022 with desktop C++ workload and VSCode extensions for C++ and CMake and I was good to go (I did all the HUD thing in there).

Probably the new build system is better but I'm not getting it to compile when using VSCode. Do I need to have vcpkg installed before hand? I think requisites/prerequisites should mention that to be clear. Seems like I need to have installed Ninja because I'm getting this error even with vcpkg configured.

imagen

Can all this be downloaded before hand when doing CMake configuration? I think that the fewer things the developer has to install or configure, the better.

@tmp64
Copy link
Copy Markdown
Owner Author

tmp64 commented Jun 22, 2025

Thanks for testing. Regarding your errors: vcpkg is working properly ("All requested installations completed successfully" in the log). But CMake can't find Ninja.

I updated the guide and added sections explaining Ninja and VS Code. I use clangd and CodeLLDB extensions instead of C/C++ extension because, in my experience, they work better (on Windows with MINGW and on Linux), so I used them in the guide. Let me know if they work correctly on Windows.

@rtxa
Copy link
Copy Markdown
Contributor

rtxa commented Jun 22, 2025

Sorry but I'm still not getting it to compile, something related to the target, I already renamed CMakeUserPresets.json and I'm using user-debug
imagen

@tmp64
Copy link
Copy Markdown
Owner Author

tmp64 commented Jun 23, 2025

I updated CMakeUserPresets.example.json and added user-debug-vscode to make it simpler. And I fixed the error.

@rtxa
Copy link
Copy Markdown
Contributor

rtxa commented Jun 23, 2025

In CMakeUserPresets.json, you missed naming user-debug in configurePreset the same as in name, otherwise it would not show any user preset.
imagen

Anyway, some other problems arise:

When using user-debug-vscode
imagen

When using user-debug-vs2022
imagen

Perhaps we can arrange a time where I would share my screen to you on Discord? So we can get to the root of the problem quickly.

@tmp64
Copy link
Copy Markdown
Owner Author

tmp64 commented Jun 24, 2025

I finally figured it out. Turns out you don't even need Ninja, VSCode can use "Visual Studio 17 2022" generator. And you don't need clangd and CodeLLDB in that case. I updated the docs, CMakeUserPresets.example.json, .vscode/launch.example.json and .vscode/config.example.json. It should work now.

@rtxa
Copy link
Copy Markdown
Contributor

rtxa commented Jun 24, 2025

Good, now it works!

Question: With the previous workflow, I could select if I want to build for Debug, Release, etc. How can I do this now? Debug variant as default worries me because it triggers asserts when doing normal playing.
imagen

@tmp64 tmp64 force-pushed the feature/build-system branch 3 times, most recently from e4a6764 to 208f5c8 Compare June 25, 2025 13:30
@tmp64 tmp64 force-pushed the feature/build-system branch from 208f5c8 to 47dc7ab Compare June 25, 2025 13:51
@tmp64
Copy link
Copy Markdown
Owner Author

tmp64 commented Jun 25, 2025

I updated the presets.

  1. Split Windows and Linux presets into different includes. Now there is only one user preset instead of separate user-windows and user-linux presets.
  2. Added separate user build presets: user-debug and user-release. I added a section about this to the docs.

@tmp64 tmp64 merged commit a47028d into master Jun 28, 2025
12 checks passed
@tmp64 tmp64 deleted the feature/build-system branch June 28, 2025 07:08
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.

Add build instructions for newcorners

2 participants