function val = getCompilerRequirements(this)
%getCompilerRequirements returns a CompilerRequirements object aggregating compiler 
% requirements for the current buildInfo and all its sub-components

% Copyright 2021 The MathWorks, Inc.

val = this.CompilerRequirementsDirect;

% Child buildInfos must be loaded
loadChildBuildInfos(this);

% Acquire compiler requirements affecting link information from child buildInfos
childBuildInfos = [this.LinkablesInternal.BuildInfoHandle];
for i=1:length(childBuildInfos)
    % Propagate compiler requirements impacting linker configuration
    val = acquireLinkRequirementsFromChild...
          (val, childBuildInfos(i).CompilerRequirementsDirect);
end
