riksweeney / edgar

A 2D platform game with a persistent world. When Edgar's father fails to return home after venturing out one dark and stormy night, Edgar fears the worst: he has been captured by the evil sorcerer who lives in a fortress beyond the forbidden swamp.
https://www.parallelrealities.co.uk/games/edgar
116 stars 28 forks source link

Fix binary stripping #61

Closed lumidify closed 1 year ago

lumidify commented 1 year ago

When compiling with clang, there are lots of warnings clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]. This appears to be because the -s option for stripping the binary is actually a link-time option (both in clang and gcc - gcc just doesn't warn about it). As far as I can tell, the option currently doesn't have any effect (this can be verified by checking that the final binary still contains all the symbols). This pull request moves the -s option to LDFLAGS and only adds it in release mode (otherwise, debug symbols would be stripped). After this change, the symbols are properly stripped from the binary in release mode. I have not tested this with any compilers other than clang and gcc, though, so I don't know how those would react to the change.