My goal is to include referenced headers from INET-Framework with -isystem instead of -I . The reason is that INETs warnings spam my IDE and I don't find the problems caused by my own project. Also it prevents me from using -Werror. Until now I was able to do that with the following in the makefrag of my project:
# use -isystem instead of -I flag, to hide warnings in these files
RELPRJDOTS = $(subst o,,$(subst o ,/,$(patsubst %,..o,$(subst /, ,$(PROJECTRELATIVE_PATH)))))
ifneq (,$(findstring MSYS,$(shell uname -s)))
# on windows we need this hack for pathes like -Id:/...
override COPTS := $(shell echo '$(subst -I$(RELPRJDOTS)/.,-isystem $(RELPRJDOTS)/.,$(COPTS))' |sed -e 's/-I\($(subst \| ,\|,$(addsuffix \|,$(filter %:,$(subst :,: ,$(patsubst -I%,%,$(COPTS))))) \/)\)/-isystem \1/g')
else
# on unix we can use this
override COPTS := $(subst -I/,-isystem /,$(subst -I$(RELPRJDOTS)/.,-isystem $(RELPRJDOTS)/.,$(COPTS)))
endif
$(info Replaced COPTS -I directives with -isystem directive: $(COPTS))
This way all INET includes were changed and everything was nice and clean. But with OMNeT++ 5.1 the way dependencies are used will change and it is not possible anymore to use simple variables. Thus my override COPTS := will not work anymore, the variable must be recursively expanded in the target. But it is not possible to use a recursive variable in its assignment, thus I cannot change it to COPTS = ...
Has anyone a good idea, how I can get my makefile to include the referenced headers with -isystem?
Best regards
Till
Best regards
Till
# add -isystem for referenced projects (-I will be ignored for those also provided with -Isystem)
RELPRJDOTS = $(subst o,,$(subst o ,/,$(patsubst %,..o,$(subst /, ,$(PROJECTRELATIVE_PATH)))))
ifneq (,$(findstring MSYS,$(shell uname -s)))
# on windows we need this hack for pathes like -Id:/...
SYSINCLUDES := $(shell echo '$(subst -I$(RELPRJDOTS)/.,-isystem $(RELPRJDOTS)/.,$(INCLUDE_PATH))' |sed -e 's/-I\($(subst \| ,\|,$(addsuffix \|,$(filter %:,$(subst :,: ,$(patsubst -I%,%,$(INCLUDE_PATH))))) \/)\)/-isystem \1/g')
else
# on unix we can use this
SYSINCLUDES := $(subst -I/,-isystem /,$(subst -I$(RELPRJDOTS)/.,-isystem $(RELPRJDOTS)/.,$(INCLUDE_PATH)))
endif
COPTS += $(SYSINCLUDES) -isystem $(OMNETPP_INCL_DIR)
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.
Till
Wian, remove all your posts in this thread as it is not related. Just make sure you have your separate post and hopefully someone will answer you.
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+unsubscribe@googlegroups.com.