Commit Graph

256 Commits

Author SHA1 Message Date
Rafael Kitover 4148080eb5
Always update Win32 dependencies git submodule.
Instead of just checking if the submodule has been cloned, always update
it when cmake runs if git is available.

This fixes the problem of users' dependencies submodule clone never
getting updated with new changes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-21 07:03:35 +00:00
Rafael Kitover 375daf99cb
Only build ffmpeg with vcpkg if installs < 30m.
Fix the problem with vcpkg installs including both wxWidgets and ffmpeg
overrunning the one hour time limit, by making ffmpeg optional and only
building it if the other builds are under 30 minutes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-17 18:38:58 +00:00
Rafael Kitover 299362b3cf
Refactor cmake ccache support and support MSVC.
Don't disable ccache for msys+ninja anymore, since the mingw ccache
works now and there is no reason to use the msys ccache anymore.

Use RULE_LAUNCH_COMPILE only on cmake versions < 3.4.0, because this
currently breaks resource compilation with visual studio and the windows
native ccache from chocolatey, this needs to be fixed in ccache.

On cmake 3.4.0 and greater, set the variables
CMAKE_<LANG>_COMPILER_LAUNCHER instead. This has the effect of using
ccache for C, C++ and nasm, but not for the resource file, avoiding the
problem with visual studio, which has a more recent cmake. This must be
done before the project() call.

