Certain distro/compiler combinations will apparently warn about not optimizing when _FORTIFY_SOURCE is set.
(cherry-picked from commit 09fcc6b0519d458cbc3e16788576000a8484020b)
This reverts commit c93482560779c0e137d9598b9e7185338afe2b82.
Keep data/test/ in 'scons dist' tarballs to match official tarballs.
(cherry-picked from commit bad6897cbc75225624814b66c9226cf6233e95cf)
This makes 'scons dist' work, although the resulting tarballs are not
yet identical to cmake tarballs.
Remove awk usage made obsolete by the git transition
(7f85fa000c836c27cfe9d829db3b0e8aaeb49821).
Update src/revision.hpp reference to use src/revision.h. The former
name is unused since at least 7625b1e079b470119d72ea67ce955104f464e4b8.
(cherry-picked from commit 0ee485415710288d27f7b766e48fe7451b03c9a4)
As per sigurd's trial and error: RELRO's options are unknown entirely and -fstack-protector-strong results in compile errors. Building with just PIE and _FORTIFY_SOURCE enabled does then compile, but results in a broken executable.
(cherry-picked from commit c9541176776aeb676e99f1804d123552430582ee)
This is workaround for windows style path confusing scons if they appear
in CPPATH etc. Paths without prefix still happen to be valid and they
start with "/", not "c:".
(cherry-picked from commit b347bc70b163a572751b7ac72f23e472c3ac9238)
Technically, all this code should work on Vista, (including the recent switch to using
SHGetKnownFolderPath), but since we're also considering requiring Visual Studio 2017
for building, we need Windows 7.
(cherry-picked from commit 2a585118d8b6c4b37d0ff9446a72ca20419ff7f7)
Use of this feature with GCC in particular causes the stack to become marked as executable.
(cherry-picked from commit 96b43a9af4ec76882afe6924e9c3dafb5b8beac5)
Scons OpenGL/GLEW test taken mostly verbatim from 3e2eba22a96cb2c6c69ee5109059b806f22a372f
(cherry-picked from commit 5e36a90039ddde3625690ace5259198e1932a7f8)
Otherwise, if we build with sanitizers and optimizations, the sanitizer stacktraces can become quite hard to read.
(cherry-picked from commit 29089a47369c32d4eabb93ac7f5b33222c047670)
Travis now also makes use of this to set the optimization level for the -O0 builds, rather than extra_flags_*. This additionally fixes an issue where using -O0 in the release build with LTO resulted in the individual *.o files being compiled with -O0, but LTO then still linked with release's default -O3.
(cherry-picked from commit 63ff641662d4192401a49f9a002d7872000a3f02)
After some discussion, we concluded that this code was unmaintained, not even used in
some places (display.cpp, units/frame.cpp), leaving the only area that really used it
at all the image surface cache. Considering there was never really a conclusive benchmark
of its benefits and because said surface cache will be used a lot less going forward,
we're just removing it and simplifying everything for everyone.
Closes#1260 since it's now irrelevant.
(cherry-picked from commit 3792612fb759942e6eb5de51364c2cca4ed16b40)
Commit dfc42e8a8dd550ca04ae16e2d2d7ebffbba0bc21 removed said code since
Wesnoth can use IMG_SavePNG() from SDL_image 2.0 instead. However, the
author left the build-time configuration options intact, and also part
of the necessary code for CMake to link Wesnoth against libpng.
Note that this change also eliminates an unnecessary direct link-time
dependency on libpng when using both CMake and SCons.
(cherry-picked from commit 4799ca05fe40838c41814433780d0464d9b8f071)
This reverts commit cdf9b465c668648721c4638ce117da130ad36284.
May this noise be my vengeance.
(cherry-picked from commit f6a128579ad6d94cc7c8a57bebd1fc2bb0f735a0)
This reverts commit 44f567c6a3252992907d320e38bb93ab14ff7359.
Enabling LTO by default causes too many problems, inclusing build
failures for @doofus-01 and link failures with Clang for me.
Players and packagers can still amanually enable LTO in case it
works fine for them.
The detection for when Clang is used was incorrect, resulting in GCC-only
parameter being passed to Clang.
In addition, at least on my system LTO+Clang caused linking errors even
with that fixed. As an emergency fix, I completely disabled LTO for Clang.
LTO for Windows is disabled for now, as TDM-GCC does not work well with it.
LTO for Travis is also disabled, due to the extra time linking with LTO takes.
This moves all the warnings flags from the strict build to the regular build, except for -Werror. This means that the only difference between strict builds and non-strict builds will be if warnings are turned into errors.