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 325124 46bc9b15800185d4d814a95ae379cf069740f01a
parent 325123 5cbc0be626a0f3f55f5b243d6b3a6d2d97287e83
child 325125 8a86e67f78c60c44a4ce2aac416e8835a76351a4
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersehsan, glandium
bugs1316545
milestone53.0a1
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