Skip to content

Standard C++ header names may conflict with target names #4414

Open
@mwichmann

Description

@mwichmann

The C++ standard defines a number of headers which do not have filename suffixes. This seems to cause problems when the scanner detects usage of such a header and a target has the same name. For reference, here's an informal listing: https://en.cppreference.com/w/cpp/header

A very simple example (similar to one in the email thread) shows this:

#include <map>

int main(int, char **) { }

SConstruct:

Program("map", "map.cc")

Results:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: done building targets.

scons: *** Found dependency cycle(s):
  map -> map.o -> map

File "/home/mats/github/scons/SCons/Taskmaster/__init__.py", line 1128, in cleanup

Since <map> is not in the build directory (on this particular system, it lives in /usr/include/c++/13/debug/map) this shouldn't be any conflict, but I'm guessing we don't know that in the place it's being looked at. At the very least, docs need to provide some guidance about this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions