function copyToolchainInfo(h,src)

%   Copyright 2014-2020 The MathWorks, Inc.

if ~strcmp( class( h ), class( src ) )
    error( message( 'coder_compile:toolchain:CannotCloneClassMismatch', class( src ), class( h ) ) );
end
% Initialize the class
h.initialize( 'BuildArtifact', src.BuildArtifact, 'SupportedLanguages', src.SupportedLanguages, 'BuildArtifactWriter', src.BuildArtifactWriter, 'BuildArtifactExecutor', src.BuildArtifactExecutor, 'InitOnly', true );
% Start copying
h.Name = src.Name;
h.Alias = src.Alias;
h.SupportedLanguages = src.SupportedLanguages;
h.BuilderApplication.clone( src.BuilderApplication );
h.MATLABSetup = src.MATLABSetup;
h.MATLABCleanup = src.MATLABCleanup;
h.ShellSetup = src.ShellSetup;
h.ShellCleanup = src.ShellCleanup;
h.InlinedCommands = src.InlinedCommands;
h.Revision = src.Revision;
h.Platform = src.Platform;
h.SupportedVersion = src.SupportedVersion;
h.FormatVersion = src.FormatVersion;
h.ReservedNames = src.ReservedNames;
h.SupportsBuildingMEXFuncs = src.SupportsBuildingMEXFuncs;
h.BuildArtifact = src.BuildArtifact;
h.BuildArtifactType = src.BuildArtifactType;
h.BuildArtifactWriter = src.BuildArtifactWriter;
h.BuildArtifactExecutor = src.BuildArtifactExecutor;
coder.make.internal.copyListProperty( 'BuildTools', src, h );
coder.make.internal.copyListProperty( 'PrebuildTools', src, h );
coder.make.internal.copyListProperty( 'PostbuildTools', src, h );
coder.make.internal.copyListProperty( 'BuildConfigurations', src, h );
coder.make.internal.copyListProperty( 'Macros', src, h );
coder.make.internal.copyListProperty( 'Attributes', src, h );
if ~isempty( src.CustomBuildConfigurations )
    coder.make.internal.copyListProperty( 'CustomBuildConfigurations', src, h );
end
end
