Adjust cmake code to support building a Windows arm64 binary on a
Windows x86/x64 host.
Add /EHsc to MSVC compiler flags for exception unwind support.
Check VCPKG_TARGET_TRIPLET in Architecture.cmake to set the appropriate
cmake variables for cross-compiling for arm64.
Add MSVC_x86_Host_Compile.cmake script, used from HostCompile.cmake, to
adjust the path of the cl.exe compiler and ENV{LIB} to build a C program
for x86 when cross-compiling, necessary for the bin2c utility.
Use wxrc from dependencies submodule when cross-compiling, because the
cross wxrc executable cannot be run on the host.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Instead of suffixing release zip files with 32bit or 64bit, add an
architecture suffix, which would be one of:
x86_32
x86_64
arm32
arm64
Allow codesign to fail on mac without aborting.
Disable the interactive pause for gpg signing because there is no
passphrase anymore.
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>
Followup on e98d8931.
Set the BITS variable in Architecture.cmake even if
CMAKE_SYSTEM_PROCESSOR is not set, and it often isn't. This allows for
generating the right release zip for 32 bit MinGW builds.
When invoking zip to make the translations.zip, use `.` instead of `*`
as the argument, with the correct WORKING_DIRECTORY, so as not to rely
on shell globbing of any sort. This broke for the 32 bit MinGW cross
build.
Fix the keychain unlock command on mac, the keychain must be unlocked to
use the codesigning certificate.
Fix the translations.zip.asc signature overwrite prompt on Windows.
For the mac builder, automatically use Xcode 9 for 32 bit builds if
installed, this is necessary on 10.14 (Mojave) and later.
Add interactive-pause.cmake script to wait for the user to press enter
before continuing, invoke it before gpg commands so that waiting for the
passphrase does not time out. It will not run if ENV{CI} is set or
ENV{VBAM_NO_PAUSE} is set, this is so that later we can set up automated
builds.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
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>
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>
Followup on 49ca52ba.
Improve the code that shows a fatal error if the vcpkg target
architecture does not match the build environment, by showing both the
target architecture and the build environment architecture.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
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>
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>
Use vcpkg to build deps when Visual Studio on Windows is detected, this
only happens on first build, but does take a while because things like
wxWidgets need to be built. Building from the developer command line is
also supported.
I considered making a pre-built tarball available, but the resulting
files are just too big for this to be practical.
Make the necessary cmake code changes for this to work and to use the
vcpkg packages, which work just like on linux or have other cmake glue
code available.
To do this, we make vcpkg a submodule, use git to checkout all
submodules, then just build and use the `vcpkg.exe`. Then we set the
CMAKE_TOOLCHAIN_FILE to the vcpkg toolchain and also include it
directly, why this is necessary I don't know, without it it doesn't work
in the IDE but does on the command line.
All of this requires no vcpkg integration with either the user or the
project. A user-wide `ENV{VCPKG_ROOT}` is also supported.
Fix the dynamic arrays in the GBA core, MSVC follows the C++ standard on
this and gcc does not.
TODO: add the necessary gcc flags to make this an error in cmake.
Use `wxArrayString` instead of `std::vector<wxString>` in
`src/wx/strutils.cpp` which is used in options parsing. This was
necessary because of a bizarre linker error with wxWidgets when using
Visual Studio:
https://trac.wxwidgets.org/ticket/10884#comment:46
In `src/wx/panel.cpp` make sure the unimplemented D3D renderer code does
not get compiled if it's actually `OFF`.
Also fix the new spacer code for the drawing panel to not combine
`wxEXPAND` with `wxALIGN_CENTER`, which is an error on wxWidgets 3.1.2,
which is what vcpkg uses. The drawing panel seems to be automatically
stretched to the max size automatically anyway.
TODO: if all of this works, we'll need an Appveyor set up for visual
studio.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>