function addOrUpdateBuildToolDirective(h,directive)

% Copyright 2014 The MathWorks, Inc.

tools = h.BuildTools.keys();
builderFileSep = h.BuilderApplication.getDirective( directive );
for i = 1:numel( tools )
tool = h.getBuildTool( tools{ i } );
if ~tool.Directives.isKey( directive )
tool.Directives.append( directive, coder.make.BuildItem( builderFileSep ) );
elseif isempty( tool.getDirective( directive ) )
tool.setDirective( directive, builderFileSep );
end
end
end