3341 Commits

Author SHA1 Message Date
Rangi42
919a5dba89 Correct CONTRIBUTING.md to accurately describe test/fetch-test-deps.sh 2026-03-23 11:13:23 -04:00
Eldred Habert
d9932b9031 Always clone deps with --depth=1 (#1908) 2026-03-23 11:02:29 -04:00
Rangi
66e521e9e5 Factor out common error-handling functions for lexing numbers of different bases (#1888) 2026-03-19 15:32:25 -04:00
ISSOtm
b8e425b41d Avoid passing irrelevant flags to our deps 2026-03-19 20:30:12 +01:00
ISSOtm
6b0658fb59 Cache library deps on Windows
Besides the immediate performance improvement, reducing
the frequency of downloads should make spurious
failures (network, rate-limiting...) less bothersome.
2026-03-19 20:30:12 +01:00
ISSOtm
91fdfcd179 Specify MSVC architecture using presets
Shortens CI command lines slightly,
and documents the requirement.
2026-03-19 20:30:12 +01:00
ISSOtm
5abebcf61f Specify build type implicitly
Again, shortening the CMake command line.
Unfortunately, this doesn't apply to `--install`.
2026-03-19 20:30:12 +01:00
ISSOtm
145473d9bd Use develop preset on FreeBSD
Leak detection is not supported, so we have to disable it.
2026-03-19 20:30:12 +01:00
ISSOtm
2fb64816a9 Indicate more clearly that LTO is not used in debug mode
This has made me worried once or twice
2026-03-19 20:30:12 +01:00
ISSOtm
7cf330e3f9 Enable CMake parallelism in a central place
Shortening command lines is useful
2026-03-19 20:30:12 +01:00
ISSOtm
2e66515096 Invoke CTest directly
This allows passing it arguments directly, like `--verbose` here
(which is more appropriate for CI use).
2026-03-19 20:30:12 +01:00
ISSOtm
c93f377bfb Enable colour diagnostics in CI
At least for CMake.
2026-03-19 20:30:12 +01:00
ISSOtm
d6d1844d60 Seek lib deps via CMake FetchContent
`FetchContent` respects existing installs, and downloads and compiles the libs
if they aren't found.
This is admittedly a little finicky, since this ignores the usual `Find*`
modules provided by CMake, requiring a bit of glue on our side.

But, one upside is that this moves that logic from our CI into the build system,
which can thus benefit other downstream users.
This also opens the door to some improvements in upcoming commits.

Doing this with Bison turned out to be much more painful, however, due to
`FindBISON` providing the specific `bison_target` command; thus, it remains
installed externally, so that it can be picked up by `FindBISON`.

This also bumps our CMake version requirement slightly, though it's
possible that older versions keep working, or could be supported with small patches;
however, our CI doesn't provide anything below 3.31, so we can't check.
2026-03-19 20:30:12 +01:00
ISSOtm
fd38a3dbc4 Add CMake and YAML files to EditorConfig
Since we use a different style for those
2026-03-19 20:30:12 +01:00
ISSOtm
60d58723aa Use a modern GNU Make for CMake CI on macOS
We can assume that CMake handles old Make correctly,
but we'd like to benefit from improvements
like output batching.
2026-03-19 20:30:12 +01:00
ISSOtm
a9b6cda77b Reorder CMakeLists commands by topic 2026-03-17 08:18:50 +01:00
ISSOtm
091452d591 Remove call to configuring version file
Missed in 5c4ca36c5a
2026-03-17 05:28:23 +01:00
ISSOtm
df1d909853 Improve documentation of CMake bin output dir 2026-03-17 05:27:39 +01:00
ISSOtm
fb4e08ce71 Tidy up CMake sanitizer flags
Set the flags in the build itself instead of trying to override the cache
(this was an artifact of when I didn't understand the CMake variable model),
which avoids them being duplicated on each re-configuration.

Also remove `-g`, since it's defined by the build type by default
(we leave it up to the user to choose Debug or RelWithDebInfo).
2026-03-16 20:23:47 -04:00
ISSOtm
7244b9d17e Silence the same warning as in the Makefile
As requested by https://github.com/gbdev/rgbds/pull/1899#discussion_r2943039607
2026-03-16 20:23:47 -04:00
ISSOtm
5c4ca36c5a Harmonise passing build version
Avoid running some configure step, instead pass it as a define like the Makefile
2026-03-16 20:23:47 -04:00
ISSOtm
292c297518 Sync Windows release steps with new CI 2026-03-16 20:23:47 -04:00
ISSOtm
a5bb431d47 Fix debug-mode building on Windows
ASan seems broken, and the debug-mode DLL names are different
2026-03-16 20:23:47 -04:00
ISSOtm
10e1c9d187 Avoid passing sanitizer options to MSVC linker
Apparently it does not support them
2026-03-16 20:23:47 -04:00
ISSOtm
d8722b6705 Use imported targets for linking to libpng
This massively simplifies the process lol
2026-03-16 20:23:47 -04:00
ISSOtm
2d0ac7eeb0 Disable exceptions and RTTI when building with CMake 2026-03-16 20:23:47 -04:00
ISSOtm
d5033a2bd9 Handle project version better in CMake
Parse the version from `version.hpp`, and check its consistency with
the Git tag to help catch release blunders.
2026-03-16 20:23:47 -04:00
ISSOtm
45fff0fd58 Harmonise naming of CMake test knobs
Also reorganise the file a little
2026-03-16 20:23:47 -04:00
ISSOtm
c963c7b1c7 Simplify include directory directive 2026-03-16 20:23:47 -04:00
ISSOtm
63c7835e71 Stop overriding the binaries' install dir
This is equivalent to the default, except the default accepts being overridden
2026-03-16 20:23:47 -04:00
ISSOtm
35af3185eb Enable LTO even for multi-config CMake generators
See https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
for the rationale.
2026-03-16 20:23:47 -04:00
ISSOtm
db9d9c7653 Install our man pages in a more standard-configurable manner 2026-03-16 20:23:47 -04:00
ISSOtm
9e5a9107f2 Remove enforced CTest verbosity
It can be controlled from the command line instead, and that's better
2026-03-16 20:23:47 -04:00
ISSOtm
275fcf8fcf Improve CMake-in-tree fatal error message 2026-03-16 20:23:47 -04:00
ISSOtm
bc37b0ece6 Skip trying to link to libm explicitly
This doesn't seem to be necessary: it is automatically linked to,
at least on my machine. \*shrugs\*
2026-03-16 20:23:47 -04:00
ISSOtm
e63ce24e48 Add a CMake preset for maintainer flags 2026-03-16 20:23:47 -04:00
ISSOtm
d524884799 Run CI tests using CTest when possible 2026-03-16 20:23:47 -04:00
ISSOtm
34e1f8dcc5 Remove useless MSVC flag
CMake only passes a single file at a time anyway
2026-03-16 20:23:47 -04:00
ISSOtm
cd64de9323 Remove a warning triggered by MSVC's own standard library
No longer triggers now, so we can remove our workaround for their breakage.
2026-03-16 20:23:47 -04:00
ISSOtm
a01b805e4b Remove an outdated comment 2026-03-16 20:23:47 -04:00
ISSOtm
a139cbc744 Refactor the source file listing
Make the common files into an object library, which lets them
be compiled only once (saving 41 build steps)
This also lends itself well to removing the per-program loop,
which simplifies the code somewhat.
2026-03-16 20:23:47 -04:00
ISSOtm
06e5386d93 Move FreeBSD deps install to common CI script
Making the OS filter in test driver consistent as per
https://github.com/gbdev/rgbds/pull/1899#discussion_r2942998932
2026-03-16 20:23:47 -04:00
ISSOtm
37f57a752f Print a more graceful error message for run-tests.sh --unk 2026-03-16 20:23:47 -04:00
ISSOtm
670bdf2095 Document run-tests.sh --os
Also switch to heredoc syntax for ease of editing
2026-03-16 20:23:47 -04:00
ISSOtm
6270f654a1 Make sure to init all variables involved in CMake tests 2026-03-16 20:23:47 -04:00
ISSOtm
676db46c01 Add a few details to the project() call
We can use them now that the minimum version has been bumped
2026-03-16 20:23:47 -04:00
ISSOtm
8979b54281 Ignore a CMake file that is not intended to be checked in 2026-03-16 20:23:47 -04:00
ISSOtm
a6f03530ed Correct minimum CMake version required
Turns out the status messages use 3.17
2026-03-16 20:23:47 -04:00
ISSOtm
b56b56a695 Reformat some long warning-flag-setting lines 2026-03-16 20:23:47 -04:00
ISSOtm
dc5fc9f327 Remove obsolete CMake version comment 2026-03-16 20:23:47 -04:00