Commit Graph

389 Commits

Author SHA1 Message Date
pentarctagon
40ef4dbbf4 Revert "Bump min Boost version to 1.82 (#9317)"
This reverts commit 7c60174ad1.
2024-09-08 10:25:45 -05:00
Charles Dang
7c60174ad1
Bump min Boost version to 1.82 (#9317) 2024-09-08 00:58:32 -04:00
Pentarctagon
9548f4c7b5
Hardware unit submerge effect using SDL_RenderGeometry. (#8687)
Original code from mesilliac in #6826. Made a separate PR for this since the relevant code moved to an entirely separate file and trying to "properly" fix the merge conflicts resulting from that isn't worth the time.
2024-04-11 12:58:56 -05:00
Rafael Fillipe Silva
dafb78cdf1 implement super cycle detection for the schema self validator
The super tag dependency forms a directed graph. Boost Graph's depth first search implementation was used with a back edge detector to find the cycles.

This is a preparation for enumerating all keys that a tag can use, including the keys from the super tags. If cycles aren't handled, it is impossible to validate mandatory keys without entering an infinite loop.
2024-02-26 10:12:43 -06:00
P. J. McDermott
69fa5c199e Add CMake and SCons options to use system Lua 5.4 C++
scons/lua.py makes use of the vestigial luadir option from commit
e94dcecf17.

Like FindLua.cmake, scons/lua.py searches for the Lua headers and
library, instead of using pkg-config like the old scons/lua.py (removed
in commit 9929d3ca1c) did, because even though distributions typically
provide .pc files for Lua, upstream Lua doesn't.  It's likely that all
distributions that compile Lua as a C++ library will also provide .pc
files, but this check doesn't rely on that (just as the CMake module
doesn't).

Unfortunately, SCons.Conftest.CheckLib() prints up to eight messages
like "Checking for C++ library lua54-c++... no" until a working library
name is found.

Also conditionally include system Lua headers in src/lua/*.h and update
documentation in src/modules/lua_README.md, src/wesnoth_lua_config.h,
and src/wesnoth_lua_config.md.  The two lines about "The primary commit,
after replacing the sources," in src/wesnoth_lua_config.md don't make
sense since the instructions were updated for submodule Lua in commit
d32cfb88c4 and make even less sense now with preceding commits for
updating CMake modules.
2024-02-11 23:21:15 -06:00
Steve Cotton
cfb28fbfb5 Use -Wno-dangling-reference when building with GCC-13
Version 13 of GCC added the -Wdangling-reference option, however
due to false positives it had to be moved from -Wall to -Wextra.
Discussion about its status in GCC-14 is in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110075

The warning is for C++ only and the flag will generate a warning
when compiling C files if the flag is set in Scon's CCFLAGS.

The docs don't explain exactly what triggers the warning, but here's the
explanation from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106393#c1
> The warning works by checking if a reference is initialized with a function
> that returns a reference, and at least one parameter of the function is a
> reference that is bound to a temporary. It assumes that such a function
> actually returns one of its arguments! ... suppress the warning when we've
> seen the definition of the function and we can say that it can return a
> variable with static storage duration.

Consistent with that, we're getting warnings on functions of the form
find(container, const std::string&). All of the things triggering it
seem to be false positives:

* Calls to find_widget<...>.
* Calls to theme::get_theme_config.
* Calls to race::gender_value.
* In src/actions/attack.cpp, any `attacker->attacks()[i]`.
    Although there's an iterator in there, the eventual reference
    is to a member of the array, not the iterator.
* In src/gui/dialogs/unit_advance.cpp, `cfg.child_range("...").back()`
    That returns an object indirectly owned by cfg.

We'd like the other warnings of -Wextra, so turn off -Wdangling-reference.
2024-02-05 20:03:40 +01:00
P. J. McDermott
0d99cd045f Revert "Check for correct openssl version."
This reverts commits 7ce1bf9f7d and c6a2dc9317.

OpenSSL >= 3.0 was required (but only when building with CMake) so that
src/preferences/credentials.cpp could use EVP_EncryptInit_ex2() (commit
a880f01a31), but that change was reverted (commit 83ab05532a), all
within three hours.
2024-01-28 11:27:43 -06:00
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