Commit Graph

73 Commits

Author SHA1 Message Date
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
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
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
a9b6cda77b Reorder CMakeLists commands by topic 2026-03-17 08:18:50 +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
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
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
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
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
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
ISSOtm
3d35457eeb Avoid showing the "more warnings" option for MSVC 2026-03-16 20:23:47 -04:00
ISSOtm
aea39ec8c8 Log with sanitizers are enabled under CMake
This can help bring attention to the MSVC difference (no UBSan there)
2026-03-16 20:23:47 -04:00
ISSOtm
9293068370 Properly specify our max CMake version supported
Also bump it to the version I just tested it with
2026-03-16 20:23:47 -04:00
Rangi
8ab4602ae5 Add -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG to develop builds (#1859) 2025-11-16 13:11:08 -05:00
Rangi
7c6f778ae7 Take care of miscellaneous commented TODOs (#1676) 2025-05-02 16:44:12 -04:00
Rangi42
c841672059 Don't use tabs for alignment 2025-03-31 19:13:46 -04:00
Rangi
03452c6d4f Allow git describe to get the version for FreeBSD and Cygwin in CI (#1640)
* Specify `safe.directory`
* Fetch tags
* Fetch all commits
2025-01-29 19:57:15 -05:00
Rangi
8363f25d47 Enable more sanitizers in make develop (#1588)
- `-fsanitize=undefined` encompasses multiple checks we were specifying

- "detect_leaks=1" for `__asan_default_options` checks for memory leaks
  (except for with macOS clang++, which does not support LSan)

- `-fsanitize=float-divide-by-zero` is an extra UBSan check
  (and reveals a UB bug to fix with fixed-point `DIV` and `LOG`)
2024-12-31 10:02:20 +01:00
Sylvie
c1b85554a8 Document obsolete syntax in rgbasm-old(5) (#1571) 2024-12-10 12:34:37 -05:00
Sylvie
b877c81c32 Use C++-style casts (#1576) 2024-12-09 21:56:54 -05:00
JL2210
e623aeb85d Make tests work with CTest (#1539)
Adds option to disable non-free tests
2024-10-15 19:26:17 -04:00
Sylvie
d5ded84501 Move definition of _POSIX_C_SOURCE to include/platform.hpp (#1524) 2024-09-29 23:53:15 +02:00
Rangi42
0adff57e2c Sync warning flags between Makefile and CMakeLists.txt 2024-08-08 16:02:11 -04:00
ISSOtm
0c0923ac16 Disable some spurious MSVC warnings
Not that it will de-clutter our CI logs very much, but eh, you know.
2024-03-28 01:33:21 +01:00
Sylvie
54d6a22d19 Build with pedantically standard C++ (#1309)
* Remove array designators (not standard C++)

* Build with pedantically standard C++
2024-02-23 16:46:53 -05:00
Eldred Habert
efaef7039e Make sure to detect Git info from *our* Git repo (#1303) 2024-02-18 17:08:30 -05:00
Eldred Habert
fd78a9ae83 Port linkerscript parser to Bison (#1266)
Notable side effects:
* Use the standard-conformant MSVC preproc
* Add test for linker script INCLUDE
* Improve wording of placement conflict errors
* Fix errors from not newline-terminated files
* Teach checkdiff about the linker script doc
* Call linker script "commands" "directives" instead

---------

Co-authored-by: Rangi42 <remy.oukaour+rangi42@gmail.com>
2023-12-11 02:29:37 +01:00
Rangi
f3dbf17b78 AUTHORS and more copyright comments are redundant with CONTRIBUTORS.rst (#1227) 2023-11-07 17:57:59 -05:00
Rangi
1e70e703a7 Build everything as C++ (#1176) 2023-11-07 21:45:56 +01:00
ISSOtm
28737d5778 Enable GLIBCXX_ASSERTIONS in make develop
Not sure it's very portable, but this is only the dev config
2022-10-12 01:23:37 +02:00
ISSOtm
3cfe7800c7 Make randtilegen and rgbgfx_test compile with MSVC 2022-07-02 17:04:17 +02:00
ISSOtm
cbf6fadcdb Add RGBGFX tests 2022-07-02 17:04:17 +02:00
ISSOtm
8c62e80c18 Reimplement basic RGBGFX features in C++
Currently missing from the old version:
- `-f` ("fixing" the input image to be indexed)
- `-m` (the code for detecting mirrored tiles is missing, but all of the
        "plumbing" is otherwise there)
- `-C`
- `-d`
- `-x` (though I need to check the exact functionality the old one has)
- Also the man page is still a draft and needs to be fleshed out

More planned features are not implemented yet either:
- Explicit palette spec
- Better error messages, also error "images"
- Better 8x16 support, as well as other "dedup unit" sizes
- Support for arbitrary number of palettes & colors per palette
- Other output formats (for example, a "full" palette map for "streaming"
  use cases like gb-open-world)
- Quantization?

Some things may also be bugged:
- Transparency support
- Tile offsets (not exposed yet)
- Tile counts per bank (not exposed yet)

...and performance remains to be checked.
We need to set up some tests, honestly.
2022-07-02 17:04:17 +02:00
ISSOtm
ec25b4ac0e Disable -Winline
<@aaaaaa123456789> I mean, `-Winline -Werror` is the "make my builds fail at random for no reason" switch
2022-06-04 11:14:07 +02:00
ISSOtm
7e94ecbfe6 Move all man pages to a separate directory
Simplifies processing all around, and makes more sense
2022-05-15 13:34:35 +02:00
ISSOtm
a4ead0c25f Freshen version number when building with CMake
Fixes #979
2022-03-11 09:21:08 +01:00