TODO: Currently the Visual Studio build with ccache from chocolatey
works correctly, ccache is being invoked from ninja, but no cache files
are being created. This is being followed up with the chocolatey package
maintainer and upstream if necessary. The resource compiler issue also
needs to be fixed upstream.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-31 09:30:23 +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
Edênis Freindorfer Azevedo 07064c8714
[Windows,MacOS] Auto-updater refactoring. (#639)
Create and enable auto-updater for MacOS using `Sparkle=1.23`. We need
to sign our app using an `Apple Developer Key` for it to work properly,
since we are not going to sign updates with the Sparkle key.

Add all auto-updater files to `gettext`'s pot.

Use `str_split` to always get related stable version. We do not want
to check for nightly builds.

For Windows, we create the flag `-DHTTPS` to select between using an
HTTPS or HTTP URL for the auto-updater checks. We use this to keep
support for Windows XP (HTTP only) while all others should be HTTPS.

Also, use `::FreeLibrary` to allow us to remove the temporary file
that stores the `WinSparkle.dll`. Previously, we could not get it to
work with `wine`.
2020-05-07 23:06:00 -03:00
Rafael Kitover abb8234174
Allow binding specific server IP. (#633)
For the netlink dialog, leave the server IP text field enabled when the
server radio button is selected and bind it to the new option
gopts.server_ip which defaults to "*" for binding on all addresses,
which was the previous behavior.

Copy this value to the new GBALink global IP_LINK_BIND_ADDRESS and use
it when creating a listening socket.

SFML supports creating sf:IpAddress values from hostnames, consequently
no additional code is needed to support hostnames in the netlink dialog.

Change GetLinkServerHost to return the primary local address when the
value is "*", which was the previous behavior, and the set value
otherwise.

Remove the min/max macros from GBALink as they are unnecessary and
conflict with std headers.

Require at least SFML 2.4 instead of 2.x for the IP binding
functionality in cmake.

- Fix #632

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-16 13:37:01 -03:00
Rafael Kitover 2f23467245
cmake: When replacing old tags, use origin.
Fetch new set of tags from the origin remote explicitly rather than
whatever remote is associated with the current branch.

In this way, old tags on other remotes get overwritten as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-07 11:36:40 +00:00
Rafael Kitover 20f57587e2
cmake: Replace old git tags if found.
Detect old badly formatted git tags we used in the user's git clone, and
if found delete all tags and fetch them from the origin.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-05 15:04:19 +00:00
Rafael Kitover 05bd2a95cd
Remove libpng direct dependency.
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>
2020-03-01 13:56:29 +00:00
Edênis Freindorfer Azevedo 7f1a3a932c Add stb_image headers to cmake. 2020-03-01 09:54:43 +00:00
Rafael Kitover 951e8e0ebe
cmake: Check UPDATE_APPCAST before TAG_RELEASE.
Check for UPDATE_APPCAST being set before checking for TAG_RELEASE, as
the UPDATE_APPCAST script may be run in the same build directory where
TAG_RELEASE was just run.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 23:22:31 +00:00
Rafael Kitover 9475474ee6
cmake: Add UPDATE_APPCAST script for appcast.xml.
Add the -DUPDATE_APPCAST=TRUE option to invoke the UpdateAppcast.cmake
script, which clones the github pages repo and sets the version in the
appcast.xml to the last tag, presumably made with -DTAG_RELEASE.

The script prints out a final set of instructions to actually push the
change to git.

If the option -DUPDATE_APPCAST=UNDO is used, the clone is removed and no
changes are made.

Also use the correct method of splitting the tag list output into
multiple lines.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 22:53:53 +00:00
Rafael Kitover 83614290be
Turn on winsparkle update checking support.
Default to ON on Windows for x64 or x86.

Set new appcast URL, this will be in the github pages repo.

We will need to get everything ready for the next release.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 04:26:50 +00:00
Rafael Kitover 213f47ec96
builder: minor fixes for mingw.
Search the lib-prefixed names of intl/iconv/charset libraries first to
avoid dlls being linked.

Update toolchain files to include the common source by full path, fixes
using them as toolchains for other projects broken in 3edd9ba7.

Update URL for nasm, use newer jpeg-turbo, tiff and wx.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-02 03:35:26 +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 93f906e2db
cmake: Automate release commit and tag.
Add a TAG_RELEASE cmake variable which engages a cmake script to
generate a signed release commit with changelog entries from git and
signed tag.

The value can be ON/TRUE/1 or a specific next version number, or UNDO to
rollback changes just made with this script.

The script tries to make sure all the preliminaries are in the right
state to do a release, the source is a git clone, on branch master, with
a clean working tree and gpg is available.

Also add a utility script FileIterator.cmake which is an OO-like line
iterator interface for text files, used by the release commit script.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-22 03:14:26 +00:00
Rafael Kitover 77c299c13f
cmake: Check for libcharset and use if found.
For Visual Studio, the static builds now require linking libcharset
explicitly, otherwise an `unresolved external symbol locale_charset`
error is thrown during linking.

This library is sometimes required on other platforms for iconv/gettext,
and checking for it and linking it should be harmless.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-17 16:03:07 +00:00
Rafael Kitover e98d89310e
cmake: Add some release automation steps.
Use ENV{MSYSTEM_PREFIX} instead of ENV{MSYSTEM} to check for msys2 as
that is more reliable.

Generate the translations.zip when building for Windows from the
generated .gmo files.

Add the UPSTREAM_RELEASE option to perform some additional release
automation steps:

- Codesign for Windows with either the Visual Studio signtool or
  osslsigncode when using MinGW.

- On Windows zip up the .exe into the appropriate zip file for release.

- Generate the gpg signature .asc files for the translations zip and the
  .exe zip on Windows.

- On Mac codesign the app, zip it and sign the zip.

- On all platforms try to strip the binary.

Remove the release automation steps from the builder script as they are
now in cmake.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-24 06:32:01 +00:00
Rafael Kitover 99cdbb8860
cmake: Remove libcmt from SDL bin in debug mode.
For the SDL binary vbam when built with MSVC add /nodefaultlib:libcmt to
debug link flags, because in debug mode libcmtd is linked and libcmt
should not be.

This is the same as was done for the wx executable in cf9a88df.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-22 17:46:21 +00:00
Rafael Kitover f306cc63b0 App name cleanup.
Rename all icon basenames and references to them from "vbam" to
"visualboyadvance-m".

Change app name in desktop file from "VBA-M" to "visualboyadvance-m" as
well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-21 18:22:57 +00:00
Rafael Kitover 939a88ab4a
cmake: No default ffmpeg on 32 bit Windows.
Only check for ffmpeg if it's not explicitly turned off and the target
is not 32 bit Windows.

This is done because Windows XP does not have bcrypt.dll which ffmpeg
requires and the 32 bit builds are more likely to be used on older
systems which would also benefit from the smaller binary size.

Also add the X86 and X64 cmake architecture variable flags.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-18 14:17:20 +00:00
Rafael Kitover 49ca52ba03
cmake: Visual Studio misc followup on cf9a88df.
Fix the vcpkg root setting, which was trying to use CMAKE_PROJECT_DIR
before a project is defined by switching back to CMAKE_SOURCE_DIR. Also
check if the user has \vcpkg or c:\vcpkg and use those if found. Use
\vcpkg if ENV{CI} is set, e.g. on Appveyor.

Enable nasm for visual studio builds by using the nuget nasm2 package.

In Architecture.cmake check that the vcpkg arch matches the compiler
arch, and throw a fatal error otherwise.

When using GLOB to find the nuget package directory, use the package
name as the prefix, this is quite necessary when using multiple nuget
packages.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-15 19:34:18 +00:00
Rafael Kitover b3932e4e3d
cmake: Fix localization for Visual Studio.
Default to ENABLE_NLS=ON for vcpkg builds too.

Check for libintl under both the names "intl" and "libintl", likewise
for libiconv. The vcpkg versions have the "lib" prefix.

Use the Gettext.Tools package from NuGet for the tools to build the
translation files. vcpkg does not yet have gettext-tools.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-12 19:01:58 +00:00
Rafael Kitover 3aefcf64c9
cmake: Add ffmpeg to appveyor vcpkg cache.
Now that the initial vcpkg cache has been populated in appveyor, we can
build ffmpeg to add to it without going over the job limit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-12 14:10:36 +00:00
Rafael Kitover cf9a88dfc3
cmake: Visual Studio support improvements.
Add support for vcpkg ffmpeg, this requires using someone's
FindFFmpeg.cmake instead of relying on pkg-config, since vcpkg does not
have pkg-config.

Do not use the ffmpeg from vcpkg on appveyor however, because that
pushes the build cache generation over the time limit for jobs.

Add secur32 and bcrypt to the list of ffmpeg libs on windows, these are
standard windows libraries.

Change some code in ffmpeg.cpp to remove C-style casts of struct
initializers, which are illegal in MSVC.

Add the INT64_C and UINT64_C macros missing in MSVC's stdint.h (if not
defined) to ffmpeg.h before the ffmpeg headers are included, because
they rely on them.

Rewrite the wxWidgets finding code for the vcpkg wxWidgets to be nicer
and work correctly for debug and static builds.

Remove all /W* and /w* warnings options from cmake compiler flags, and
replace them with /W4 for debug builds, and /w (no warnings) for release
modes.

When building a static binary, remove all /MD* flags from cmake compiler
flags, and use /MT for static release builds and /MTd for static debug
builds.

Improve the vcpkg toolchain wrapper to only rebuild the vcpkg binary if
there were git updates.

Redo the handling of SDL2 and SDL_main. Only link SDL2Main to the SDL
binary and don't use the definitions.

Update CMakeSettings.json to use Ninja and include static
configurations.

Use CMAKE_PROJECT_DIR instead of CMAKE_SOURCE_DIR to determine the vcpkg
root, as CMAKE_SOURCE_DIR is sometimes set incorrectly in the 2017 GUI.

Add /nodefaultlib:libcmt to the debug build link flags, as in debug
builds libcmtd is used and libcmt should not be.

Add /subsystem:console to debug build link flags to produce a windows
console app for debug builds, like we do for mingw builds. To do this,
define a WIN32_CONSOLE_APP macro and if set, define a main() that calls
WinMain().

Call wxMesdsageOutput::Set() in OnInit with an instance of
wxMessageOutputStderr for windows debug builds to make sure the --help
text etc. goes to the console instead of a popup box.

Update the Visual Studio related text in README.md.

Fix dynamic debug builds by linking to the debug version of SDL2 and
copying the debug version of the dll to the build dir.

Fix issue in MainFrame::BindAppIcon with the function we are using not
being found in a Windows DLL in debug builds by using
wxDynamicLibrary::GetSymboolAorW() instead of GetSymbol().

Enable LTO for MSVC in Release modes, if the option is set.

Change appveyor config to use an 8 item build matrix of
x64/x86 / Release/Debug / Static/Dynamic. And test the binary in debug
modes by running --help.

When copying the wxrc.exe out of the build tree, copy both the release
and debug versions, this is so that appveyor caching of vcpkg works,
since the build trees are not cached.

Add some necessary win32 libraries to the SDL binary. And enable
building it on appveyor.

Fix #465.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-10 11:13:58 +00:00
Rafael Kitover d183245bdd
builder: Link setupapi always, update libpng.
On Windows always link setupapi with SDL2, the find_library() call with
SetupAPI was failing on mingw because of case.

Update libpng 1.6.32 -> 1.6.37.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-08 15:28:03 +00:00
Rafael Kitover e35d46254b
WinSparkle wrapper improvements.
- Make WinSparkleDllWrapper a real singleton.

Make the constructor private and add a static `GetInstance()` method
that constructs the single instance and/or returns it.

Make it encapsulate the function pointers and the wxDynamicLibrary
instance, with the API as friend functions.

- Make winsparkle API completely self-contained.

Make the instance of the WinSparkleDllWrapper a factory function local
static.

This way the calling program does not have to manage the life-cycle, the
singleton is initialized when the API is first invoked, and destroyed
during global destruction.

The destructor is now also private, because the singleton object is
destroyed during global destruction.

Found the solution here:

https://stackoverflow.com/a/46139631/262458

- Cmake improvements.

Only enable the ENABLE_ONLINEUPDATES option by default if we are going
to use winsparkle on 32 or 64 bit intel windows.

Do not inlclude winsparkle if the option is off.

- Disable for now.

Currently ENABLE_ONLINEUPDATES defaults to OFF even on intel/windows,
until we do more work on this feature.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-09 23:44:23 +00:00
Rafael Kitover 36790074c3
cmake: fix linking to libssp and linking bin2c
Only add the macro `-D_FORTIFY_SOURCE=2` if we are linking to libssp
with gcc, do not use it at all on clang.

For `HostCompile.cmake` add the macro `-Dmain=main` to redefine the
macro added by SDL2 to compile flags `-Dmain=SDL_main`.

Fix #548.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-17 21:53:15 +00:00
orbea eaa744cc2e cmake: Add generate as a vbamcore dependency.
Fixes https://github.com/visualboyadvance-m/visualboyadvance-m/issues/542.
2019-10-11 07:02:38 -07:00
orbea 2d783f5df8 cmake: Fix ENABLE_ASAN with clang.
Only -fsanitize=address is needed for asan to work with both
gcc and clang.

[170/196] Building CXX object CMakeFiles/vbamcore.dir/src/Util.cpp.o
clang-9: warning: -lasan: 'linker' input unused [-Wunused-command-line-argument]
[171/196] Linking CXX static library libvbamcore.a
[172/196] Generating cmdtab.cpp, cmdhandlers.h, cmd-evtable.h
[173/196] Generating wxvbam.xrs
[174/196] Generating builtin-xrc.h
samu: job failed: cd /tmp/visualboyadvance-m/build/src/wx && /tmp/visualboyadvance-m/build/bin2c wxvbam.xrs builtin-xrc.h builtin_xrs
==4845==Your application is linked against incompatible ASan runtimes.
samu: subcommand failed
2019-10-10 02:49:07 -07:00
orbea 84d24b7d71 cmake: Silence _FORTIFY_SOURCE warnings with debug builds.
[79/196] Building CXX object fex/CMakeFiles/fex.dir/fex/Zlib_Inflater.cpp.o
In file included from ../fex/fex/Zlib_Inflater.cpp:3:
In file included from ../fex/fex/Zlib_Inflater.h:7:
In file included from ../fex/fex/Data_Reader.h:7:
In file included from ../fex/fex/blargg_common.h:8:
In file included from /usr/include/assert.h:35:
/usr/include/features.h:382:4: warning: _FORTIFY_SOURCE requires compiling with optimization (-O) [-W#warnings]
   ^
1 warning generated.
2019-10-09 08:48:20 -07:00
orbea 518c147281 cmake: Use an install target for visualboyadvance-m. 2019-10-07 17:36:27 -07:00
orbea 680af6d420 cmake: Silence cmake policy warning CMP0058.
See: cmake --help-policy CMP0058
2019-10-05 18:33:44 -07:00
Rafael Kitover 3e22d17fb2
fix Visual Studio build
The change to use an extern version variable in 24d83a12 produces a
linker error with Visual Studio due to the `version.c` source file being
compiled as C instead of C++.

Rename:

`version.c`   -> `version.cpp`
`version_c.h` -> `version_cpp.h`

And update all references accordingly.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-04 13:20:10 +00:00
Rafael Kitover 24d83a1262
make recompile for vers/git state change minimal
Make a `version.c` with `const char*` variables to store the version
strings used by other files, to make recompiles slightly faster when the
git state changes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-04 08:14:22 +00:00
Ar't ced2676926
win: set correct version in rc
xvbam.rc: use version.h to generate version strings,
cmake: adding version in odd format required by rc
2019-10-04 07:13:20 +00:00
Rafael Kitover 9ee6b54a68
cmake: remove invalid opt /std:c++11 for MSVC
Visual Studio 2017 only allows `/std:c++14` and higher, so remove the
`/std:c++11` option, we'll take the default of C++14 standard.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-12 03:04:20 +00:00
Rafael Kitover b358c051c9 Fix compilation issue when `ENABLE_DEBUGGER=Off`.
We protect all code relevant to disabling this property with either
`BKPT_SUPPORT` or `NO_DEBUGGER`. This is mostly debugging options or
prints scattered around the code.

We also adjust cmake to ignore the specific files surround it, but
allowing the rest of the GUI to work.

- Fix #431.
2019-09-04 14:31:11 +00:00
Edênis Freindorfer Azevedo f1438e0f0a Check ASAN support when `ENABLE_ASAN=ON`.
We check if the compiler has asan support when the option is enabled.
If it does not, then we stop compiling with the proper message.

To test this, we use `gcc (GCC) 4.4.7` (no asan support) and
`gcc (GCC) 9.1.0` (asan is supported). Call cmake like this:

`cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=On` and
`CXX=g++-4.4 cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=On`

we then check that it fails for the older version and it works for
the newer gcc, like expected.

- Fix #409.
2019-09-02 20:52:08 +00: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 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 381a7bfe78
/std:c++latest for MSVC, fix bool flip, warn opts
Use `/std:c++latest` for Visual Studio because the XBRZ 1.7 code
requires at least C++17.

Replace the use of `bool++` in `GBALink.cpp` which is now apparently an
error with `bool = !bool` to flip the value.

Use `/W4` to enable a good amount of warnings in Debug mode, and `/W0`
to disable warnings entirely in release modes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-30 01:57:01 +00:00
Edênis Freindorfer Azevedo 234f1e9b1a Update to xBRZ `1.7`.
Get files from here `https://sourceforge.net/projects/xbrz/files/xBRZ/`.

Then, update the src to handle pitch params. For our case, the pitch
is necessary because we deal with borders (top and right) of our source
image. Normally, we would want to scale without it, and therefore we
need to adjust the pointers to skip the borders.

If we have a `width + 1 pixel border` per line, the we need to scale
a image with `width` line size, but advancing the pointer for each new
line processed including the border on the count.

Also, since our output pointer also allocates for the border, we need
to adjust the output moving pointer for each line in a custom way.
(output border in this case)

- Fix #164.
2019-08-28 22:07:52 +00:00
Rafael Kitover d9a7e0c964
cmake: auto-detect sfml, ffmpeg and openal
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>
2019-08-20 08:21:38 +00:00
Rafael Kitover 2958af01ca
builder: mingw improvements + misc.
- default ENABLE_NLS to ON except for vcpkg, broken in e2f06210

- update zlib URL

- use openssl 1.1.1c instead of 1.0.2p, parallel build works now!

- add osslsigncode for mingw to codesign windows binaries, and
  automatically sign in `build_project()`

- add curl (for osslsigncode, which needs libcurl)

- use current master for wxwidgets instead of 3.1.2

- make the `translations.zip` in `build_project()` for windows

- on mac, unlock the login keychain before codesigning (this is
necessary if using e.g. ssh.)

- do not fail if the user does not have codesigning or gpg keys

- fix wxwidgets configure options on mac (need to append to
  `DIST_CONFIGURE_OVERRIDES` instead of `DIST_ARGS`.)

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-19 13:15:01 -07:00
Edênis Freindorfer Azevedo 5848feaea2 Fix video/audio recording.
We create a namespace to deal with most of our recording solution.

Besides that, we also add some functions to remove the need of
including libavutil headers on other part of the code. This is meant to
isolate most of recording solution components on the proper files.

We will start with a limited number of codecs supported; slowly we
should add them as they are tested (the previous one did not work for
most codecs listed).

This should support `ffmpeg 4.1` and further, including removing
all compilation warnings related to versions discrepancy.
2019-08-14 08:27:51 -01:00
Edênis Freindorfer Azevedo 060da968eb [LINUX] Add option to disable the online updater.
Add option to remove all configuration related to checking for updates
online. Although it is not implemented at the moment, these options
appeared on our menu `Options` > `General ...`.

- Fix need of patch on #140.
2019-07-25 00:41:34 +00:00
Rafael Kitover e2f06210e0
update Visual Studio support
Replace the vcpkg code with a newer and better version. In this version
the `vcpkg` directory is on the same level as the source directory, so
that IntelliSense does not get confused scanning for files.

The cmake variable `VCPKG_TARGET_TRIPLET` is required to activate vcpkg
support, it must be set to e.g. `x64-windows` or `x86-windows`.

Update `CMakeSettings.json` for the new code for the GUI.

Fix a problem copying the `SDL2.dll` file to the binary directory.

Update `README.md` with commandline instructions.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-03 23:28:48 +00:00
Rafael Kitover a4eae8025e
cmake: use LEGACY OpenGL on FreeBSD only 2fedaa63
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>
2019-04-27 22:52:42 +00:00
Rafael Kitover 2fedaa63a6
support FreeBSD
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>
2019-04-25 16:22:07 +00:00