Skip to content

Commit 8fbbf63

Browse files
committed
cmd/cgo: document that #including source files in subdirectories is a bad idea
Suggested in discussion on #26366. Change-Id: Id9ad2e429a915f88b4c4b30fc415c722eebe0ea4 Reviewed-on: https://go-review.googlesource.com/125297 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent f851253 commit 8fbbf63

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/cmd/cgo/doc.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ compiled with the C compiler. Any .cc, .cpp, or .cxx files will be
104104
compiled with the C++ compiler. Any .f, .F, .for or .f90 files will be
105105
compiled with the fortran compiler. Any .h, .hh, .hpp, or .hxx files will
106106
not be compiled separately, but, if these header files are changed,
107-
the C and C++ files will be recompiled. The default C and C++
108-
compilers may be changed by the CC and CXX environment variables,
109-
respectively; those environment variables may include command line
110-
options.
107+
the package (including its non-Go source files) will be recompiled.
108+
Note that changes to files in other directories do not cause the package
109+
to be recompiled, so all non-Go source code for the package should be
110+
stored in the package directory, not in subdirectories.
111+
The default C and C++ compilers may be changed by the CC and CXX
112+
environment variables, respectively; those environment variables
113+
may include command line options.
111114
112115
The cgo tool is enabled by default for native builds on systems where
113116
it is expected to work. It is disabled by default when

0 commit comments

Comments
 (0)