707 Commits

Author SHA1 Message Date
Pentarctagon
b974423e2e Add optional fuh to campaignd. 2021-03-12 16:12:09 -06:00
Severin Glöckner
37dfcad927 Hide warnings from GCC if compiling with LTO
This adds the change from d643edc (in scons) and 941433e (in cmake) to the linking step as well, but only when using LTO

closes  #5350
2021-01-18 13:53:05 -06:00
Pentarctagon
90946ca262 Update to require C++17.
This then also bumps the minimum GCC version to 7.
2021-01-16 17:05:47 -06:00
Sergey Popov
3933ebab5c
Use coroutines via boost::asio::spawn to improve overall code structure in servers (#5341)
* Convert server_base class to use coroutine instead of handlers

* Rework wesnothd's client login to use coroutine

* Merge 3 player handling functions into a single coroutine

* update cmakelists too

* Implement send_doc_queued in terms of coroutine

* Use brace initialization for making asio buffers

* Implement campaignd's request handling in coroutine

* Brace-initialize entire vector

* Remove old handler based send/receive helpers

* Document coroutine send/receive helpers

* Made coro_send_doc() helper take wml doc by reference

In most cases there is no need to rely on shared pointers to ensure
object lifetime if using coroutines since even when coroutine is
suspended args are still kept alive by its context.

* Document coro_send_file()

* Silence deprecation warning to fix build on earlier versions of boost

* Explicitly check for boost.context to allow linking against static boost libs

* Add boost.coroutine to flatpak manifest

* Port winapi TransmitFile codepath to coroutines

* Exception safety fix

* Add boost.scope_exit to vcpkg

* Fix build with pre-1.66 boost

* Move coro_* helpers into server_base class

Those helpers were in .ipp solely because they were templated on handler
types, this is no longer true after coroutine based rework.

* Make server_base::coro_send_file non-inline

* CleanUp Xcode project

Co-authored-by: Martin Hrubý (hrubymar10) <hrubymar10@gmail.com>
2020-12-30 19:08:34 +03:00
Pentarctagon
0409c22ae2
Update cmake/scons for boost 1.65 minimum. 2020-12-19 01:54:46 -06:00
loonycyborg
85c9988f5e Remove "python_devel" from custom tools too 2020-12-14 15:59:14 +03:00
loonycyborg
4f5a713934 Drop load of unused scons tool "python_devel" 2020-12-14 15:47:41 +03:00
Pentarctagon
058bbf594f
Increase Boost minimum version for BOOST_DATA_TEST_CASE usage. 2020-11-27 13:03:42 -06:00
loonycyborg
a15732aac3 Fix debug build on mingw platform 2020-11-19 19:45:06 +03:00
Iris Morelle
227738cb6f campaignd: Command line processing w/ Boost.program_options
This also adds a few utility switches which people are probably already
familiarized with from the game proper. Most notably this means I don't
need to alter and recompile campaignd any time I want different logging
settings.

There's some functionality commented out in this commit while I figure
out how to wire it into the campaignd server class.
2020-11-09 21:22:00 -03:00
Pentarctagon
dbd230c1d6 Bump minimum gcc requirement to 5.4. 2020-10-23 09:23:12 -05:00
Pentarctagon
467e4312b9 Add support for executing async queries.
Making the logging correctly handle multiple threads writing to the same stream at the same time will be handled separately later.
2020-10-14 19:38:49 -05:00
Steve Cotton
c9511d7ba0
Drop support for the l10n-track file (#4722)
The file only had a run-time effect if it listed any files as "fuzzy", which it
hasn't since the last change in 2015. However, that isn't a reason for removing
it.

The reason for removing it is that it doesn't make sense to automatically mark
images as fuzzy when an image changes, because fuzzy is often much better than
untranslated. This is different to the logic for strings, where a single word
can negate the meaning of a sentence. The decision has to be a manual process,
and at that point it might as well be done with the source-control tool's
delete-file function.

Even considering the previous times that l10n-track was used, I can't see a
scenario where it would be useful.

* Scenario: a screenshot needs to be replaced. In this case the new images are
  going to be screenshots too. If the old images are out of date, better to
  just delete them instead of needing the fuzzy mechanism; either option would
  have the same effect of showing the up-to-date-but-untranslated image.

* Scenario: a map is completely redrawn. This seems unlikely, as a completely redrawn
  image could be added as a new map rather than replacing the old one. Even if
  it does happen, it's probably best to just delete the old --overlay.png
  files.

* Scenario: a new landmark is added to a map. Using the existing overlay file
  is still going to be good, as it means the rest of the map is shown
  translated. There's surely new dialogue in the WML files commenting on this
  new landmark, which would be a good place to say
    # po: Lorem's Ipsum was added to the map on 24 Jan 2020, please add a label to your language's --overlay file.

* Scenario: an old feature is removed from the map. Using the existing overlay
  will have an out-of-date label, and the significance of that would depend on
  how it affects the storyline. This could be significant enough to make
  showing the English labels be a better option than showing the translated
  ones. However, the translated maps could be updated without knowledge of the
  language, so if it's such a significant change then the developer writing the
  new WML should probably do that.

* Scenario: a feature moves slightly on the map. This is an example where the
  l10n-track file has been used, it happened with the Bitter Swamp on the
  bottom-right corner of the title screen. I think it would have been better to
  show the slightly-out-of-date overlay instead of showing the English.

Note about cherry-picking: in the 1.14 branch, the change needs to be applied
to src/picture.cpp instead of src/filesystem.cpp.
2020-08-08 05:07:59 +02:00
Martin Hrubý
9f854e7ce8
Fix SDL2 2.0.12 change in SDL_GetDisplayDPI (#5024)
* Fix SDL2 2.0.12 change in SDL_GetDisplayDPI

Fixes #5019

* Remove signing requirement for DEBUG Xcode builds
2020-08-05 23:44:39 -05:00
Steve Cotton
935fa41379
Final part of the Python 2 removal, including updating install-pytools (#5027)
Update the list of files installed by "scons install-pytools", dropping Python2
versions and adding their Python3 replacements. This doesn't update any
`import` statements, as the tools have already been ported to use the Python3
modules - the scons script was out of date and was still bundling the wrong
versions.

Note for anyone looking at the history - although most of the current
tools have a '3' in the name just to indicate that they're the Python 3 version,
there's a double-meaning to that number in wmlparser3.py's name. There was a
`wmlparser2.py`, where the `2` indicates a redesign of the original.

The data/tools/README.md file was renamed from plain README without being
converted to Markdown format. This commit touches about half of that file;
headings in that half are updated to be Markdown, but to reduce the diff the
other headings aren't updated.
2020-08-05 21:56:12 +02:00
Pentarctagon
f662cad825 Fix the source_lists not being found when using the -Y/--srcdir option. 2020-08-01 03:50:52 -05:00
pentarctagon
7f9eebdf49 Add mariadbpp as a submodule.
This has been added as a submodule for convenience of use, since mariadbpp isn't included in any repositories (linux distros, vcpkg, etc) aside from an Arch AUR.
2020-07-30 13:17:22 -05:00
Pentarctagon
e6e01341f4
Allow specifying c++20. 2020-03-24 14:44:13 -05:00
loonycyborg
a0229523b8 scons: correct open() call for lockfile creation with py3 2020-02-23 02:41:45 +03:00
loonycyborg
9424069298 scons: fix build failure with --config=force 2020-02-09 14:59:38 +03:00
Pentarctagon
48fc3ce58b
-Werror=non-virtual-dtor is not a valid C flag. 2020-01-09 19:34:31 -06:00
loonycyborg
1d80308325 Revert "Remove check for boost.thread from buildsystems since it's not used anymore"
This reverts commit 4c7497722700f40fb9aa807dcbc4b6dfe75457bf.
Explicit linking against boost_thread is required when using boost as
static libraries.
2019-10-25 19:05:28 +03:00
loonycyborg
4aba57b369 scons: fix build with forum_user_handler=true + py3 2019-10-13 19:54:25 +03:00
loonycyborg
4c74977227 Remove check for boost.thread from buildsystems since it's not used anymore 2019-09-28 14:21:04 +03:00
loonycyborg
c7271646b7 Remove config check for gobject
It's not supposed to be required and was mandatory only for particular
pango version(s) due to bug
2019-09-24 12:07:48 +03:00
loonycyborg
7437b3992e Fix issue #4306
prevent a KeyError from missing "have_fortify" env variable
2019-09-02 13:01:26 +03:00
josteph
d76a7ba5d0 Disable -Wunused-lambda-capture on clang.
In a nutshell, capturing a local "const constexpr int foo;" variable
with [foo](){} warns on clang that the program would be valid even if
the square brackets had been left empty, but making them so warns on
VC15.  See
https://stackoverflow.com/questions/52416362/unused-lambda-capture-warning-when-capture-is-actually-used

Disable the warning since explicitly capturing foo is good practice.
2019-06-05 10:31:09 +00:00
loonycyborg
83da28b4aa No longer install .mo files for manual and manpages textdomains
But still build them just to check those po files for errors.
This fixes #3522
2019-03-30 15:40:03 +03:00
loonycyborg
798e809512 Rename appdata and desktop files to contain D-Bus well-known name
as per freedesktop spec
2019-03-27 22:18:01 +03:00
pentarctagon
23375f07df Scons/Macos: Fix for vorbisfile.h not being found. 2019-01-22 18:34:21 -06:00
loonycyborg
d1ed0dccd1 scons: improved error handling for sql client lib and added support for mariadb_config 2019-01-15 14:23:47 +03:00
Jyrki Vesterinen
4147df7efc Explicitly link to GObject (should fix #3840) 2019-01-05 17:31:00 +02:00
pentarctagon
e273684f66 Disable requirements for OpenGL/GLEW. 2018-12-31 13:26:48 -06:00
loonycyborg
5164cd030f Fix #3809 : add option to control use of autorevision to scons 2018-12-27 14:39:31 +03:00
Martin Hrubý (hrubymar10)
ca7f7a2e93 Fix C-Make and Scons builds 2018-10-30 07:16:42 +02:00
Victor Sergienko
8716b8f9d0 #3634, #3557: Port from iOS: Compile with Apple crypto framework instead of OpenSSL. 2018-10-25 23:20:04 -07:00
Pentarctagon
6714ef32e0 Fixes #3518
Certain distro/compiler combinations will apparently warn about not optimizing when _FORTIFY_SOURCE is set.

(cherry-picked from commit 09fcc6b0519d458cbc3e16788576000a8484020b)
2018-10-07 03:24:57 +00:00
loonycyborg
790d13e937 scons: fix strict hardened builds on Gentoo
(cherry-picked from commit 0c3ba36d68754acc2328fd704e1b8df17383e8cd)
2018-10-07 03:23:46 +00:00
josteph
2b2b08431e Revert "Excluded data/test/ from tarball"
This reverts commit c93482560779c0e137d9598b9e7185338afe2b82.

Keep data/test/ in 'scons dist' tarballs to match official tarballs.

(cherry-picked from commit bad6897cbc75225624814b66c9226cf6233e95cf)
2018-10-07 03:22:54 +00:00
josteph
0b633badc5 Fix 'scons dist'
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)
2018-10-07 03:22:53 +00:00
Pentarctagon
e405dc2bff Disabling hardening on Windows due to tdm-gcc's poor support.
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)
2018-10-07 03:22:51 +00:00
Pentarctagon
9e78232e0e Fixup hardening options for Windows.
(cherry-picked from commit 277158222200d4131bbbb385e45a8c6993020b44)
2018-10-07 03:22:43 +00:00
Pentarctagon
bc3ad71f03 Fixup for osx hardening options.
(cherry-picked from commit da6ebc7423ea7b2e8a242ceb44f7bc72f2d08426)
2018-10-07 03:22:37 +00:00
Pentarctagon
6be6646a4e Enabled hardened executables by default.
The result of running "hardening-check wesnoth" now shows:
* Position Independent Executable: yes
* Stack protected: yes
* Fortify Source functions: yes (some protected functions found)
* Read-only relocations: yes
* Immediate binding: yes

(cherry-picked from commit 3290961db2eb00221c94f88f02f77ab640f497a4)
2018-10-07 03:22:36 +00:00
Pentarctagon
39785177e2 Fix stack protection with LTO.
(cherry-picked from commit 5a2d1bc992a4527eeee60f8624880a34d84be57c)
2018-10-07 03:22:33 +00:00
loonycyborg
b3bd32a936 scons: add missing winapi lib dependencies to mingw build
(cherry-picked from commit d96d5c506c2d8c8f47984b2e1d4bf13111e195a2)
2018-10-07 03:22:10 +00:00
loonycyborg
ffb078c119 scons: don't let pkg-config to add prefix on msys2
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)
2018-10-07 03:22:09 +00:00
loonycyborg
f7ad6de3fd Enable ASLR and NX bit security features for mingw builds
(cherry-picked from commit 8b1a5c0dde9e1a36531e6d104737b40531e59cd0)
2018-10-07 03:22:06 +00:00
Charles Dang
848062fde6 Remove the CMake/Scons compile-time check for IEEE 754 compliance
Now handled by a static assertion.

(cherry-picked from commit d9315199ee44dfa8a36e4e01a9332ef21505df3c)
2018-10-07 03:21:31 +00:00
Charles Dang
ee2b9d242e Bump min required Windows version to 7
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)
2018-10-07 03:20:45 +00:00