Better fix for wxrc with vcpkg.

When doing a dynamic build, the wxWidgets dlls are needed by the wxrc
executable.

Invoke wxrc with the target triplet debug and release bin directory
prepended to the PATH, this is where the dlls are.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2020-08-23 05:56:32 +00:00
parent f07a838883
commit ff03bcc1e0
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 47 additions and 52 deletions

View File

@ -163,14 +163,9 @@ if(WIN32 AND CMAKE_TOOLCHAIN_FILE MATCHES vcpkg AND (X86_32 OR AMD64))
) )
endif() endif()
# if(DEFINED ENV{APPVEYOR}) set(WXRC ${common_prefix}/tools/wxwidgets/wxrc.exe)
if(TRUE)
# For some reason, the vcpkg built wxrc fails on appveyor. set(ENV{PATH} "${dbg_prefix}/bin;${common_prefix}/bin;$ENV{PATH}")
set(WXRC ${CMAKE_SOURCE_DIR}/dependencies/wxrc.exe)
else()
set(WXRC ${common_prefix}/tools/wxwidgets/wxrc.exe)
# This one sometimes fails to find its dlls.
endif()
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/zip.exe) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/zip.exe)
# get zip binary for wxrc # get zip binary for wxrc
@ -578,46 +573,46 @@ endif()
set( set(
XRC_SOURCES XRC_SOURCES
xrc/AccelConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/AccelConfig.xrc
xrc/CheatAdd.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/CheatAdd.xrc
xrc/CheatCreate.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/CheatCreate.xrc
xrc/CheatEdit.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/CheatEdit.xrc
xrc/CheatList.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/CheatList.xrc
xrc/CodeSelect.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/CodeSelect.xrc
xrc/DirectoriesConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/DirectoriesConfig.xrc
xrc/Disassemble.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/Disassemble.xrc
xrc/DisplayConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/DisplayConfig.xrc
xrc/ExportSPS.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/ExportSPS.xrc
xrc/GBAROMInfo.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GBAROMInfo.xrc
xrc/GBColorPrefPanel.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GBColorPrefPanel.xrc
xrc/GBDisassemble.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GBDisassemble.xrc
xrc/GBMapViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GBMapViewer.xrc
xrc/GBOAMViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GBOAMViewer.xrc
xrc/GBPaletteViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GBPaletteViewer.xrc
xrc/GBPrinter.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GBPrinter.xrc
xrc/GBROMInfo.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GBROMInfo.xrc
xrc/GBTileViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GBTileViewer.xrc
xrc/GameBoyAdvanceConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GameBoyAdvanceConfig.xrc
xrc/GameBoyConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GameBoyConfig.xrc
xrc/GeneralConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/GeneralConfig.xrc
xrc/IOViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/IOViewer.xrc
xrc/JoyPanel.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/JoyPanel.xrc
xrc/JoypadConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/JoypadConfig.xrc
xrc/LinkConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/LinkConfig.xrc
xrc/Logging.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/Logging.xrc
xrc/MainFrame.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/MainFrame.xrc
xrc/MainIcon.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/MainIcon.xrc
xrc/MainMenu.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/MainMenu.xrc
xrc/MapViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/MapViewer.xrc
xrc/MemSelRegion.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/MemSelRegion.xrc
xrc/MemViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/MemViewer.xrc
xrc/NetLink.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/NetLink.xrc
xrc/OAMViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/OAMViewer.xrc
xrc/PaletteViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/PaletteViewer.xrc
xrc/SoundConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/SoundConfig.xrc
xrc/TileViewer.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/TileViewer.xrc
xrc/SpeedupConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/SpeedupConfig.xrc
xrc/UIConfig.xrc ${CMAKE_CURRENT_SOURCE_DIR}/xrc/UIConfig.xrc
) )
# wxrc does not support xrs files in -c output (> 10x compression) # wxrc does not support xrs files in -c output (> 10x compression)
@ -687,8 +682,8 @@ endif()
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wxvbam.xrs OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wxvbam.xrs
COMMAND ${WXRC} ${XRC_SOURCES} -o ${CMAKE_CURRENT_BINARY_DIR}/wxvbam.xrs COMMAND ${CMAKE_COMMAND} -E env "PATH=$ENV{PATH}" ${WXRC} ${XRC_SOURCES} -o ${CMAKE_CURRENT_BINARY_DIR}/wxvbam.xrs
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS ${XRC_SOURCES} DEPENDS ${XRC_SOURCES}
) )
@ -1033,8 +1028,8 @@ endif()
if(ENABLE_NLS) if(ENABLE_NLS)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/wx-xrc-strings.h OUTPUT ${CMAKE_BINARY_DIR}/wx-xrc-strings.h
COMMAND ${WXRC} -g ${XRC_SOURCES} -o ${CMAKE_BINARY_DIR}/wx-xrc-strings.h COMMAND ${CMAKE_COMMAND} -E env "PATH=$ENV{PATH}" ${WXRC} -g ${XRC_SOURCES} -o ${CMAKE_BINARY_DIR}/wx-xrc-strings.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS ${XRC_SOURCES} DEPENDS ${XRC_SOURCES}
) )