595 Commits

Author SHA1 Message Date
Ralph Sennhauser 25f920bdb2 Make cxxtest optional
Remove mocks as they are no longer used making cxxtest effectively
optional.

Fixes: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-08 20:59:45 +02:00
Ralph Sennhauser 6514230330 Allow building without lobby
Commit 6a8366b99a added additional
libraries to the report but didn't consider gloox be optional. Address
this false assumption allowing to build pyrogenesis without lobby
support.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-05-01 08:20:38 +02:00
Daniel Richard G. eab11c247c Add nominal support for LoongArch64 and RISC-V 64
Fixes #6584, #6834
2026-03-23 08:20:10 +01:00
Ralph Sennhauser 8962e066c9 Remove mongoose
Remove sources and references in premake build script as it's no longer
used.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-24 10:45:48 +01:00
Ralph Sennhauser ba4ef61c15 Use cpp-httplib instead of mongoose
Use cpp-httplib for Profiler2 and RLInterface instead of mongoose.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-24 10:45:48 +01:00
Ralph Sennhauser 7e575aa855 Enable use of cpp-httplib
Add cpp-httplib to library build scripts and enable it's use in premake.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-24 10:45:48 +01:00
Ralph Sennhauser eba8439295 Replace boost::filesystem std::filyestem
Bumping the minimum version of macOS to 10.15 for spidermonky [1] also
allows us to use std::filesystem instead of boosts implementation.

[1] f14a98e26f

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-29 09:56:32 +01:00
Ralph Sennhauser 618ffc7bf9 Require boost-1.69, drop boost_system lib
Boost 1.89 no longer offers the deprecated library for boost_system [1], so
drop it from the list of libraries to link against. This effectively
bumps the minimum required boost version to 1.69 [2].

[1] https://github.com/boostorg/system/commit/7a495bb46d7ccd808e4be2a6589260839b0fd3a3
[1] https://github.com/boostorg/system/commit/2fa0a00583a3a791092568d2ade793314181926e

Fixes: #8471
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-29 09:56:32 +01:00
Ralph Sennhauser e97f43b692 Do not require literal message ids in Atlas
In >=wxWidgets-3.3 there is a new static check for literal message
ids[1] so that xgettext would reliable work to extract strings to
translate. As we don't translate Atlas at all nor use xgettext just
disable the check to allow building against >=wxWidgets-3.3.

[1] https://wxwidgets.org/help/msgid-literals/

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-29 09:08:12 +01:00
Ralph Sennhauser 39ea3b6ea5 Use custom runner for tests
The --libdir switch got lost at some point, which is useful for running
tests with a system build.

Further allow to switch the type of output at runtime avoiding an
unnecessary rebuild.

Finally allow to specify an output file, this means there is no need to
redirect stdout which might break the CI in case the tests write
something to stdout like in case of LOGERROR resulting the test result
not being valid xml.

Ref: #7534
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-11 11:34:38 +02:00
Itms 9150c20818 Remove ScriptTypes and ScriptExtraHeaders headers
The first header was used to include the SpiderMonkey JS API at once,
with safeguards and preprocessor defines. Nowadays, SpiderMonkey
provides modular headers allowing us to include what we use, refs #8086.

Some defines have to be moved to compiler options but it is apparently
a mistake from the SM developers:
https://bugzilla.mozilla.org/show_bug.cgi?id=1987876
2025-09-14 13:17:18 +02:00
Ralph Sennhauser e22c5bd05e Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Update premake script to include missing deps and drop various extra
paths for simplification.

Don't always include wx/wx.h via precompiled.h in case PCH is disabled.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-21 14:18:38 +02:00
Itms 7038d87454 Update SpiderMonkey to ESR 128.13
Fixes #7662
2025-08-15 19:43:34 +02:00
Ralph Sennhauser 65d0561d70 Switch to using C++20
Obviously for shiny new features.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:16 +02:00
Ralph Sennhauser 9381ea50df Suppress warnings on old GCC
Current GCC doesn't warn here, so add -Wno-stringop-overflow,
-Wno-attribute-warning, -Wno-restrict and -Wno-array-bounds to the list
of warnings for old GCC.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:16 +02:00
Ralph Sennhauser c12d52b8c3 Define __PRETTY_FUNCTION__ for Windows
mozilla/LinkedList.h uses __PRETTY_FUNCTION__ in debug builds, even when
using MSVC, so just define it to allow building with C++20.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:15 +02:00
Stan 6a8366b99a Add more libraries to the report 2025-08-11 14:00:14 +02:00
Ralph Sennhauser 73ca3d303b Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Add "source" to include path for AtlasUI target to allow for absolute
includes. In the future all but one should be removed.

