1
0
forked from mirrors/0ad
Commit Graph

817 Commits

Author SHA1 Message Date
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 707abee34d Don't export HOSTTYPE in update-workspace.sh
Exporting HOSTTYPE prevents cross compilation as HOSTTYPE is used to
override target host arch instead of detecting it from chosen compiler.
This then results in the wrong arch specific source files to be
included. So just don't set it by default and let it to the user to set
it if he so chooses.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-02 12:58:46 +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
Itms 406565f3c4 New appdata entry for A27.1
Fixes #7986
2025-06-20 11:48:53 +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 58219b974c Fix trailing whitespace and add pre-commit hook
Some have their editor configured to remove trailing whitespace and
editing such a file would "fix" it, adding an unrelated change.

Fix whitespace violations excluding third party libs and generated files
like glad or patches.

Enable pre-commit hook trailing-whitespace to enforce it in the future.

Fixes: #8016
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-15 20:08:48 +02: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 9dfc638b80 Add Win64 pipeline support
Extends the current Windows pipeline to also build for AMD64. While at
it use a matrix build.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:39 +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 ef7f1d336c Move errorlist.pl from build to tools
The target file is checked in into vcs so this tool isn't used during
build and as such better lives in source/tools.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:42:44 +02:00
Ralph Sennhauser 4463e9480a Remove leftovers of arclint
All linting was ported to pre-commit or gitea workflows, the only thing
left is an adapter to output to Phabricator which is no longer in use.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 13:25:24 +02:00
Ralph Sennhauser 02e15da51b Add eslint pre-commit hook
This replaces the old arclint eslint setup 1:1 rule wise, only porting
the configuration to a format recent eslint can read.

Further remove the arclint setup as it is no longer of use.

Thanks to Stan for reviewing all needed fixes to Javascript code to
allow for adding this without compromises.

Fixes: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-30 17:30:25 +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
Ralph Sennhauser 382b732515 Update test_root path in update-workspace
After 8d993b9250 the generated test_root.cpp is no longer in the source
tree but generated in workspace. The issue of there bing no source is
still valid, so update the path.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-19 17:43:21 +02:00
Itms 51ab929926 Implement pipeline for generating patch releases
The new patch-release pipeline takes a git branch originating from a
release tag, applies the changes since the tag onto the nightly build of
the release, and rebuilds the Windows binary.

All resulting changes are sent to the bundling pipeline which builds for
macOS and creates the tarballs and installers.

There will be two instances of the bundles pipeline: the main one will
keep tracking the main branch and providing biweekly bundles of the next
release, while a new patched-bundles pipeline will be manually used to
generate patch releases.
2025-05-14 10:49:02 +02:00
Stan 934ca601d7 Add a Jenkinsfile linter 2025-05-08 19:50:21 +02:00
Itms 1adab34511 Generate signatures and hashes in the bundles job 2025-05-08 19:08:56 +02:00
Itms 5b7feb360e Fix nightly pipeline syntax mistake in 2659efdb38 2025-05-07 12:49:51 +02:00
Itms 2659efdb38 Speed up nightly build generation
New files in the repository are naively added using `svn add --force`
which adds all unversioned files according to the documentation.

However, this iterates through the entire repository and takes about 12
minutes. Using `svn status` and parsing through the results only takes a
couple seconds.
2025-05-06 22:02:21 +02:00
Itms b58ea2698e Fix bug in nightly pipeline on spaces in filenames
The call to `svn delete` on deleted files does not work if filenames
contain spaces. This happens in particular when we fix spaces in
filenames, as the pipeline doesn't understand file renames.
2025-05-06 22:02:01 +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
fiftydinar 26acb9df22 Add StartupWMClass to desktop file
This fixes the potential edge-cases of icon not showing, like in Gnome's dash for example.
2025-04-29 15:18:41 +02:00
Ralph Sennhauser 19d568d506 Add linter to check for copyright year
This replaces the previous arclint linter for checking the copyright
year in license headers with a gitea workflow job.

As the date of last edit might differ from commit date due to reverts
the copyright linter is run against a base commit.

The python script doing the heavy lifting is written by @Dunedan.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Co-Authored-by: Dunedan <dunedan@phoenitydawn.de>
2025-04-28 16:14:34 +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
Ralph Sennhauser e2511cfbac Propagate error for failed update-workspace.bat
If running premake fails during update workspace then update workspace
needs to exit with an error as well so the CI will actually report an
error.

According to Itms testing with powershell passing the original error is
unreliable, so just exit with one.

Fixes: #7642
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-04-22 19:34:11 +02:00
Ralph Sennhauser 6da4e606d4 Add cppcheck workflow
Add a workflow for linting and add a cppcheck job.

The job is using cppcheck provided by package manager. Existing errors
are suppressed to get going with CI linting, ideally tho the suppression
list would be empty. Some of the suppressed errors are only found with
more recent cppcheck than what is available in the runner.

Also remove old arclint cppcheck setup.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-30 18:06:01 +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
Ralph Sennhauser 9ef1bff6aa Disable dangling-pointer warning whith gcc-12
This is only an issue with gcc-12 to gcc-14, supress the warning on the
CI.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:42 +01:00
Ralph Sennhauser a2fdc3427e Remove unused Dockerfiles
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:42 +01:00
Ralph Sennhauser 84f626d2b5 Use Debian 12 in Linux pipeline
Use the single Debian 12 container image and inject CC, CXX and LDFLAGS
instead.

Further do the lfs checkout on the agent instead of inside the container
avoiding full rebuilds due to version mismatch.

Then split the debug and release builds using separate workspaces and
record warnings by build preventing gcc warnings leaking into clang
warnings.

Based on zero warning policy and incremental builds using a reference
build doesn't make sense. Removing that we can also drop an additional
generic workspace.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:42 +01:00
Ralph Sennhauser 0481f13fff Add Debian 12 Dockerfile
Debian 12 (bookworm) will soon be oldstable.

Most importantly this version comes with cmake-3.25, which will allow us
to use SDL3, cpp-httplib, fcollada fork and possibly others in the
future.

This also comes with gcc-12 and clang-14 by default, both implementing
almost all of c++17 and most of c++20.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:42 +01:00
Ralph Sennhauser 71f78eb2ce Use JOBS var instead of hardcoding on Windows
Don't hardcode the number of parallel jobs in Windows based pipelines
but allow setting the desired number in the environment.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-09 11:14:16 +01:00
Ralph Sennhauser 2a0817d930 Add JOBS support to Unix build pipelines
Allow the number of concurrent build jobs in Unix build pipelines be
specified in the environment via the JOBS variable.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-09 11:14:16 +01:00
Itms b831b1f559 Fix Jenkins pipelines on Linux agent
The Linux agent now runs Docker in rootless mode for additional
security. Operations inside containers must be run as root to match the
underprivileged user running Docker.
2025-03-01 22:08:50 +01:00
Ralph Sennhauser 6738fdbab7 Remove root check in update-workspace.sh
If you run as root then created files will be owned by root, this is
expected behaviour and not messing with permissions as stated in the
error message.

Running in a container the root user may map to the user starting the
container while all other users would need mapping to be able to work
with a bind mounted a checkout.

Further Debian patches out the root check to be able to build on their
builder.

Given the above remove the check.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-01 18:36:44 +01:00