Skip to content

Conversation

@user1-github
Copy link
Contributor

@user1-github user1-github commented Nov 30, 2025

I've noticed the conditional was originally added a long time ago to the primary compile flags in #117 for respecting user settings, but this causes a few problems:

The first one is that these days most environments have some set of default flags, some of which potentially hurt performance like -fno-omit-frame-pointer and others. They also include the more conservative -O2 optimization set. As a result, users compiling the game may not realise that the primary flags (-O3 -fomit-frame-pointer -ffast-math -fno-finite-math-only) that ensure the best performance will get replaced by the ones from the environment, which will result in subpar performance (I tested and verified it myself).

In Red Eclipse Flathub version, we have to explicitly set -O3 -fomit-frame-pointer -ffast-math -fno-finite-math-only in the Flatpak manifest in order to make sure only the upstream specified flags are used and it's currently the only way for us to do that. This is not ideal, because it means we have to constantly monitor the makefile for any changes in the primary flags. There is an option to set CXXFLAGS= '' in order to clear the default environment flags, but that still ignores the primary makefile flags and it only utilizes the secondary ones (-Wall -fsigned-char -fno-exceptions ...) which are set in the next line.
Other environments with a default set of flags will experience the same issue if they want to use the upstream makefile flags exclusively.

That's why I think setting a conditional to the primary flags is a bad solution and it should be removed. If someone wants to force their own flags instead of the upstream ones, they can still do it without needing a conditional, like setting
export CXXFLAGS="-02 -g ..." before running make.

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.

1 participant