diff --git a/Makefile b/Makefile index 59c4ef76..5c73a08b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 667f1887..1a22a090 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -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]) diff --git a/configure b/configure index 6775975c..171d4e3f 100755 --- a/configure +++ b/configure @@ -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}` diff --git a/libexec/trick/pm/parse_s_define.pm b/libexec/trick/pm/parse_s_define.pm index 4c609891..c0313c50 100644 --- a/libexec/trick/pm/parse_s_define.pm +++ b/libexec/trick/pm/parse_s_define.pm @@ -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}}) { diff --git a/share/trick/makefiles/Makefile.common b/share/trick/makefiles/Makefile.common index ccc2ebb1..8a84fa6b 100644 --- a/share/trick/makefiles/Makefile.common +++ b/share/trick/makefiles/Makefile.common @@ -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 "}') diff --git a/share/trick/makefiles/config_user_cmake.mk.in b/share/trick/makefiles/config_user_cmake.mk.in index 44f7bd76..b745a321 100644 --- a/share/trick/makefiles/config_user_cmake.mk.in +++ b/share/trick/makefiles/config_user_cmake.mk.in @@ -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. diff --git a/trick_source/sim_services/MemoryManager/test/Makefile b/trick_source/sim_services/MemoryManager/test/Makefile index f55b6ae4..6ffd6553 100644 --- a/trick_source/sim_services/MemoryManager/test/Makefile +++ b/trick_source/sim_services/MemoryManager/test/Makefile @@ -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}