Probably fixes this in other environments as well, or breaks it.
Move the wxWidgets_LIBRARIES paths conversion to the already existing
normalize_wx_paths() function that was using a different method that no
longer works. This converts the variable to the right format before the
tests run, fixing the Wx OpenGL test.
For the ABI checks, wrap the function pointers for the minhook
trampoline API in reinterpret_cast<LPVOID>(&fp), why this is necessary I
don't know, and it may break on other compilers. The trampoline is used
to catch message boxes opened by Wx for fatal errors.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Search for wx-config-static for static builds first, and wx-config
otherwise, before trying any config and version suffixes.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Update installdeps and cmake to use windres from gcc binutils from
MINGW64 on MSYS2 CLANG64, because llvm-rc doesn't work sometimes.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Use jpeg.lib instead of jpegd.lib for jpeg debug lib, it no longer has
the "d" suffix.
Fix all CMAKE_BUILD_TYPE checks for debug builds to either also check
for RelWithDebInfo or match "Debug" exactly.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Turn off ccache for vcpkg builds (this is only relevant to MSVC, where
ccache does not work yet.)
Throw an error if CMAKE_BUILD_TYPE is not valid or does not match case
exactly (to make comparisons simple.)
Add SetCompilerLinkerFlags.cmake lib with the functions:
add_compiler_flags()
For each flag passed in, add it to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS if
not already present. Also clears all build-specific flag variables on
every call, if using this functions you must set build-specific flags
yourself.
add_linker_flags()
For each flag passed in, add it to
CMAKE_(EXE|SHARED|MODULE|STATIC)_LINKER_FLAGS if not already present.
Add remove_dupes() function to VbamFunctions.cmake from:
https://stackoverflow.com/a/41416298/262458
This is used to remove duplicate flags in SetCompilerLinkerFlags.cmake
described above.
Use the new functions to set compiler and linker flags for MSVC.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Update installdeps to support CLANG64/CLANG32 MSYS2 targets.
cmake:
Set POLICY CMP0060 to NEW to not convert full lib paths, this is the
default.
Stop disabling ffmpeg on WIN32+i686.
On MSYS2+clang add windows import libs to CMAKE_PREFIX_PATH.
For static builds on MSYS2 append full paths for static libs for tiff,
jbig and lzma to FFMPEG_LIBRARIES.
Add -Wno-unused-command-line-argument to all CFLAGS/CXXFLAGS so that
clang does not warn about gcc-specific options.
Enable -march/-mtune optimizations by default instead of only for
UPSTREAM_RELEASE.
Update find_wx_util() to search suffixes for WIN32 and add the "static"
suffix for static builds.
Remove all linker flags from wxWidgets_LIBRARIES and translate all wx*
libs as well as jpeg, tiff, jbig lzma and expat to full .a paths for
static builds.
Disable strutil tests on MSYS2+clang, currently does not build.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Use:
/Ot /Oy /Ob3 /GF /Gy
, instead of /O2 for x86, this makes it not crash on ROM load for the
OpenGL renderer.
Supposedly /O2 is equivalent to:
/Og /Oi /Ot /Oy /Ob2 /GF /Gy
, but the documentation states that /Og is automatically enabled when
any other optimizations are enabled automatically. So this should make
absolutely no difference, yet it does.
For x64 use:
/O2 /Ob3
, this overrides /Ob2 from /O2 to use more aggressive inlining, VS 2019
is required for this.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
For MSVC, add the optimization flags:
/fp:fast /Oi
, to favor speed for floating point operations and use intrinsic
operations where possible.
For release builds also add:
/O2
. Use sqrt() instead of std::sqrt() in XBRZ for MSVC x64 just in case to
make sure it uses the intrinsic version.
Test build is reported to run much faster.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>