function buildStrategy = getCustomBuildStrategy(buildManager, targetServices)
%GETCUSTOMBUILDSTRATEGY gets the custom build strategy given the current
%build manager and target services. If the target services are backed by
%connectivity configurations then we need to create the custom build
%strategy.

%   Copyright 2020 The MathWorks, Inc.

    arguments
        buildManager (1,1) rtw.pil.ApplicationBuildManager
        targetServices (1,1) coder.connectivity.targetservices.ITargetServices
    end
        
    buildStrategy = rtw.pil.ApplicationBuildManager.empty();
    
    % dispatch the target services instance, only coder connectivity specifies a non-default build strategy
    if (isa(targetServices, 'coder.connectivity.connectivityconfig.TargetServices'))
        buildStrategy = targetServices.getBuildStrategy(buildManager);
    end
end
