Bug 1316545 part 4 - Run clang.exe instead of clang-cl.exe for loading the plugin. r?glandium draft
authorTing-Yu Chou <janus926@gmail.com>
Tue, 22 Nov 2016 14:20:58 +0800
changeset 443889 e3679ac5ad587724c15a9d84a0935025d9486008
parent 443883 e06fcd49e94fb7a043f1445587da7cf1c0bafb42
child 443890 954a523364f3c171a018e4db9b4f8c47c391dc7b
push id37133
push userbmo:janus926@gmail.com
push dateFri, 25 Nov 2016 11:04:17 +0000
reviewersglandium
bugs1316545
milestone53.0a1
Bug 1316545 part 4 - Run clang.exe instead of clang-cl.exe for loading the plugin. r?glandium MozReview-Commit-ID: K85tFo0nzoI
build/clang-plugin/tests/Makefile.in
--- a/build/clang-plugin/tests/Makefile.in
+++ b/build/clang-plugin/tests/Makefile.in
@@ -1,16 +1,24 @@
 # 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/.
 
 # Build without any warning flags, and with clang verify flag for a
 # syntax-only build (no codegen), without a limit on the number of errors.
-OS_CFLAGS := $(filter-out -W%,$(OS_CFLAGS)) -fsyntax-only -Xclang -verify -ferror-limit=0 -std=c11
-OS_CXXFLAGS := $(filter-out -W%,$(OS_CXXFLAGS)) -fsyntax-only -Xclang -verify -ferror-limit=0
+OS_CFLAGS := $(filter-out -W% -w%,$(OS_CFLAGS)) -fsyntax-only -Xclang -verify -ferror-limit=0 -std=c11
+OS_CXXFLAGS := $(filter-out -W% -w%,$(OS_CXXFLAGS)) -fsyntax-only -Xclang -verify -ferror-limit=0
+
+# 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
 
 include $(topsrcdir)/config/rules.mk
 
 target:: $(OBJS)
 
 # We don't actually build anything.
 .PHONY: $(OBJS)