calref / cboe

Classic Blades of Exile
http://spiderwebforums.ipbhost.com/index.php?/forum/12-blades-of-exile/
Other
167 stars 41 forks source link

Change -o0 to -O0 #344

Closed NQNStudios closed 1 month ago

NQNStudios commented 1 year ago

I've only tested this change on Linux. Does CI run a debug build? If so, it'll determine whether this change works on other platforms.

Fixes #343

CelticMinstrel commented 1 year ago

Does CI run a debug build?

That's… a good question? I think it doesn't, but presumably you can examine the CI scripts to check.

The change shouldn't affect Windows+Cl, and if it works on Linux it should be fine on both Mac+scons and Windows+MinGW (though the latter isn't yet officially supported). And it obviously has no effect on non-scons builds.

…although, looking at that file you edited, it's probably incorrect for a Windows+Cl build both before and after this change, as Cl does not understand the -g or -O flags at all. Unless scons is able to automatically correct for that somehow.

NQNStudios commented 1 year ago

Looking at the github action logs, here's what I learned:

Should I figure out what flag the Windows+Cl compiler uses for debug and add it in an if windows statement? I might not be able to test scons on Windows, I haven't gotten it working locally yet.

CelticMinstrel commented 1 year ago

Was win-scons even enabled in the actions until very recently?

It's been enabled for quite awhile. I'm pretty sure it was even working when the MSVC build was failing.

Should I figure out what flag the Windows+Cl compiler uses for debug and add it in an if windows statement?

It might be nice but I think it's not crucial to have. Note that "if windows" is not enough – you need to check for the msvc toolchain as well. If it were Windows+MinGW then that uses GCC and the flags are the same as other platforms.

I might not be able to test scons on Windows, I haven't gotten it working locally yet.

That might be because of the vcvarsall.bat nonsense to bring the build tools into %PATH%. The easiest way to make that work if building manually would probably be to use a "Visual Studio Command Prompt", which basically sets that all up for you so that all the build tools are already in %PATH%. It can be launched from inside Visual Studio from one of the menus. There may also be a shortcut to launch one without opening Visual Studio.

But we should manually test debug=true for scons on every platform

scons currently doesn't work at all for me on the Mac, though I think that's only because I have SFML installed in framework format and it expects bare dynamic libraries. I suppose I could try installing those (even though it's kinda redundant) and see if it works that way. It would be kind of nice if this was a configurable option in scons but actually making that so doesn't feel worthwhile when no-one is even using scons on a Mac.

CelticMinstrel commented 1 year ago

By the way, I believe the MSVC Cl flags equivalent to -g -O0 would be /Zi /Od.