Certain distro/compiler combinations will apparently warn about not optimizing when _FORTIFY_SOURCE is set.
(cherry-picked from commit 09fcc6b0519d458cbc3e16788576000a8484020b)
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)
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)
commit 3effecd added an "if" block in CMakeLists with a variable that
does not exist ("NLS"). This breaks running translation updates for
every cmake user. Changed the variable to the existing "ENABLE_NLS".
@Pentarctagon I don't know if the travis script has to be adjusted as
well. Please test.
(cherry-picked from commit 64fe3988d87b61e40199297d710c035d85dedd49)
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)
Adds the CXX_STD variable which can be set. Currently defaults to 14. This also now makes cmake honor the CXXSTD env variable set on travis.
(cherry-picked from commit 983045718aa13a2b7b1b45bb37baa76a88a1d47e)
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.
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.