Use gcc binutils for rc compiler on MSYS2 CLANG64.

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>
This commit is contained in:
Rafael Kitover 2022-02-04 04:18:36 +00:00
parent 347df44497
commit a7eeb17645
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
2 changed files with 18 additions and 0 deletions

View File

@ -1111,6 +1111,13 @@ windows_installdeps() {
set -- "$@" "${target}-${p}" set -- "$@" "${target}-${p}"
done done
case "$target" in
*clang*)
# We use gcc windres for now, llvm-rc is sometimes broken.
set -- "$@" mingw-w64-x86_64-binutils
;;
esac
# install # install
check pacman --noconfirm --needed -S git make zip "$@" check pacman --noconfirm --needed -S git make zip "$@"

View File

@ -855,6 +855,17 @@ if(WIN32)
list(APPEND VBAM_LIBS dxguid dsound wsock32 ws2_32 imm32 version) list(APPEND VBAM_LIBS dxguid dsound wsock32 ws2_32 imm32 version)
endif() endif()
# On MSYS2 CLANG64, use MinGW64 windres, when available, instead of
# llvm-rc, which sometimes does not work.
if(MSYS AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
cygpath(gcc_binutils_windres /mingw64/bin/windres)
if(EXISTS "${gcc_binutils_windres}")
set(CMAKE_RC_COMPILER "${gcc_binutils_windres}")
set(CMAKE_RC_COMPILER "${gcc_binutils_windres}" CACHE STRING "Windows REsource File Compiler" FORCE)
endif()
endif()
link_directories(${CMAKE_BINARY_DIR}) link_directories(${CMAKE_BINARY_DIR})
set(VBAM_ICON visualboyadvance-m.icns) set(VBAM_ICON visualboyadvance-m.icns)