Use -isystem for Trick and Python headers

Closes #1067
This commit is contained in:
Derek Bankieris 2020-10-22 14:14:39 -05:00
parent 6618d09c15
commit 1e8228e344
7 changed files with 14 additions and 7 deletions

View File

@ -190,6 +190,8 @@ $(ER7_UTILS_DIRS): icg_sim_serv
# 1.1.1.4 Generate interface code (using ICG) for the specified sim_services
# header files.
.PHONY: icg_sim_serv
# Replace -isystem with -I so ICG doesn't skip Trick headers
icg_sim_serv: TRICK_SYSTEM_CXXFLAGS := $(subst -isystem,-I,$(TRICK_SYSTEM_CXXFLAGS))
icg_sim_serv: $(ICG_EXE)
${ICG_EXE} -sim_services -m ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_HOME}/include/trick/files_to_ICG.hh
@ -469,6 +471,8 @@ uninstall:
################################################################################
# ICG all sim_services files (for testing and debugging ICG).
# The -f flag forces io_src files to be regenerated whether or not they need to be.
# Replace -isystem with -I so ICG doesn't skip Trick headers
ICG: TRICK_SYSTEM_CXXFLAGS := $(subst -isystem,-I,$(TRICK_SYSTEM_CXXFLAGS))
ICG: $(ICG_EXE)
$(ICG_EXE) -f -s -m -n ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_HOME}/include/trick/files_to_ICG.hh

View File

@ -410,7 +410,7 @@ AX_COMPARE_VERSION(
[PYTHON_LIBS_COMMAND="${PYTHON_LIBS_COMMAND} --embed"]
)
PYTHON_CPPFLAGS=`${PYTHON_CONFIG} --includes`
PYTHON_CPPFLAGS=`${PYTHON_CONFIG} --includes | sed 's/-I/-isystem/g'`
PYTHON_LIBS=`${PYTHON_LIBS_COMMAND}`
AC_SUBST([PYTHON_CPPFLAGS])

2
configure vendored
View File

@ -5599,7 +5599,7 @@ x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version
fi
PYTHON_CPPFLAGS=`${PYTHON_CONFIG} --includes`
PYTHON_CPPFLAGS=`${PYTHON_CONFIG} --includes | sed 's/-I/-isystem/g'`
PYTHON_LIBS=`${PYTHON_LIBS_COMMAND}`

View File

@ -176,7 +176,7 @@ sub parse_s_define ($) {
my @preprocess_output;
@{$$sim_ref{inc_paths}} = (get_include_paths(), $ENV{TRICK_SYSTEM_CFLAGS} =~ /-I(\S+)/g, "$ENV{TRICK_HOME}/trick_source" , "../include") ;
@{$$sim_ref{inc_paths}} = (get_include_paths(), $ENV{TRICK_SYSTEM_CFLAGS} =~ /-(?:I|isystem)(\S+)/g, "$ENV{TRICK_HOME}/trick_source" , "../include") ;
my @valid_inc_paths ;
foreach (@{$$sim_ref{inc_paths}}) {

View File

@ -90,7 +90,7 @@ else
LIBEXEC = lib
endif
TRICK_INCLUDES := -I${TRICK_HOME}/trick_source -I${TRICK_HOME}/include -I${TRICK_HOME}/include/trick/compat
TRICK_INCLUDES := -isystem${TRICK_HOME}/trick_source -isystem${TRICK_HOME}/include -isystem${TRICK_HOME}/include/trick/compat
TRICK_VERSIONS := -DTRICK_VER=$(TRICK_MAJOR) -DTRICK_MINOR=$(TRICK_MINOR)
export TRICK_SYSTEM_CXXFLAGS := $(TRICK_INCLUDES) $(TRICK_VERSIONS) -fpic $(UDUNITS_INCLUDES)
@ -190,8 +190,8 @@ export TRICK_SYSTEM_CFLAGS := $(TRICK_SYSTEM_CXXFLAGS) -fexceptions
TRICK_SYSTEM_CFLAGS += $(TRICK_ADDITIONAL_CFLAGS)
TRICK_SYSTEM_CXXFLAGS += $(TRICK_ADDITIONAL_CXXFLAGS)
TRICK_INCLUDE = $(shell $(PERL) -e '@inc_paths = "${TRICK_CFLAGS}" =~ /-I\s*(\S+)/g ; foreach $$i (@inc_paths) { print "-I$$i " if (-e $$i and $$i ne "/usr/include")}') \
$(shell $(PERL) -e '@inc_paths = "${TRICK_SYSTEM_CFLAGS}" =~ /-I\s*(\S+)/g ; foreach $$i (@inc_paths) { print "-I$$i " if (-e $$i)}')
TRICK_INCLUDE = $(shell $(PERL) -e '@inc_paths = "${TRICK_CFLAGS}" =~ /-(?:I|isystem)\s*(\S+)/g ; foreach $$i (@inc_paths) { print "-I$$i " if (-e $$i and $$i ne "/usr/include")}') \
$(shell $(PERL) -e '@inc_paths = "${TRICK_SYSTEM_CFLAGS}" =~ /-(?:I|isystem)\s*(\S+)/g ; foreach $$i (@inc_paths) { print "-I$$i " if (-e $$i)}')
TRICK_DEFINES = $(shell $(PERL) -e '@defines = "${TRICK_CFLAGS}" =~ /-D\s*(\S+)/g ; foreach $$i (@defines) { print "-D$$i "}') \
$(shell $(PERL) -e '@defines = "${TRICK_SYSTEM_CFLAGS}" =~ /-D\s*(\S+)/g ; foreach $$i (@defines) { print "-D$$i "}')

View File

@ -31,7 +31,7 @@ ICG_CLANGLIBS = \
-lclangLex \
-lclangBasic \
PYTHON_INCLUDES = -I@PYTHON_INCLUDE_DIRS@
PYTHON_INCLUDES = -isystem@PYTHON_INCLUDE_DIRS@
PYTHON_LIB = @PYTHON_LIBRARIES@
# Only add udunits include if it is not in /usr/include.

View File

@ -7,6 +7,9 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../share/trick/makefiles/Makefile.common
# Replace -isystem with -I so ICG doesn't skip Trick headers
TRICK_SYSTEM_CXXFLAGS := $(subst -isystem,-I,$(TRICK_SYSTEM_CXXFLAGS))
#COVERAGE_FLAGS += -fprofile-arcs -ftest-coverage -O0
#TRICK_SYSTEM_LDFLAGS += ${COVERAGE_FLAGS}