This is the mail archive of the
mailing list for the GCC project.
[bikeshed] include path search for main file
- From: Nathan Sidwell <nathan at acm dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 8 Jul 2019 07:45:29 -0400
- Subject: [bikeshed] include path search for main file
One of the facilities C++ modules provides is turning header files into
header units. Thus you can say:
(there are some constraints on being able to do that)
This involves compiling the header file, similar to PCH. However,
needing to provide the full path to the header file on the command line
is awkward, and creates adoption friction, because it's one of the first
thing someone might do.
So, I've added a mechanism to search:
g++ --lang c++ -std=c++17 -fmodule-header -search-system iostream
I've decoupled these new options from what one does with the file (hence
the -fmodule-header), or what language (hence --lang c++).
Question: Are -search-system and -search-user sensible names? Should
they be more clearly tied to the main file?
More weedful: I contemplated permitting '<iostream>' and '"foo"' to
indicate this, but (a) our specs pattern matcher doesn't really work
that way, and <, >, " are all shell meta-characters.