Move the check for dependencies/msvc into the previous IF(WIN32) block
adding an IF(MSVC) level.
Remove duplicate call to INCLUDE_DIRECTORIES(dependencies/msvc) from
later on in the main CMakeLists.txt.
Add -std=gnu+11 to CMAKE_CXX_COMPILE_OBJECT in the main CMakeLists.txt
to force the option for all C++ sources.
The right way to do this is to use a generator expression with
ADD_COMPILE_OPTIONS, but this is only available in cmake 3.3 and we must
maintain 2.8.12 compatibility to support Ubuntu 14.
This fixes the mac build (clang.)
Call GameArea::Pause and ::Resume in MainFrame::OnActivate based on
focus state if the pauseWhenInactive config option is set.
Also stop/play the primary dsound buffer in pause()/resume() in
dsound.cpp, not onlyu the secondary, this may not be necessary but it
doesn't hurt.
XCode 4.2 generates a broken binary if -fomit-frame-pointer and/or -flto
is used for compile and link flags.
Check for Clang version less than 4.3 on APPLE and remove these flags in
the compile options setting cmake code.
Apparently in some configurations, holding a key on the keyboard makes
Wx stop processing Idle events, so the emulator does not run until the
key is released, freezing the game and ignoring the key.
Hopefully fix this by calling wxWakeUpIdle() from OnKeyDown() and
OnKeyUp().
Other Misc. Improvements:
- refactor process_key_press() to only return true if the system is in a
pressed key state on key presses or a game key was released on
releases and always true on double releases.
- call ev.StopPropagation() from OnKey* events for game keys, this may
not actually do anything, but just in case.
- remove static OnKeyUp and OnKeyDown events from GameArea, these are
connected to the DrawingPanel dynamically now.
- remove the dynamic_cast<>s from PaintEv/EraseBackground/OnSize event
forwarders, since there is already a panel member to use.
TODO:
The state returned by process_key_press() is still not entirely correct,
if a joystick button is pressed, it will return true for a non-game
keyboard press, and it needs to return the correct state for double
releases.
As suggested by @Mystro256, try:
wxDynamicLibrary::CanonicalizeName(wxT("openal"))+wxT(".1")
before just the canonical name for "openal" when trying to load the
library.
Also add a utility method to quietly try loading the library, because on
wx 2.8 wxDL_QUIET does not work.
cmake automatically passes -std=gnu++11 in some cases, while we were
passing -std=c++11, and this was causing incompatibilites in name
mangling between different objects.
Fix this by using -std=gnu++11 for gcc.
The last commit removed generator expressions from ADD_COMPILE_OPTIONS()
which made C/C++ flags apply to nasm as well.
Fix this by removing <FLAGS> from CMAKE_ASM_NASM_COMPILE_OBJECT and
replacing it with the flags we want.
Fix some porting issues to make everything work on Debian 8 "Jessie"
and Ubuntu 14 "Trusty":
- set cmake minimum version to 2.8.12, this is the Ubuntu 14 version
- combine C and C++ flags and add all of them using
ADD_COMPILE_OPTIONS() without using generator expressions, which is a
cmake 3.2 or so feature
- add -fpermissive to force some non-const type casts to compile on
older versions of gcc
- add -std=c++11 for gcc to enable support on older versions of gcc
- check that the compiler supports -fstack-protector-strong before
adding it, older versions of gcc do not
- fix the debian section of ./installdeps to include libpng-dev instead
of libpng16-dev and add gettext for msginit etc.
- fix compat checks in src/common/ffmpeg.cpp and src/wx/cmdevents.cpp to
check for libavcodec >= 56 instead of > 56, the Debian Jessie version
is exactly version 56 . With the one exception of
AV_CODEC_FLAG_GLOBAL_HEADER which is defined in later versions.
Fix backcompat with wx 2.8. This involved writing
wxPositiveDoubleValidator and rewiring the DrawingPanel inheritance tree
and event handling mechanisms (because 2.8 does not have ->Bind, only
->Connect which is less flexible.) As a result all the event handling
has been gathered into GameArea and the affected code is somewhat
cleaner. 2.8 support is untested on Mac because it requires 32 bit libs
and Carbon.
Add support for cross-compiling for windows using the Fedora MinGW
packages in ./installdeps.
Check for OpenGL support in the wx library being linked, this was
necessary because the Fedora MinGW wx library does not have OpenGL
support.
Remove vbamDebug() in favor of wxLogDebug(), and add an override for it
so that it works in non-debug builds of wx as well as on Windows. Turn
off buffering on stdout and stderr on startup so that debug logging
works in msys2/cygwin mintty as well.
On Windows, build a console binary for debug builds.
Update README.md to reflect Fedora MinGW support and debug logging
support.
Add -Wextra to cflags for debug builds.
Detect and install deps for Fedora Linux in ./installdeps . On 64 bit
intel hosts install both 32 and 64 bit dev libs. Also update README.md
to note that Fedora is supported.
MISC: add nasm to all dep lists for various dists
Make a nice table for CMake options, add a note on making debug vs.
release builds, add nasm to list of deps, add a note in MSys2 notes
about lack of debug console messages.
Only allow running ./installdeps if $MSYSTEM is MINGW32 or MINGW64, that
is, the user started a MINGW 32 bit or 64 bit shell and **NOT** an MSYS
shell.
Use the value of $MSYSTEM to determine if 32 bit or 64 bit target deps
should be installed.
Update usage() text to reflect this.
MISC: rename generic_build_instructions() to build_instructions() .
Fix all cmake issues related to building for win32 with mxe.
Add support for ./installdeps win32 on Debian/Ubuntu using the mxe apt
repository.
Details:
* default to ENABLE_LTO=OFF on mxe
* set SFML_STATIC_LIBRARIES=TRUE on mxe
* fix the libintl/gettext checking logic
* fix the git dependencies submodule checking logic, and check that it
triggers for mxe
* revert FindSFML.cmake to upstream version, works fine with mxe
* make 'win32' an alias for the 'MinGW-w64-i686' target for
./installdeps, add support for mxe apt repository for Debian/Ubuntu
* change bin2c related cmake code to compile the tool on the host always
even when cross-compiling
* copy src/win32/res/VBA.ico to src/wx/icons since src/win32 has been
removed
TODO: generic mxe installer for other unix-likes
Remove "PATH_SUFFIXES include" in the FIND_PATH(SFML_INCLUDE_DIR ...)
call in FindSFML.cmake, this has fixed cross-compiling issues with
FindOpenAL.cmake and FindSDL2.cmake already.