function ret = isRemoteBuild(tfToolchain)
% Helper to find out if a given instance of a TF toolchain is
% remote over SSH and CMake-based.
%
% Copyright 2023 The MathWorks, Inc.
    
    arguments
        tfToolchain target.internal.Toolchain
    end
    if ~isempty(tfToolchain) && ...
            isa(tfToolchain.Builder, 'target.internal.CMakeBuilder') && ...
            ~isempty(tfToolchain.RunsOn)
        ret = isa(tfToolchain.RunsOn, 'target.internal.SSHExecutionContext');
    else
        ret = false;
    end
end
