function out = getCustomToolchainOptions(h,option,returnType)

% Copyright 2014-2018 The MathWorks, Inc.

if nargin==1
out = h.BrCustomToolchainOptions;
elseif (nargin>=2)
if (nargin==2)
returnType = 'value';
end
out = [ ];
optionKeys = h.BrCustomToolchainOptions( 1:2:end );
optionIdx = find( cellfun( @any, strfind( optionKeys, option ) ), 1 );
if strcmpi( returnType, 'value' )
if ~isempty( optionIdx )
out = h.BrCustomToolchainOptions{ 2*optionIdx };
end
elseif strcmpi( returnType, 'token' )
optionMacro = h.getCustomToolchainOptionMacros( option );
out = h.getMacroToken( optionMacro );
elseif strcmpi( returnType, 'macro' )
out = h.getCustomToolchainOptionMacros( option );
else
assert( false, [ 'Unrecognized option "', option, '" passed to coder.make.Builder::getCustomToolchainOptions().' ] );
end
end
end