[iperf] Enable building iperf3 on the host. This is handy for host based tests where we want to run iperf sessions across host and target device and expect the iperf3 versions of both ends to be the same. Change-Id: I921b9f17462688eb655da66a707b62508b4f6e35
diff --git a/BUILD.gn b/BUILD.gn index 29779e6..304c9ba 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -27,9 +27,17 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import("//build/host.gni") import("//build/package.gni") -package("iperf") { +group("iperf") { + deps = [ + ":host_tools", + ":iperf3", + ] +} + +package("iperf3") { meta = [ { path = "meta/iperf3.cmx" @@ -37,7 +45,7 @@ }, ] - deps = [ ":iperf3" ] + deps = [ ":bin" ] binaries = [ { @@ -57,7 +65,8 @@ public_deps = [ "//zircon/public/lib/fdio" ] } -executable("iperf3") { +executable("bin") { + output_name = "iperf3" sources = [ "src/cjson.c", "src/dscp.c", @@ -88,6 +97,16 @@ "-Wno-pointer-sign", "-Wno-sign-compare", ] - libs = [ "zircon" ] - deps = [ ":fuchsia-compat" ] + if (is_fuchsia) { + libs = [ "zircon" ] + deps = [ ":fuchsia-compat" ] + } +} + +install_host_tools("host_tools") { + deps = [ ":bin" ] + + # Note that for convenience, we are compiling iperf3 on the host-build + # with src/iperf_config.h used in Fuchsia build. + outputs = [ "iperf3" ] }