Bug 1316545 part 4 - Run clang.exe instead of clang-cl.exe for loading the plugin. r=ehsan,glandium
authorTing-Yu Chou <janus926@gmail.com>
Tue, 22 Nov 2016 14:20:58 +0800
changeset 372366 46bc9b15800185d4d814a95ae379cf069740f01a
parent 372365 5cbc0be626a0f3f55f5b243d6b3a6d2d97287e83
child 372367 8a86e67f78c60c44a4ce2aac416e8835a76351a4
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, glandium
bugs1316545
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1316545 part 4 - Run clang.exe instead of clang-cl.exe for loading the plugin. r=ehsan,glandium MozReview-Commit-ID: K85tFo0nzoI
config/static-checking-config.mk
--- a/config/static-checking-config.mk
+++ b/config/static-checking-config.mk
@@ -1,12 +1,20 @@
 # 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/.
 
 # The entire tree should be subject to static analysis using the XPCOM
 # script. Additional scripts may be added by specific subdirectories.
 
 ifdef ENABLE_CLANG_PLUGIN
+# Replace "clang-cl.exe" to "clang.exe --driver-mode=cl" to avoid loading the
+# module clang.exe again when load the plugin dll, which links to the import
+# library of clang.exe.
+ifeq ($(OS_ARCH),WINNT)
+CC := $(subst clang-cl.exe,clang.exe --driver-mode=cl,$(CC:.EXE=.exe))
+CXX := $(subst clang-cl.exe,clang.exe --driver-mode=cl,$(CXX:.EXE=.exe))
+endif
+
 CLANG_PLUGIN := $(topobjdir)/build/clang-plugin/$(DLL_PREFIX)clang-plugin$(DLL_SUFFIX)
 OS_CXXFLAGS += -Xclang -load -Xclang $(CLANG_PLUGIN) -Xclang -add-plugin -Xclang moz-check
 OS_CFLAGS += -Xclang -load -Xclang $(CLANG_PLUGIN) -Xclang -add-plugin -Xclang moz-check
 endif