function addCompileFlags(h, varargin)
% ADDCOMPILEFLAGS - The addCompileFlags function adds specified compiler
% options to the model's build information. Real-Time Workshop stores the
% compiler options in a vector. The function adds options to the end of the
% vector based on the order in which you specify them.
%
% Argument    description
% buildinfo   Build information handle returned by RTW.Buildinfo.
% 
% options     A character array or cell array of character arrays that  
%             specifies the compiler options to be added to the build
%             information. The function adds each option to the end of a
%             compiler option vector. If you specify multiple options
%             within a single character array, for example '-Zi -Wall', the
%             function adds the string to the vector as a single
%             element. 
%
% groups      (optional) A character array or cell array of character arrays
%             that groups specified compiler options
%
% example 1:
%    myModelBuildInfo = RTW.BuildInfo;
%    addCompileFlags(myModelBuildInfo, '-O3','MemOpt')
%
% example 2:
%    myModelBuildInfo = RTW.BuildInfo;
%    addCompileFlags(myModelBuildInfo,{'-Zi -Wall' '-O3'}, {'Debug' 'MemOpt'});
%
% Please refer to the documentation for more information.
%

% Copyright 2005-2020 The MathWorks, Inc.
[varargin{:}] = convertStringsToChars(varargin{:});
h.Options.addOptions('CompileFlags',varargin{:});
