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

WIP: external_deps, use CMake when packages do, update versions #1433

Draft
wants to merge 69 commits into
base: master
Choose a base branch
from

Conversation

illwieckz
Copy link
Member

@illwieckz illwieckz commented Nov 11, 2024

This is WIP, current external_deps build status:

system deps build static build test
linux-amd64-default ✅️ ✅️ ✅️
linux-arm64-default ✅️
linux-i686-default ✅️ ✅️ ✅️
linux-armhf-default ✅️
windows-amd64-mingw ✅️ N/A ✅️
windows-i686-mingw ✅️ Buster ❌️ GLEW Noble N/A ✅️
windows-amd64-msvc ✅️
windows-i686-msvc ✅️
macos-amd64-default ✅️ N/A ✅️

I haven't tested if the engine builds and runs properly with those. WIP

What this PR does:

  • Use CMake when packages provide a CMakeLists.txt file
  • Factorize much code
  • Make a nice list of package base url, so it's easy to click all of them and check for new versions
  • Update package versions
  • Update package build options

@illwieckz
Copy link
Member Author

When building newer Opus on Debian buster (the distro we use for our releases), I get this: […]

Telling Opus to not assume more than SSE2 fixed that.

@illwieckz
Copy link
Member Author

So, the MinGW GLEW and MSVC Vorbis errors are the only ones.

@illwieckz
Copy link
Member Author

So the Vorbis build error is actually a bug:

I added a workaround.

@illwieckz
Copy link
Member Author

I don't get why I get that GLEW build error with MinGW, the build function has not been modified, and the version has not been updated.

@illwieckz
Copy link
Member Author

I don't get why I get that GLEW build error with MinGW, the build function has not been modified, and the version has not been updated.

Also the code is the same for both windows-amd64-msvc, windows-i686-msvc, windows-amd64-mingw and windows-i686-mingw, but it only fails with windows-i686-mingw… That doesn't make sense.

@illwieckz
Copy link
Member Author

So, I don't know what happened, now I don't reproduce the MinGW GLEW error… Maybe I gorgot to prune the prefix folder and some stray files messed-up…

@illwieckz
Copy link
Member Author

Ah, I now see something: I reproduce the bug with MinGW from Ubuntu 24.04 Noble, not with MinGW from Debian 10 Buster. So, since we produce release builds with Debian Buster, it's not a big problem, but it should be fixed for the future…

@slipher
Copy link
Member

slipher commented Nov 11, 2024

What's the purpose of migrating things to build with CMake?

@illwieckz
Copy link
Member Author

So with this a static build for linux-amd64 completes and runs.

@slipher
Copy link
Member

slipher commented Nov 16, 2024

So with this a static build for linux-amd64 completes and runs.

Huh? It worked before, so I have a hard time believing that is suddenly necessary to change the build system of 8 packages.

@illwieckz
Copy link
Member Author

I never said this is a response to “What's the purpose of migrating things to build with CMake?”, I'm just reporting the status of me testing that branch. I said in first post:

I haven't tested if the engine builds and runs properly with those.

So now I'm running those tests.

@DolceTriade
Copy link
Contributor

What's the motivation behind this change?

@illwieckz
Copy link
Member Author

illwieckz commented Nov 18, 2024

Purposes:

  1. Update packages to latest versions,
  2. Update packages build options for latest versions (for example curl adds protocols, so we have to disable them),
  3. Mutualize cmake/configure code as generic reused functions and avoid copy/paste boilerplate,
  4. Rely on CMake as much as possible to make it easy to spot new CMake build options to disable them and other changes.

When using configure it is hard to compare the list of already used options with the new options, one has to read configure's whole output and compare with what's currently used. On the contrary with cmake, one just runs the existing command, then go to the build dir and run ccmake, and see what's enabled and should not, and report the difference to the build script.

@illwieckz illwieckz force-pushed the illwieckz/deps branch 2 times, most recently from ac1c6e1 to 5653846 Compare November 18, 2024 01:26
@illwieckz
Copy link
Member Author

windows-amd64-mingw and windows-i686-mingw engine both build and run.

@illwieckz
Copy link
Member Author

For some reasons libpng now provides png.framework on macOS and the engine build looks for it instead of the static library (even with USE_STATIC_LIBS), so I made generic the copy of any *.framework from deps. I don't know if we prefer static linking or dynamic linking on macOS, static linking allows further LTO optimizations so we may prefer that.

@illwieckz
Copy link
Member Author

linux-i686-default and macos-amd64-default engine both build and run.

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.

3 participants