Move setting up the environment for macOS Homebrew earlier in
Options.cmake, as well as finding pkgconfig.
Update gcc/clang toolchain to not pass a gcc-specific option to clang.
Add faudio to list of brew packages to get in installdeps.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Pass -Wno-deprecated-copy only for C++, gcc gives a warning for C.
Pass -Wno-unused-command-line-argument for clang only, gcc gives a
warning about it.
Add a failsafe for gcc/clang static link flags if libstdc++ or
libpthread is not available as a static library.
Move link command adjustment script invocations to src/wx, the target is
not yet defined in the toolchain.
Add -lws2_32 to the end of the link command for gcc on Windows because
of link order issues with those symbols.
Disable LTO for gcc on Windows, as it is broken.
Don't install extra-cmake-modules on MINGW32, that package is not
available there.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add clang when installing for CLANG* environments in MSYS2 because this
package is no longer included by default in the set of packages we
install.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Change sys-devel to dev-build to match current gentoo package naming
convention. Also add --ask flag to prompt for confirmation before
merging packages.
Signed-off-by: Mohamad Issawi <68k@segv.moe>
Add libglu-devel to the list of dependencies for solus in installdeps,
this is required for wxWidgets and OpenGL.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Update installdeps for Debian to find the new version wx packages, but
still use the -gtk3 variants on very old versions of Debian.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
It seems the GitHub Actions macOS image has a conflicting python in
/usr/local, invoke:
brew -v install python
brew link --overwrite python
, before installing dependencies.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
For Fedora ./installdeps support, install either wxGTK-devel or
wxGTK3-devel, depending on which has a higher version.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
* Remove the custom handling for pre-3.1.4 builds on Windows since
both the mingw and msvc builds now use 3.2.
* Remove wxDPIChangedEvent handling, since this triggers a resize,
which has the same effect.
* Implement main/WinMain ourselves, rather than relying on wxWidgets
macros. This allows us to initialize the console earlier in the
process.
* Add an explicit dependency on the manifest file to trigger a link
when it is modified.
The actual package name for libsdl2 is libsdl2-2.0-0 not libsdl2-2.0 in
Debian/Ubuntu and probably others, and this only worked by accident
due to apt doing a regex search for packages.
Get the correct package for the latest version of libsdl2 from
apt-cache.
Also fix the other lib package searches via apt-cache to return the
latest version.
Resolve#882.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Thanks to @ZachBacon in 1e0eea3c (recording: fix ffmpeg5 compat, 2022-03-18) the build works with ffmpeg5 from brew.
Update build instructions from installdeps to not disable ffmpeg
anymore.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Replace wxmac obsolete package with wxwidgets.
Use brew install -f (--force) to install all deps.
Unlink and relink gettext, wxwidgets and ffmpeg for every invocation.
Add -DENABLE_FFMPEG=FALSE to cmake invocation instructions because brew
has ffmpeg 5 and we cannot build with it yet.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Update installdeps and cmake to use windres from gcc binutils from
MINGW64 on MSYS2 CLANG64, because llvm-rc doesn't work sometimes.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Update installdeps to support CLANG64/CLANG32 MSYS2 targets.
cmake:
Set POLICY CMP0060 to NEW to not convert full lib paths, this is the
default.
Stop disabling ffmpeg on WIN32+i686.
On MSYS2+clang add windows import libs to CMAKE_PREFIX_PATH.
For static builds on MSYS2 append full paths for static libs for tiff,
jbig and lzma to FFMPEG_LIBRARIES.
Add -Wno-unused-command-line-argument to all CFLAGS/CXXFLAGS so that
clang does not warn about gcc-specific options.
Enable -march/-mtune optimizations by default instead of only for
UPSTREAM_RELEASE.
Update find_wx_util() to search suffixes for WIN32 and add the "static"
suffix for static builds.
Remove all linker flags from wxWidgets_LIBRARIES and translate all wx*
libs as well as jpeg, tiff, jbig lzma and expat to full .a paths for
static builds.
Disable strutil tests on MSYS2+clang, currently does not build.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
I don't know if this is right or not, but I am running an Arch system and tried running `./installdeps` and nothing happened. So I went into the script and figured that it got stuck in the `elif [ -f /etc/os-release ];` block. This file exists on Arch as well, so the block is executed, but arch is not listed in the `case`, so the script exited without doing anything. And it's only checking for pacman after that, so it never ran `arch_installdeps`.
Don't know if this is the 100% correct fix, but it's working for me now and should also catch cases like that in the future.
Add a `default.nix` with the list of dependencies.
Detect NixOS in installdeps and display the `nix-shell` command to
build.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Default to latest, which is bionic, for earlier repositories, match all
intermediate release code names.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Assume an archlinux-like distribution based on the existence of
`/usr/bin/pacman` as the last test.
- Fix#710.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Make sure git is part of the base package list for Win32 builds.
Move the `git submodule update` out of `check_cross()` and into the
Win32 build sections.
Allow it to fail, in case the user is not using a git clone, the cmake
checks will produce an error if the subtree does not exist.
This fixes the problem with the git submodule update failing because git
is not installed yet.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Followup on 513af13d which replaces the use of libpng with the stb_image
headers.
- Remove the use of libpng in cmake.
- Remove libpng from list of vcpkg dependencies.
- Add libpng to list of wxwidgets link libraries when using vcpkg, since
it is no longer linked directly. This is necessary for static builds.
- Remove libpng from all package lists in installdeps.
- Remove libpng-dev from the debian control file.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
For some versions of the mxe ubuntu repositories, the compiler/ccache
packages have a bug where the compiler a broken symlink to ccache.
Make sure the expected symlink to ccache exists.
Add pre-build instructions to add /usr/lib/mxe/usr/bin to the PATH.
Amend the PATH for the mxe travis jobs as well.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Use the 3.x wxwidgets mingw package in installdeps.
Add the win64 alias to installdeps for 64 bit mingw builds, like the
win32 alias for 32 bit mingw builds.
Check CROSS_ARCH in Architecture.cmake, set by our mingw toolchains.
Disable LTO by default for all mingw builds, not just amd64, because it
is unfortunately broken on i686 as well now.
Search for heuristically the most appropriate wx-config and set
wxWidgets_CONFIG_EXECUTABLE accordingly in the mingw toolchains.
Refactor the mingw toolchains somewhat, put common code into a common
file, add static toolchains.
For static toolchains, also search for a static zlib and set ZLIB_ROOT.
Change installdeps instructions to use ninja instead of make. Add ninja
to all target dependencies where it was missing, this may be incorrect
in a couple of the rarely used targets, if this is the case the affected
users are free to open an issue.
Also start using ninja on travis instead of make, except for libretro
which uses a GNU Makefile.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add support for the --no-openal and --no-ffmpeg command line options to
installdeps.
Implement them fully or partially depending on the code for that
distribution.
This will help with adding this variant of the build to the travis CI.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Detect and prefer the -gtk3 variants of the libwxgtk3.0 packages on
distros like kali-rolling.
Tested to work on newest kali-rolling and trusty.
Fix#564.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Include xenial and bionic in the travis build matrix, alongside trusty.
In `installdeps` check for the existance of `libswresample-dev` before
installing it because trusty does not have it, it uses libav instead of
ffmpeg. For this reason, ffmpeg is not built on trusty.
Turn off the `xvfb-run` test on bionic and xenial because it fails for
some reason.
Use `-DENABLE_FFMPEG=OFF` for xenial because the ffmpeg code currently
fails to compile with that version.
Stop trying to cache `/usr/local` for the mac build, storing the build
archive takes longer than installing the homebrew packages.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix the cmake ffmpeg detection and make it not print the detection
messages twice.
Add `-D__STDC_FORMAT_MACROS` to compiler flags, some versions of ffmpeg
require this.
Redefine `static_assert(x)` to the `static_assert(x, msg)` form in
`xbrz.cpp`. This is a C++17 feature and some versions of gcc wrongly set
`__cpp_static_assert` even though they do not support it.
Also we want to stick to C++11 for the time being, until there is
consensus to support a newer a version.
For that reason, change the MSVC flag `/std:c++latest` to `/std:c++11`
as well.
Remove `-DENABLE_OPENAL=ON` and `-DENABLE_LINK=ON` from travis config,
as these are now automatic.
In `installdeps` remove the hacks for supporting the `https://` apt url
for mxe and use an `http://` url instead. This works perfectly on Ubuntu
14 (trusty).
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
In cmake detect if the dependencies for link (sfml), recording (ffmpeg)
and openal are installed and default the features to `ON` if they are,
otherwise to `OFF`.
This simplifies the cmake usage.
Update the default column in the `README.md` table to `AUTO` as well.
Remove the cmake options from `installdeps` instructions, since they are
auto-detected.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
The default Mac OS environment on travis no longer has brew bottle
support, so jobs time out.
Add the `osx_image` key to specify Mac OS 10.14 and Xcode 10.2.1.
Also try to re-enable link support using SFML.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Currently the SFML brew does not compile in the travis mac environment,
so do not install SFML via `./installdeps` for brew if `$TRAVIS` is set,
and add `-DENABLE_LINK=OFF` to cmake options for the mac travis job.
Also try to cache the `/usr/local` directory, to make the brew installs
faster, if this even works.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Make some changes to support out-of-the-box builds on FreeBSD:
- set cmake OpenGL type to `LEGACY`, the new `GLVND` type produces
unusable binaries on FreeBSD
- on FreeBSD add -I/usr/local/include to compiler flags, why this is
necessary I don't know
- look for llvm tools such as `llvm-ar` in `/usr/local/llvm-devel/bin`,
LTO works
- improve the `find_wx_util()` cmake function to handle `wx-config`
scripts named in the form e.g. `wxgtk3u-3.1-config`
- add FreeBSD support to `installdeps`
- make some minor changes to included headers based on macros such as
`__FreeBSD__` to compile on FreeBSD, including adding a `BSD.h` header
with some defines for e.g. `fseeko64`
- move the cmake X11 detection to before the wx compile tests, because
otherwise the extra compile flags for the wx tests make the X11 tests
fail
- make some minor changes to fix wx 2.8 compatibilty again, we don't
actually use 2.8 for FreeBSD but I was testing it
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Do not install the wxGTK-devel package on centos, as the wxGTK3-devel
package does come with a wxrc named wxrc-3.0.
This is a followup on 2097b5aa.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add support for RHEL/centos to installdeps. There is no SFML package.
Add some string compatibility stuff so that everything builds on wx 2.8
unicode builds.
TODO: add travis slaves for 2.8, with and without unicode
Disable the game frame spacer code on 2.8 because it does not work (the
frame does not expand.)
cmake improvements:
- set ENABLE_LTO=OFF for Debug builds by default
- set ENABLE_LINK=OFF if SFML cannot be found and continue
- use better logic for finding wx utilities wx-config and wxrc
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Closes#395Closes#297
The mxe package server key has been removed from the keyservers, allow
apt-key to fail and add `--allow-unauthenticated` to the apt-get
options.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
`stretch` mxe binaries are failing due to missing libraries like
`libssl.so.1.1`, try to use the `trusty` repo instead.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Disable the `--help` test for now, for some reason the exit code is 255,
something is still not quite working there.
Update installdeps to force a partial upgrade from trusty to xenial on
travis to get a newer version of libcurl-gnutls, which is necessary to
use the mxe package server.
Fix mxe package server repo url.
Add `mirror.mxe.cc` to list of apt hostnames to ignore SSL errors for.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>