Commit Graph

33 Commits

Author SHA1 Message Date
Rafael Kitover 890f560553
Switch to C++17 for GUI.
Adjust compiler flags to use `-std=gnu++17` for gcc/clang instead of
`-std=gnu++11` and `/std:c++17` for msvc.

Remove Ubuntu trusty job from travis (it's too old.)

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-28 12:09:54 +00:00
Rafael Kitover 9dd2932436
Disable nostl build on travis as well for now.
It is failing in the same way as the utf8 build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-29 23:25:21 +00:00
Rafael Kitover 12193dcbae
Disable utf8 build on travis for now.
To be fixed later.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-29 22:23:21 +00:00
Rafael Kitover 81c88227fa Add Catch2 unit testing framework + some tests.
Add the Catch2 headers to third_party/include/catch2.

Add Catch.cmake and CatchAddTests.cmake to cmake/.

Add unit tests src/wx/tests/strutils.cpp using Catch2 to test
src/wx/strutils.cpp.

Make some code changes to strutils.cpp to make the tests pass.

See src/wx/tests/CMakeLists.txt for how to set up unit test files; they
plug into the normal CTest mechanism in cmake.

The test binaries are written to the tests/ subdirectory of the build
directory.

Building the tests and enabling the CTest support can be turned off by
passing -DBUILD_TESTING=OFF to cmake, the default is ON, this is the
standard mechanism.

Start running ctest on travis and appveyor.

Move stb to third_party/include where Catch2 is now as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-10 13:43:48 +00:00
Rafael Kitover 7fbb017cd5
Update macOS/Xcode version to latest for travis.
Use "osx_image: xcode12" which is Xcode 12.0 and macOS 10.15.5, the
latest available for travis.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-09 09:52:54 +00:00
Rafael Kitover 36e61d765a
Test with utf8 and nostl variants of wx on Travis.
Build on bionic with downloaded stow packages in /usr/local.

f51e1ee4 is actually a fix for a wx with --enable-utf8 and NOT for a wx
with --disable-stl, as it turns out.

FreeBSD uses --enable-utf8, while Linux distributions generally don't.

Tested by reverting f51e1ee4.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-30 00:52:20 +00:00
Rafael Kitover 7bbbf04716
installdeps: fix mxe compiler ccache symlinks.
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>
2020-02-03 01:41:37 +00:00
Rafael Kitover 3edd9ba756
cmake: Fix fedora mingw build + misc improvements.
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>
2020-02-01 16:43:08 +00:00
Rafael Kitover 1e56cbfcb3
travis: Add minimal build.
Test building on xenial with:

./installdeps --no-openal --no-ffmpeg

Will also need to add --no-sfml to this.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-13 01:46:02 +00:00
orbea 7f6337b1c7 travis: Make xenial the main distribution.
The end of standard support for trusty ended in April 2019 and
the end of life is April 2022. For xenial the end of standard
support is April 2021 and the end of life is April 2024.

Most users should have xenial or newer at this point.

Source: https://wiki.ubuntu.com/Releases
2019-10-17 22:24:45 +00:00
orbea 73a2450247 travis: Test --help on osx. 2019-10-17 22:23:50 +00:00
orbea 675072f025 travis: Test xvfb on xenial and bionic. 2019-10-08 13:27:35 -07:00
orbea 369da07e7f travis: Test make install. 2019-10-07 17:36:27 -07:00
orbea 3111de5205 travis: Test clang builds. 2019-10-07 11:52:40 -07:00
orbea 6cc00a09fe travis: Clean up. 2019-10-07 11:51:07 -07:00
orbea 65fceab75a travis: Refactor script. 2019-10-07 04:47:57 -07:00
Rafael Kitover 8b3470507d
cmake: check for ffmpeg >= 4.0.4
Check for the specific `ffmpeg` lib versions in `ffmpeg` `4.0.4` "Wu",

Do not pass `-DENABLE_FFMPEG=OFF` to the xenial travis job, as this is
detected automatically now.

Add a note about the required ffmpeg version to `README.md`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-01 20:37:39 +00:00
Rafael Kitover 0b9c771027
travis: more ubuntu dists, fix mac cache
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>
2019-08-31 23:50:15 +00:00
Rafael Kitover d9e4a0874d
build fixes: ffmpeg, xbrz, travis, C++ version
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>
2019-08-31 22:58:59 +00:00
Rafael Kitover cec32a61cc
travis: mac: disable --help check, it segfaults
Disable the binary `--help` sanity check on mac because it is currently
segfaulting.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-04 04:08:42 +00:00
Rafael Kitover 3490620e0f
travis: use Mac OS 10.14 and Xcode 10.2.1
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>
2019-05-29 23:26:46 +00:00
Rafael Kitover 500506cbd4
travis: disable link/SFML for mac
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>
2019-05-22 21:06:42 +00:00
Rafael Kitover 5dfb36ad84
remove .clang-format, update .travis.yml
Remove .clang-format as it causes some people's editors to do
unnecessary reformatting automatically.

Add binary `--help` check to travis build steps.

Add `-DENABLE_SDL=ON -DENABLE_OPENAL=ON` to cmake options for all travis
jobs.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-13 23:18:57 +00:00
Rafael Kitover 2142a46dd5
Revert "travis: try re-enabling binary check"
This reverts commit 101fac5910.

Both ubuntu and mac jobs timeout when trying to call `--help`.
2019-03-16 03:45:36 -07:00
Rafael Kitover 101fac5910
travis: try re-enabling binary sanity check
On the ubuntu and mac jobs, try re-enabling the `--help` check, it
should now work thanks to @denisfa's work on a57e51f6.

If this works we also want to use wine for the mingw jobs to do the
same.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-03-15 19:26:16 -07:00
Rafael Kitover 7b3a3a0c4f
travis update attempt 3
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>
2019-03-08 19:55:10 -08:00
Rafael Kitover 8f0a578ade
travis update attempt 2
Use `xvfb` as per instructions at:

https://docs.travis-ci.com/user/gui-and-headless-browsers/

to run the `--help` check on linux.

Try https url for `pkg.mxe.cc`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-03-08 17:13:48 -08:00
Rafael Kitover dbd1d8c1f8
attempt to re-enable travis mingw slaves
The mxe pkg server seems to be back online with some changes, and an
invalid SSL certificate.

Also thanks to @denisfa's work on 7373da15 we can re-enable the `--help`
check on travis.

Let's see if this works.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-03-08 16:56:46 -08:00
Rafael Kitover a91f066493 disable travis mingw jobs for now
The mxe package server is dead, disable mingw jobs because they fail
without it pending some workaround.
2018-12-26 10:38:12 -08:00
Rafael Kitover 00b04692ae add travis hook for gitter 2018-12-05 14:38:54 -08:00
Rafael Kitover c63d364058 travis: add job for libretro module
Add a job to test compiling the libretro module to the matrix.
2018-06-28 20:51:13 -07:00
Rafael Kitover 48af3829aa travis: move cache key for ccache into jobs
Move the `cache: directories: "$HOME/.ccache"` key from the top of the
file into each specific job, otherwise it does not seem to have an
effect as a global option.
2018-06-27 14:13:23 -07:00
Rafael Kitover 8778837c83 add Travis CI support
Use a matrix of 4 jobs, linux (ubuntu trusty), mingw i686, mingw x86-64
and mac.

Automatically detect ccache in the cmake config and cache the
`~/.ccache` directory for faster rebuilds.

Instructions for ccache in cmake are here:
https://stackoverflow.com/a/24305849

Change build status badge in README.md to Travis.
2018-06-26 19:15:22 -07:00