%% SetupFcn for sldemo_parallel_rapid_accel_sims_script

% Copyright 2017-2018 The MathWorks, Inc.

function sldemo_parallel_rapid_accel_sims_script_setup(mdl)
    % Temporarily change the current folder on the workers to an empty
    % folder so that any existing slprj folder on the client does not
    % interfere in the build process.
    currentFolder = pwd;
    tempDir = tempname;
    mkdir(tempDir);
    cd (tempDir);
    oc = onCleanup(@() cd (currentFolder));
    Simulink.BlockDiagram.buildRapidAcceleratorTarget(mdl);
end