function populateBuildInfoForApplicationSpecificParameters(componentArgs, buildInfo)
% Populates the specified build info with component specific (i.e.
% generated) sources files. e.g. the generated code and generated coder
% assumptions files.

% Copyright 2020-2021 The MathWorks, Inc.

% SIL/PIL Wrapper
targetLang = componentArgs.getParam('TargetLang');
[sourceFilename, sourceExt] = ...
rtw.pil.SILPILInterface.getWrapperSourceFilenameAndExt(targetLang);
xilInterfaceFileName = [sourceFilename sourceExt];
wrapperXilSrc = fullfile(componentArgs.getApplicationCodePath(), xilInterfaceFileName);

buildInfo.addSourceFiles({wrapperXilSrc});
buildInfo.addIncludePaths({componentArgs.getApplicationCodePath()});

if (componentArgs.CoderAssumptionsEnabled)

% Coder Assumptions
caPath = coder.assumptions.CoderAssumptions.getBuildFolder(...
componentArgs.getCoderAssumptionsAnchorDir());

buildInfo.addIncludePaths({caPath});

lXilCompInfo = componentArgs.getXilCompInfo();
libExt = lXilCompInfo.XilLibraryExt;

isPWS = strcmp(componentArgs.getConfigInterface.getParam('PortableWordSizes'),'on');
libBuildDir = coder.assumptions.CoderAssumptions.getLibraryBuildFolder( ...
caPath, componentArgs.isSIL, isPWS);
caLibName = fullfile(libBuildDir, ...
coder.assumptions.CoderAssumptions.getLibraryName( ...
componentArgs.getComponentCodeName, libExt));

priority = 1000;
precompiled = true;
linkOnly = true;
[libPath, libName, libExt] = fileparts(caLibName);
buildInfo.addLinkObjects([libName libExt], libPath, priority, precompiled, linkOnly);
end
end