function buildResult = doCompile(varargin)
% CODER.INTERNAL.DOCOMPILE

% Copyright 2016-2020 The MathWorks, Inc.

% Prepare arguments for codebuild
buildFolder = varargin{1};
buildInfo = varargin{2};
buildInfo.ComponentBuildFolder = buildFolder;
lBuildMethod = varargin{3};

% Build using codebuild
buildResult = codebuild(buildInfo, 'BuildMethod', lBuildMethod, varargin{4:end});