Skip to content
Permalink
Browse files

Update cross compile instructions when using cgo (#2204)

  • Loading branch information...
robbertvanginkel authored and jayconrod committed Sep 10, 2019
1 parent ac1b0e0 commit 37666592344ffc4acd38362c24fcf9c2d51a1a6b
Showing with 8 additions and 0 deletions.
  1. +8 −0 README.rst
@@ -456,6 +456,14 @@ For example:

$ bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd

By default, cgo is disabled when cross-compiling. To cross-compile with cgo,
add a ``_cgo`` suffix to the target platform. You must register a
cross-compiling C/C++ toolchain with Bazel for this to work.

.. code::

$ bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64_cgo //cmd

Platform-specific sources with build tags or filename suffixes are filtered
automatically at compile time. You can selectively include platform-specific
dependencies with ``select`` expressions (Gazelle does this automatically).

0 comments on commit 3766659

Please sign in to comment.
You can’t perform that action at this time.