Black screen reported on linux with `LEGACY` OpenGL type, set it back to
`GLVND` and only use `LEGACY` on FreeBSD.
Broken in 2fedaa63.
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>
Previously when working on Visual Studio support I noticed an XRC error
dialog when adding the game area to the BoxSizer.
I tried removing the wxEXPAND flag with insufficient testing, the flag
is actually necessary.
The error is actually an incorrect debug assertion that is present in
3.1.2 and later fixed in master. The assertion is not triggered when
the project is built in release mode.
Remove the windows conditional code that removes the wxEXPAND flag.
TODO: silence assertion in debug mode or patch the wxWidgets vcpkg port.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix the cmake code that sets up wxWidgets when using vcpkg with Visual
Studio so that the Release configuration also works. Use variables
instead of an if statement.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
To make the version string consistent with other cores, make it of the
form "<VER> <SHORT-SHA>" with a space in-between.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
To make the libretro core consistent with other cores, remove the "-"
between the version and the git short sha for git builds.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Move linux distribution detection into `detect_os()` in the core.
The appropriate routine is then called with eval.
Move linux deps installation (for fedora previously) from
`linux-cross-builder` to `mingw-cross.sh` using the `linux_distribution`
variable set by `detect_os()`.
Add a routine to install suse cross dependencies as well.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
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>
Fix display when loading ROMs with custom geometry.
This issue was a combination of `wxSHAPED` and its effect on the custom
geometry. It is necessary to force a dummy resize so the display adjusts
itself.
Align game frame on center, both horizontal and vertical.
In 2097b5aa I added a function that is used both in the non-vcpkg block
and outside of it, but the function was defined in the non-vcpkg block,
and this broke the visual studio build.
Move functions and macros into an include file so that they are globally
available.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix changelog for last release being generated in the russian locale.
Ask users in the issue template what bios they are using, because this
can affect things like link.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Clear the `find_program()` cache variable before each use.
On win32 prefer unqualified utility executables.
Add special handling for msys2, where wx-config is a shell script that
cannot be directly run from native cmake.
This is a followup on 2097b5aa.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Instead of ignoring the initial state of axes, which I did to make
triggers work on the 360 controller, set the initial previous value to
the initial state instead.
This fixes the original problem without breaking analog stick movement.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
The `wxEXPAND` flag is necessary for the game area in wxWidgets 3.0 and
earlier, it may be necessary in 3.1.2 as well, but it throws an xrc
error, so we check for windows and at least 3.1.2 to test for the visual
studio and vcpkg environment to avoid the xrc error.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
@denisfa found this due to a warning, this should improve the
functionality of the SDL sound driver.
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
Do some reformatting towards the more modern cmake style.
Clean up some code.
Support linking to gcc compiled wxWidgets by setting
`-D__GXX_ABI_VERSION=` appropriately for clang.
Use the new method of calling `FindwxWidgets.cmake`, the old method
causes some problems now.
Set all necessary policies in both cmake files.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
When using LTO with gcc or clang, try to compile and link something to
make sure it works, and disable it if it doesn't.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Check `if(POLICY CMP0077)` before trying to set it, because setting a
policy a version of cmake does not know about is an error.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Ninja requires `-fdiagnostics-color=always` instead of
`-fdiagnostics-color=auto` with gcc because it pipes output from the
compiler unlike regular makes.
Use `-fcolor-diagnostics` for clang, which also works correctly with
ninja to show colors.
Information for this taken from here:
https://medium.com/@alasher/colored-c-compiler-output-with-ninja-clang-gcc-10bfe7f2b949
Set all cmake policies in both the root `CMakeLists.txt` and
`src/wx/CMakeLists.txt` to silence warnings about unset policies from
cmake.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
In a construct such as:
```cmake
if($ENV{FOO} MATCHES bar)
...
endif()
```
if the environment variable is not set, the if statement becomes a
syntax error because there is nothing being compared.
Fix this by quoting the environment variable like so:
```cmake
if("$ENV{FOO}" MATCHES bar)
...
endif()
```
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Use the libXss Xorg screensaver extension library to call
`XResetScreenSaver()` on joystick events to inhibit screen blanking when
for whatever reason the joystick driver or DE (xboxdrv and KDE in this
case) does not do this.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>