Skip to content

Commit 4a1a78b

Browse files
committed
Add a comment explaining the addition to the compiler commands.
1 parent 91b4288 commit 4a1a78b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/truffle/rbconfig-for-mkmf.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@
113113
expanded.merge!(common)
114114
mkconfig.merge!(common)
115115

116+
# We use -I$(<D) (the directory portion of the prerequisite - i.e. the
117+
# C or C++ file) to add the file's path as the first entry on the
118+
# include path. This is to ensure that files from the source file's
119+
# directory are include in preference to others on the include path,
120+
# and is required because we are actually piping the file into the
121+
# compiler which disables this standard behaviour of the C preprocessor.
116122
mkconfig['COMPILE_C'] = "ruby #{cext_dir}/preprocess.rb $< | $(CC) -I$(<D) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG) -xc - -o $@ && #{opt} #{opt_passes} $@ -o $@"
117123
mkconfig['COMPILE_CXX'] = "ruby #{cext_dir}/preprocess.rb $< | $(CXX) -I$(<D) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG) -xc++ - -o $@ && #{opt} #{opt_passes} $@ -o $@"
118124

0 commit comments

Comments
 (0)