Bug 1349694 - only build gkrust-gtest when we build libxul-gtest; r=chmanchester

To improve build times, we've decided to only build libxul-gtest when
it's specifically requested, i.e. via `mach gtest` or similar.  However,
our build setup specifies that gkrust-gtest, the Rust code specifically
for libxul-gtest, is built during normal builds.  This library takes a
significant amount of time to compile and is generally not needed.

This patch changes the gkrust-gtest library to only be visible under the
same conditions that libxul-gtest is built, thus speeding up normal
builds.
This commit is contained in:
Nathan Froyd 2017-03-28 17:02:37 -04:00
Родитель 7bf131a182
Коммит d9848cf82a
1 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,29 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# This file looks quite similar to toolkit/library/gtest/Makefile.in.
# We only want to build gkrust-gtest when we are building libxul-gtest.
# Enforce that the clean/distclean rules removes everything that needs
# to be removed from this directory.
ifneq (,$(filter clean distclean,$(MAKECMDGOALS)))
LINK_GTEST_DURING_COMPILE = 1
endif
# Don't build gkrust-gtest during MOZ_PROFILE_GENERATE, it doesn't get
# used during profiling anyway.
ifdef MOZ_PROFILE_GENERATE
LINK_GTEST_DURING_COMPILE =
endif
ifndef LINK_GTEST_DURING_COMPILE
# Force to not include backend.mk unless LINK_GTEST_DURING_COMPILE is set.
# Not including backend.mk makes traversing this directory do nothing.
STANDALONE_MAKEFILE = 1
else
include $(topsrcdir)/config/config.mk
endif