adjust clang plugins for srcdir != builddir
Change-Id: Ie4c934b52c4b010703e91f84b83e1fe590b5d187
This commit is contained in:
@@ -37,7 +37,7 @@ CLANGINCLUDES=-I$(CLANGDIR)/include -I$(CLANGDIR)/tools/clang/include -I$(CLANGB
|
|||||||
CLANGINDIR=$(SRCDIR)/compilerplugins/clang
|
CLANGINDIR=$(SRCDIR)/compilerplugins/clang
|
||||||
# Cannot use $(WORKDIR), the plugin should survive even 'make clean', otherwise the rebuilt
|
# Cannot use $(WORKDIR), the plugin should survive even 'make clean', otherwise the rebuilt
|
||||||
# plugin will cause cache misses with ccache.
|
# plugin will cause cache misses with ccache.
|
||||||
CLANGOUTDIR=$(SRCDIR)/compilerplugins/obj
|
CLANGOUTDIR=$(BUILDDIR)/compilerplugins/obj
|
||||||
|
|
||||||
compilerplugins: $(CLANGOUTDIR) $(CLANGOUTDIR)/plugin.so
|
compilerplugins: $(CLANGOUTDIR) $(CLANGOUTDIR)/plugin.so
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ endef
|
|||||||
$(foreach src, $(CLANGSRC), $(eval $(call clangbuildsrc,$(src),$(CLANGINDIR)/$(src),$(CLANGOUTDIR)/$(src:.cxx=.o))))
|
$(foreach src, $(CLANGSRC), $(eval $(call clangbuildsrc,$(src),$(CLANGINDIR)/$(src),$(CLANGOUTDIR)/$(src:.cxx=.o))))
|
||||||
|
|
||||||
$(CLANGOUTDIR)/plugin.so: $(CLANGOBJS)
|
$(CLANGOUTDIR)/plugin.so: $(CLANGOBJS)
|
||||||
@echo [build LNK] $(subst $(SRCDIR)/,,$@)
|
@echo [build LNK] $(subst $(BUILDDIR)/,,$@)
|
||||||
$(CXX) -shared $(CLANGOBJS) -o $@
|
$(CXX) -shared $(CLANGOBJS) -o $@
|
||||||
|
|
||||||
# Clang most probably doesn't maintain binary compatibility, so rebuild when clang changes.
|
# Clang most probably doesn't maintain binary compatibility, so rebuild when clang changes.
|
||||||
|
@@ -161,9 +161,9 @@ gb_LinkTarget_INCLUDE :=\
|
|||||||
|
|
||||||
ifeq ($(COM_GCC_IS_CLANG),TRUE)
|
ifeq ($(COM_GCC_IS_CLANG),TRUE)
|
||||||
ifeq ($(COMPILER_PLUGIN_TOOL),)
|
ifeq ($(COMPILER_PLUGIN_TOOL),)
|
||||||
gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(SRCDIR)/compilerplugins/obj/plugin.so -Xclang -add-plugin -Xclang loplugin
|
gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(BUILDDIR)/compilerplugins/obj/plugin.so -Xclang -add-plugin -Xclang loplugin
|
||||||
else
|
else
|
||||||
gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(SRCDIR)/compilerplugins/obj/plugin.so -Xclang -plugin -Xclang loplugin -Xclang -plugin-arg-loplugin -Xclang $(COMPILER_PLUGIN_TOOL)
|
gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(BUILDDIR)/compilerplugins/obj/plugin.so -Xclang -plugin -Xclang loplugin -Xclang -plugin-arg-loplugin -Xclang $(COMPILER_PLUGIN_TOOL)
|
||||||
endif
|
endif
|
||||||
# extra EF variable to make the command line shorter (just like is done with $(SRCDIR) etc.)
|
# extra EF variable to make the command line shorter (just like is done with $(SRCDIR) etc.)
|
||||||
gb_COMPILER_PLUGINS_SETUP := EF=$(SRCDIR)/sal/inc/sal/log-areas.dox && ICECC_EXTRAFILES=$$EF CCACHE_EXTRAFILES=$$EF
|
gb_COMPILER_PLUGINS_SETUP := EF=$(SRCDIR)/sal/inc/sal/log-areas.dox && ICECC_EXTRAFILES=$$EF CCACHE_EXTRAFILES=$$EF
|
||||||
|
Reference in New Issue
Block a user