Skip to content

Commit

Permalink
bazel: add release configuration (#155)
Browse files Browse the repository at this point in the history
Adds a `--config=release` option for building with Bazel. At the moment, this ensures that iOS builds include all 4 architectures instead of only x86. In the future, more configurations will likely be added here for better optimization settings.

Risk Level: Low
Testing: Locally
Docs Changes: In PR

Signed-off-by: JP Simard <[email protected]>
  • Loading branch information
rebello95 authored and jpsim committed Nov 28, 2022
1 parent e44ab51 commit 21aa3ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions mobile/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ build:device --ios_multi_cpus=armv7,arm64 --fat_apk_cpu=armeabi-v7a,arm64-v8a
build:sim --ios_multi_cpus=i386,x86_64 --fat_apk_cpu=x86,x86_64

build:fat --ios_multi_cpus=i386,x86_64,armv7,arm64 --fat_apk_cpu=x86,x86_64,armeabi-v7a,arm64-v8a

# TODO: Enable `--copt -ggdb3`. Using this configuration currently requires python3.
# https://github.com/lyft/envoy-mobile/pull/155#issuecomment-507461500
# https://stackoverflow.com/a/38177538/1145804
build:release \
--linkopt=-s \
--copt=-O2 \
--config=fat
9 changes: 7 additions & 2 deletions mobile/docs/root/start/building/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Android AAR
Envoy Mobile can be compiled into an ``.aar`` file for use with Android apps.
This command is defined in the main :repo:`BUILD <BUILD>` file of the repo, and may be run locally:

``./bazelw build android_dist --config=android``
``./bazelw build android_dist --config=android --config=release # omit release for development``

Upon completion of the build, you'll see an ``envoy.aar`` file at :repo:`dist/envoy.aar <dist>`.

Expand All @@ -64,6 +64,8 @@ an example of how this artifact may be used.

For a demo of a working app using this artifact, see the :ref:`hello_world` example.

When building the artifact for release (usage outside of development), be sure to include ``--config=release``

.. _ios_framework:

--------------------
Expand All @@ -73,7 +75,7 @@ iOS static framework
Envoy Mobile supports being compiled into a ``.framework`` directory for consumption by iOS apps.
This command is defined in the main :repo:`BUILD <BUILD>` file of the repo, and may be run locally:

``./bazelw build ios_dist --config=ios``
``./bazelw build ios_dist --config=ios --config=release # omit release for development``

Upon completion of the build, you'll see a ``Envoy.framework`` directory at
:repo:`dist/Envoy.framework <dist>`.
Expand All @@ -86,6 +88,9 @@ example of how this artifact may be used.

For a demo of a working app using this artifact, see the :ref:`hello_world` example.

When building the artifact for release (usage outside of development), be sure to include ``--config=release``
in addition to ``--config=ios``.

.. _releases: https://github.com/lyft/envoy-mobile/releases

---------
Expand Down

0 comments on commit 21aa3ad

Please sign in to comment.