Drop check for at least boost 1.40.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-09 06:52:41 +02:00
Ralph Sennhauser cc7a165365 Fix includes in source/simulation2
Make include-what-you-use happy with some files in source/simulatation2
and fix what needs to be fixed.

source/simulation2/system/ComponentTest.h uses cxxtest, so add cxxtest
to the deps for simulation2 target.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-08 07:10:11 +02:00
Itms 03fff3572f Use conforming preprocessor with modern MSVC
https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview
2025-08-04 17:35:48 +02:00
Itms ed55976c6c Set pyrogenesis as start project in Visual Studio
Fixes #7218
Refs #3729, #404
2025-08-04 12:39:55 +02:00
Itms 2d6d510ffa Hide compiler warnings from external includes 2025-07-23 10:21:26 +02:00
Itms aca798b318 Adapt the build infrastructure to VS2022 2025-07-23 10:21:25 +02:00
Stan ef69c37f66 Add VS2022 support with the v143 toolset 2025-07-23 09:19:29 +02:00
Ralph Sennhauser 1c9d4508f7 Cleanup of premake pkgconfig module
Split public and private stuff into their own sections and do parsing of
libs in a helper function analog to the parse helper function for
includes and document public funcions using LDoc. Finally make setting
the static flag a function.

Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-17 11:22:05 +02:00
trompetin17 678a33c100 Dap Interface with Spidermonkey debug
Spidermonkey provide a mechanics to debug all comportaments and real
from a different place with JS code this allow us to reuse the current
scriptinterface but addind the new Debugger object definition only for
debugging without change any code from other place like GUI &
simulation.

Debugger Adapter Interface is a protocol that commons IDE implement to
being able for debugging, the concept is to provide sockets connections
with c++ but the Dap implementation in JS that allow us to extend for
more Request / Events that DAP provide.

Because Dap Interface its implemented with JS we need to handle message
in the main thread so we are calling in the main loop before GUI
messages
2025-07-11 11:06:04 -05:00
Ralph Sennhauser c2cc762616 Better handling of PKG_CONFIG_PATH
Allow override PKG_CONFIG_PATH via env, making it possible to easily
inject alternative library builds for testing or bisecting. This was
only possible when the premake script didn't override it which it
unconditionally did on macos.

Also don't expose the variable holding the path directly but offer a
function to append to the path instead.

Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-09 07:48:49 +02:00
Ralph Sennhauser 2b5830e82a Add support for specifying pkg-config via env
For cross compiling there is a need to specify an alternative binary for
pkg-config. It's customary to use the environment variable PKG_CONFIG for
this.

Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-05 09:20:37 +02:00
Ralph Sennhauser a606fbf1a5 Fix headers for XML/XMB
Declare "lib/posix/posix.h" as source for <strings.h>

Make include-what-you-use happy with files in source/ps/{XMB,XML} and
fix what needs to be fixed after including missing compile flags.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-01 07:44:06 +02:00
Ralph Sennhauser d8af7b9416 Improve reporting of build environment for premake
Various environment variables may have an impact on what premake will
do, properly report them in the output and consolidate others.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-29 13:58:14 +02:00
Ralph Sennhauser 4720033ef9 Don't use premake for setting Wextra on Unix
Move -Wall to where the other warnings are enabled so everything is in
one place.

Fixes: #5329
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-21 19:24:12 +02:00
Ralph Sennhauser 24a5b72020 Cleanup compiler warnings declarations
Remove '-Wno-switch' and '-Wno-invalid-offsetof' as they do no longer
suppress any existing warnings. Also group warning disablers together.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-21 19:24:12 +02:00
trompetin17 9a4708cb71 Remove ignore LNK4098 2025-06-17 11:26:06 -05:00
trompetin17 c375d9ba67 Add SDL2 linking configuration to premake 2025-06-17 11:26:03 -05:00
trompetin17 59ff5d912f Add oleaut32 library support and remove unnecessary pragma comment 2025-06-17 11:25:54 -05:00
trompetin17 7ccda26f34 Use cppdialect "C++17" instead of per-action buildoptions
Premake 5.0.0-alpha12 (released in August 2017) introduced the
`cppdialect` directive, which provides a cleaner and more portable way
to specify the C++ standard across compilers and platforms.

