Skip to content

Commit 8dae12d

Browse files
authored
Fix binaries copying for FAB version of the plugin (getsentry#1119)
1 parent 371cf40 commit 8dae12d

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

plugin-dev/Scripts/post-build-steps-win.bat

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,28 @@ set "PROJECT_FILE=%~5"
1010
set "PLUGIN_DIR=%~6"
1111
set "ENGINE_DIR=%~7"
1212

13-
REM Copy crashpad handler executable to plugin's Binaries\Linux dir if it doesn't exist there
14-
REM This enables cross-compilation for Linux on Windows with FAB version of the plugin
15-
set "CRASHPAD_HANDLER_LINUX=%PLUGIN_DIR%\Binaries\Linux\crashpad_handler"
13+
set "LINUX_BIN_DIR=%PLUGIN_DIR%\Binaries\Linux"
14+
set "LINUX_SOURCE_DIR=%PLUGIN_DIR%\Source\ThirdParty\Linux\bin"
15+
16+
REM Copy crashpad handler to plugin's Binaries\Linux for cross-compilation on Windows
1617
if "%TARGET_PLATFORM%"=="Linux" (
17-
if not exist "%CRASHPAD_HANDLER_LINUX%" (
18-
if not exist "%PLUGIN_DIR%\Binaries\Linux\" (mkdir "%PLUGIN_DIR%\Binaries\Linux")
19-
xcopy "%PLUGIN_DIR%\Source\ThirdParty\Linux\bin\*" "%PLUGIN_DIR%\Binaries\Linux\" /F /R /Y /I
18+
if not exist "%LINUX_BIN_DIR%" (mkdir "%LINUX_BIN_DIR%")
19+
if not exist "%LINUX_BIN_DIR%\crashpad_handler" (
20+
copy /Y "%LINUX_SOURCE_DIR%\crashpad_handler" "%LINUX_BIN_DIR%\"
2021
)
2122
)
2223

23-
REM Copy crashpad handler executable to plugin's Binaries\Win64 dir if it doesn't exist there
24-
REM Epic obfuscates any extra binaries when pre-building the plugin for FAB
25-
set "CRASHPAD_HANDLER_WIN=%PLUGIN_DIR%\Binaries\Win64\crashpad_handler.exe"
24+
set "WIN64_BIN_DIR=%PLUGIN_DIR%\Binaries\Win64"
25+
set "WIN64_SOURCE_DIR=%PLUGIN_DIR%\Source\ThirdParty\Win64\bin"
26+
27+
REM Copy crashpad binaries to plugin's Binaries\Win64 (FAB compatibility)
2628
if "%TARGET_PLATFORM%"=="Win64" (
27-
if not exist "%CRASHPAD_HANDLER_WIN%" (
28-
if not exist "%PLUGIN_DIR%\Binaries\Win64\" (mkdir "%PLUGIN_DIR%\Binaries\Win64")
29-
xcopy "%PLUGIN_DIR%\Source\ThirdParty\Win64\bin\*" "%PLUGIN_DIR%\Binaries\Win64\" /F /R /Y /I
29+
if not exist "%WIN64_BIN_DIR%" (mkdir "%WIN64_BIN_DIR%")
30+
if not exist "%WIN64_BIN_DIR%\crashpad_handler.exe" (
31+
copy /Y "%WIN64_SOURCE_DIR%\crashpad_handler.exe" "%WIN64_BIN_DIR%\"
32+
)
33+
if not exist "%WIN64_BIN_DIR%\crashpad_wer.dll" (
34+
copy /Y "%WIN64_SOURCE_DIR%\crashpad_wer.dll" "%WIN64_BIN_DIR%\"
3035
)
3136
)
3237

0 commit comments

Comments
 (0)