Custom Build Step

Offload™ can be used as a custom build step in Visual Studio or in a makefile, it is just a compiler that takes input files and compiler options and produces an object file.When using Offload™ as a custom build step, ensure that the correct environment variables have been set prior to performing the operation. Some developers using Offload™ have found that having a wrapper batch file to set the required variables prior to execution is useful, and below you will find an example batch file you could use!

@echo off

setlocal

set OFFLOADFOLDER=%~dp0
set SIEVE_PS3_SDK=%OFFLOADFOLDER%offload-sdk

if not "%PATH%"=="" set PATH=;%PATH%
set PATH=%OFFLOADFOLDER%%PATH%

if not "%INCLUDE%"=="" set INCLUDE=;%INCLUDE%
set INCLUDE=%OFFLOADFOLDER%offload-sdkinclude%INCLUDE%

set CMDS=%*
set OCDIR=

set TMP=%1" "
set TMP=%TMP:"=%

:loop

if "%TMP%"==" " goto continue

if "%TMP%"=="-ocdir " set OCDIR=%~2

shift
set TMP=%1" "
set TMP=%TMP:"=%

goto loop

:continue

if not "%OCDIR%"=="" rmdir /S /Q "%OCDIR%"

%OFFLOADFOLDER%offloadps3cpp.exe %CMDS%

The above batch file example assumes that the offload-sdk folder is in the same folder as the OffloadPS3CPP.exe executable and the batchfile, and that the batchfile is being called with a fully qualified path, e.g. 'C:yourpath ooffloadatchfile.bat'. It will also attempt to remove the previous iterations OutputC folder, as is recommended.