Previously, we used manual per-action buildoptions:

filter "action:vs*" buildoptions { "/std:c++17" }
filter "action:not vs*" buildoptions { "-std=c++17" }

This workaround was necessary due to the limitations of older Premake
versions (particularly Premake 4), which lacked built-in support for
setting the C++ language standard.

Now that we're using a newer version of Premake 5, we can simplify this
setup by using:

cppdialect "C++17"

This results in cleaner, more maintainable build scripts with consistent
behavior across toolchains.
2025-06-16 07:35:43 -05:00
Ralph Sennhauser d5f4c812ea Improve CC detection using premake
Before premake 5.0.0-beta3 if --cc wasn't specified the gnu make default
was used unless overridden via env.

Now premake always chooses a compiler sidestepping gnu make choice. So
use the premake pick unless explicitly overridden via CC in env or via
option to premake.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-14 14:13:16 +02:00
Ralph Sennhauser 638c04987e Bump premake to version 5.0.0-beta6
This makes 5.0.0-beta5 the minimally supported version as the gmake2
action was renamed to gmake while gmake was renamed to gmakelegacy. So
from now on gmake action is to be used.

Clear out all old version dependent code.

Fixes: #7789
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-12 20:57:54 +02:00
Ralph Sennhauser f1d577be62 Add semver.lua for use by premake
Also extend it by compairsion operators <= and >=

This will probably also be useful for checking versions of dependencies.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-12 20:57:54 +02:00
Ralph Sennhauser 623e7f7a47 Disable warning LNK4098
Even with lots of effort [1] to isolate the offending library there is
little to be had, as such disable the warning.

[1] https://gitea.wildfiregames.com/0ad/0ad/pulls/7798#issuecomment-119332

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:39 +02:00
Ralph Sennhauser b527e6b870 Fix check for availability of wxWidgets for Win64
In premake we check for wxWidgets on Windows to see if we can build
Atlas, this check wasn't adopted when adding support for Win64.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:38 +02:00
Ralph Sennhauser 58b70719be Disable conversion warnings on Win64
Those warnings aren't enabled for gcc and clang currently either, so
just disable them for msvc as well.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:38 +02:00
Ralph Sennhauser 1fac3461f9 Never strip binaries automatically
Striping is trivial, getting the debug symbols if premake just strips
them silently is a pain tho.

Stripping should optionally be done during install, as we don't have an
install target nor an install-strip target, make it a configure option
which is off by default.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-22 17:32:39 +02:00
Ralph Sennhauser fb470ffa35 Add options for sanitizers to premake5.lua
Given that Valgrind is not yet avx512 ready [1] all the more reason to
have easy access to ASAN and friends for compilers that support it.

This commit adds options for ASAN, TSAN and UBSAN. [2]

[1] https://bugs.kde.org/show_bug.cgi?id=383010
[2] https://github.com/google/sanitizers/wiki

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-21 20:44:19 +02:00
Lancelot de Ferrière 6931aca983 Switch to -fstack-protector-strong
This allows the compiler to skip stack guards on some functions, leading to better performance at limited security expanse.
Examples of such functions include isqrt64 and ComponentManager::PostMessage.
2025-05-06 08:47:30 +02:00
Vladislav Belov 7275f590e9 Fixes wxWidgets on 64bits. 2025-04-26 20:53:24 +02:00
Vladislav Belov f2fcc12859 Restores iconv dependency for collada. 2025-04-26 20:53:20 +02:00
Vladislav Belov 479cdbfc82 Removes unapplied arch_suffix for now. 2025-04-26 20:53:16 +02:00
Vladislav Belov b0160d0ece Adds 64bits support. 2025-04-26 20:53:09 +02:00
Itms 3f3bb8300e Remove ICC compiler support
The ICC compiler has not been used to our knowledge to build the game in
a decade, and is nowadays just a part of LLVM.

Fixes #2994
2025-03-25 12:22:04 +01:00