Re: [hatari-devel] Hatari default / release build types |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: Nicolas Pomarède <npomarede@xxxxxxxxxxxx>, hatari-devel@xxxxxxxxxxxxxxxxxxx, Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Subject: Re: [hatari-devel] Hatari default / release build types
- From: Eero Tamminen <oak@xxxxxxxxxxxxxx>
- Date: Thu, 21 Aug 2025 17:07:47 +0300
- Dkim-filter: OpenDKIM Filter v2.11.0 smtp.dnamail.fi 123032113E0D
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=helsinkinet.fi; s=2025-03; t=1755785268; bh=Sp6Qn+UlCVLmzHm/nC7gTsmEQgUr1Jd50fQMi0qXgeI=; h=Date:Subject:To:References:From:In-Reply-To:From; b=H9xSqP06xiLm3n3mWSZ/0yXiwwnAySkam6u5w98TQZA3YdAukMOJ7I3xFoxqT8xgl 2iVNovdnfT2juZUMXqg8rIAE0onc0LkMX9xIeTlrxNTZ+CnP7QuNvzAGH6Kaead402 i3iNlh5q0sxRZy2HL5KIm+LcmW13cJrrK7AAO9dkpOk6a3YTQDMlv3IuBv2SCrfbo0 TW6SMIVD18ATEnXAVhTrGPMFEBxypA0P1OCS26zORvW32b5praEuLYeuBmwVv4relA 0WgL42gw5kjQYBiVIAOSdYLyl34yjObr0K2YDLUFotu+wh0Z3sOzqBIUeld7wUutD/ QWJJpxQfP1ISA==
Hi,
On 21.8.2025 16.18, Nicolas Pomarède wrote:
Le 21/08/2025 à 15:04, Eero Tamminen a écrit :
It may be better to default to (optimized) debug build with asserts
enabled, and only do release builds with asserts disabled[2], but
that's up to Nicolas.
(I don't know how Nicolas does releases.)
For release, I use "./configure" or "./configure --cross-compile-
win64_64". I must admit I rarely add "--enable-debug" flag to "./
configure" in my usual "pipeline"
I had forgotten that there was a "configure" wrapper script...
But if we want to spot possible assert errors, maybe the automated
builds on framagit could have "--enable-debug" ? This way people who
download build's artefact (such as zip archive for windows) would see them.
That maps to CMake "Debug" build type:
https://github.com/hatari/hatari/blob/main/configure#L53
I did not find from current CMake documentation even what the current
build types (are supposed to) map to:
https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
But when testing my (older) CMake 3.25.1 version, the standard values
seem to correspond to:
- Debug: "-g" [1]
- MinSizeRel: "-Os -DNDEBUG"
- RelWithDebInfo: "-O2 -g -DNDEBUG"
- Release: "-O3 -DNDEBUG"
Meaning that debug builds are no good because:
- Resulting binary is really slow
- Compiler misses most of warnings
(as code analysis is done by its optimization passes)
And none of the others are good either. One would need to create an
extra build type to CMakeLists.txt, for example:
- RelDebug: "O3 -g"
And make that default instead of "Release":
https://github.com/hatari/hatari/blob/main/CMakeLists.txt#L6
- Eero
[1] Hatari appears to add "-O" to "Debug" type, so it's not completely
awful:
https://github.com/hatari/hatari/blob/main/CMakeLists.txt#L304