382 Commits

Author SHA1 Message Date
Pentarctagon
8bc5d7b72f
address codeql issue (#7832) 2023-08-20 19:45:47 -05:00
Pentarctagon
7ce1bf9f7d Check for correct openssl version. 2023-08-18 09:50:41 -05:00
Ivo Julca
4d2cb1ce7f Build: Update scripts for .pot, .po files to support Python files
- Rewrites some of the commands to use Python.
- Also implements wmlxgettext --force-po, similar to xgettext.
2023-06-14 09:58:56 +02:00
Pentarctagon
9315079389 Add curl-based functionality to download files from a URL.
This is a complement to #7416 where it replaces opening the replay's download URL in a browser with directly downloading it into the player's save folder.
2023-03-15 14:49:16 -05:00
Steve Cotton
405e315f1e Add a CMake and SCons flag for GLIBCXX_ASSERTIONS without GLIBCXX_DEBUG
Turning GLIBCXX_ASSERTIONS adds some bounds checks, such as checking
in std::string::operator[]. It's a subset of the checks that GLIBCXX_DEBUG
adds, but has the advantage that it doesn't require a rebuild of the Boost
libraries.

None of the CI builds enable these assertions, as they slow down the code
which makes the unit tests time out.
2023-03-03 10:44:22 +01:00
Charles Dang
8e6f507910 Bump vcpkg baseline, update for new SDL_image config 2022-11-28 00:33:43 -05:00
Pentarctagon
f3ca89d5f4 Set correct pango required version in cmake/scons. 2022-09-09 10:28:15 -05:00
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