375 Commits

Author SHA1 Message Date
Charles Dang
c414056b8d
Fixed vcpkg build issue for port update to 2.6.1 (#6958) 2022-08-12 19:02:02 -04:00
Wedge009
9fccea96ea SDL: Increase requirement to 2.0.10.
SDL_RenderCopyF and SDL_RenderCopyExF are only available from SDL 2.0.10 onwards.
2022-06-20 11:51:41 -05:00
Tommy
57f32eaa9f Add options to scons and cmake to force coloured compiled output.
In CMake this is the FORCE_COLOR_OUTPUT option. In SCons this is the
force_color option. They both pass -fdiagnostics-color=always to gcc,
or -fcolor-diagnostics to clang.

This is useful when building with Ninja, or running piped CI tools.
2022-06-10 16:45:38 +12:00
Ryan Schmidt
853f2147ef macOS: Link with AppKit and Foundation frameworks 2022-06-08 17:27:12 -05:00
Andrei BENCSIK
1838041a37 Add FindSDL2 to simplify main CML
* the FindSDL2 module forwards to CONFIG mode first
* if that fails (eg. no -version.cmake or config not even present) it
uses pkg-config
* exports SDL2::SDL2 and SDL2::SDL2main as targets
* fix missing IMPORTED_LOCATION for other build types in Vorbisfile
2022-05-11 09:18:14 -05:00
Pentarctagon
0aa8dc3c6c Have cmake also execute the conftests. 2022-05-03 18:10:46 -05:00
Charles Dang
82d03090c6 Specify /Zc:__cplusplus for VS 2022-03-17 10:02:52 -04:00
Pentarctagon
9689554aa9 Make MSVC fail when C files generate warnings. 2022-03-12 16:32:46 -06:00
Pentarctagon
d32cfb88c4 Update instructions and add warning to scons/cmake. 2022-03-09 15:01:37 -06:00
Charles Dang
2801040956 Readline should not be mandatory 2022-01-14 13:32:37 -05:00
Pentarctagon
c48ab6bb55
Check for pango and readline with cmake.
Fixes #6444
2022-01-13 13:45:24 -06:00
Pentarctagon
d78fb5990f
SDL2 mixer and image don't have cmake versions. 2021-12-19 19:42:42 -06:00
Pentarctagon
d0539b7581
Re-add version checks for windows. 2021-12-19 19:05:27 -06:00
Pentarctagon
d516420c1f Alternate way to find SDL2. 2021-12-19 17:51:47 -06:00
Pentarctagon
df2803fd43 Use import target for fontconfig. 2021-12-19 17:51:47 -06:00
Daniel Diefenthaler
82b54920d6 Remove sdl2-config script from cmake as discussed in #6352 2021-12-12 13:03:22 -06:00
Daniel Diefenthaler
eda8d05b2f Fix MINGW build on Windows by splitting MSVC and WIN32 2021-12-12 13:03:22 -06:00
Pentarctagon
67d6e1b677
Add rc file to VS+cmake configuration. 2021-06-28 09:13:02 -05:00
Steve Cotton
bf3f22a030 Make the profiler configurable in CMake's UI 2021-06-09 11:21:54 -05:00
Pentarctagon
f4e6e1861f
Add -fno-omit-frame-pointer for perf. 2021-06-09 00:59:43 -05:00
Pentarctagon
4b35be4bb0 Combine profile build into release build. 2021-06-08 21:23:38 -05:00
Pentarctagon
d8fe705f43
Explicitly tell VS to use utf8. 2021-05-30 22:09:58 -05:00
Pentarctagon
d3c8a09c0c
Remove history option - it's already optional. 2021-05-22 16:11:42 -05:00
Pentarctagon
e53f688c22
Expressions in else()/endif() haven't been required for years. 2021-05-22 15:45:14 -05:00
Pentarctagon
370ec24ed7
Fixup cmake for macos. 2021-05-22 14:59:21 -05:00
loonycyborg
e5ac78527f
Merge branch 'tls_wip' 2021-05-18 11:31:51 +03:00
Pentarctagon
edfa4ac345 Update how the icu libraries are linked. 2021-05-13 19:48:36 -05:00
Pentarctagon
4030e572ea
Fix autorevision target not working on win32 or when disabled. 2021-05-12 23:44:14 -05:00
Pentarctagon
24a5ea9a8a
Remove unused systemd check from cmake. 2021-05-12 18:40:14 -05:00
loonycyborg
56f9138de7
Merge branch 'master' into tls_wip 2021-05-12 21:39:21 +03:00
Pentarctagon
24d546df63 Some more cmake cleanups.
Also moved boost and openssl to using the "import targets" (ie: https://cmake.org/cmake/help/latest/module/FindBoost.html#imported-targets) which are apparently the modern way to use cmake. Many of the other libraries don't support that however, and SDL is only fully(?) supported using this as of cmake 3.19.
2021-05-07 15:53:21 -05:00
Pentarctagon
986e2eb998
Fixup spaces > tabs. 2021-05-07 11:25:10 -05:00
Pentarctagon
b95d72f9c1 Use cmake to create VS project files.
Due to an upstream change in vcpkg that breaks the simple integration previously available with `vcpkg integrate install`, building using that setup method is no longer possible. In order to work correctly, cmake must instead be used to generate the VS project files, since that is able to integrate with vcpkg, since vcpkg also uses cmake to build all the library dependencies.

An additional benefit of this is that it will no longer be necessary to separately update the VS project files since it will read the same source_lists files as cmake (on linux) and scons do.

This also enables running the WML unit tests on Windows with this in order to confirm that a valid wesnoth.exe is in fact being generated as well as fixes building the boost unit tests.

The warning level for both release and debug builds are now at level three, the remaining warnings have been fixed, and therefore strict builds have been enabled - any warning will now cause the build to fail, just like for the linux jobs.

Known issues:
* The boost unit tests don't actually run successfully - they fail on CI at least with an exit code on 201 - however I don't know if this is a real problem or just a problem with running headless on CI.
* The debug build doesn't quite work since the executables are built against the non-debug dlls but cmake copies over the debug dlls into the output directory. For now this can be worked around by copying the release dlls into the debug directory.
* The instructions in INSTALL.md are not very good since I don't use Windows and thus can't write anything more detailed. Ideally someone who uses Windows can add more detailed step by step instructions at some point.

Fixes #5741
2021-05-07 00:02:02 -05:00
loonycyborg
1c4c5d4d1e
Drop compatibility for boost 1.65 2021-05-06 17:09:13 +03:00
loonycyborg
7f1f1cecdf
Fix cmake build 2021-05-06 17:09:13 +03:00
Grzegorz Halat
c0db7311bb Bump SDL2 version to 2.0.8 2021-04-27 04:53:27 -04:00
Pentarctagon
c1fad387c1
Add the high contrast icons to cmake for installation.
Fixes #5685
2021-04-07 17:10:45 -05:00
Iris Morelle
2dfdc0061d Remove SDL_ttf wrapper API
This removes the build-time dependencies on SDL_ttf and FriBidi,
alongside the SDL_ttf wrappers, the SDL_ttf text surface class, the
SDL_ttf render cache, and the SDL_ttf (de)initialization code.
2021-03-13 13:51:47 -03: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
Pentarctagon
ba89526cec
Put these checks in the same place. 2020-12-04 17:21:59 -06:00
Charles Dang
6adc9ab76f Bump SDL_Image dependency to 2.0.2 and enable jpg screenshots unconditionally 2020-12-05 09:30:17 +11:00
Pentarctagon
058bbf594f
Increase Boost minimum version for BOOST_DATA_TEST_CASE usage. 2020-11-27 13:03:42 -06:00
Alexey Sokolov
60564a959a Don't override default AR and RANLIB without LTO
`ar` is not always available, and when it is, it's not always correct, e.g. during cross-compilation.

https://bugs.gentoo.org/732096
2020-10-24 17:31:49 -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
Pentarctagon
113a4e0913 Use mariadbpp rather than the mysql C connector.
Reasoning being:
* The result_set and other APIs are nicer to use.
* We use mariadb on our server rather than mysql, so this would minimize the chance of any incompatibilities.
* The mysql C++ connector 1.1 isn't compatible with with c++17 (https://stackoverflow.com/q/47284705).
2020-07-30 13:17:22 -05:00
laikh
c5a1ac03e8 Fix MINGW (with MSYS2) build in Windows 2020-01-31 09:44:09 -06:00