зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1340588 - enable clang-cl to generate depfiles directly, rather than using a wrapper; r=build-peer
We use a wrapper script when compiling with MSVC to parse the /showIncludes output and thereby generate a Makefile dependency fragment. This fragment enables us to do correct and faster incremental builds. But the cost of invoking the wrapper script can be significant; it's an extra process or two to launch for every single compilation. Instead, let's have clang-cl generate the dependencies directly, which should be somewhat faster.
This commit is contained in:
Родитель
2c3aa80457
Коммит
2f491089d2
|
@ -120,8 +120,11 @@ CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
|
|||
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
|
||||
|
||||
ifdef _MSC_VER
|
||||
# clang-cl is smart enough to generate dependencies directly.
|
||||
ifndef CLANG_CL
|
||||
CC_WRAPPER ?= $(call py_action,cl)
|
||||
CXX_WRAPPER ?= $(call py_action,cl)
|
||||
endif # CLANG_CL
|
||||
endif # _MSC_VER
|
||||
|
||||
CC := $(CC_WRAPPER) $(CC)
|
||||
|
|
|
@ -1603,6 +1603,13 @@ MOZ_ARG_HEADER(Build dependencies)
|
|||
if test "$GNU_CC" -a "$GNU_CXX"; then
|
||||
_DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
|
||||
else
|
||||
# clang-cl doesn't accept the normal -MD -MP -MF options that clang does, but
|
||||
# the underlying cc1 binary understands how to generate dependency files.
|
||||
# These options are based on analyzing what the normal clang driver sends to
|
||||
# cc1 when given the "correct" dependency options.
|
||||
if test -n "$CLANG_CL"; then
|
||||
_DEPEND_CFLAGS='-Xclang -MP -Xclang -MG -Xclang -dependency-file -Xclang $(MDDEPDIR)/$(@F).pp -Xclang -MT -Xclang $@'
|
||||
fi
|
||||
dnl Don't override this for MSVC
|
||||
if test -z "$_WIN32_MSVC"; then
|
||||
_USE_CPP_INCLUDE_FLAG=
|
||||
|
|
|
@ -3856,6 +3856,13 @@ if test "$COMPILE_ENVIRONMENT"; then
|
|||
if test "$GNU_CC" -a "$GNU_CXX"; then
|
||||
_DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
|
||||
else
|
||||
# clang-cl doesn't accept the normal -MD -MP -MF options that clang does, but
|
||||
# the underlying cc1 binary understands how to generate dependency files.
|
||||
# These options are based on analyzing what the normal clang driver sends to
|
||||
# cc1 when given the "correct" dependency options.
|
||||
if test -n "$CLANG_CL"; then
|
||||
_DEPEND_CFLAGS='-Xclang -MP -Xclang -MG -Xclang -dependency-file -Xclang $(MDDEPDIR)/$(@F).pp -Xclang -MT -Xclang $@'
|
||||
fi
|
||||
dnl Don't override this for MSVC
|
||||
if test -z "$_WIN32_MSVC"; then
|
||||
_USE_CPP_INCLUDE_FLAG=
|
||||
|
|
Загрузка…
Ссылка в новой задаче