Next: , Previous: Source Files and Directories, Up: Building With Projects


11.2.2 Duplicate Sources in Projects

If the order of the source directories is known statically, that is if "/**" is not used in the string list Source_Dirs, then there may be several files with the same source file name sitting in different directories of the project. In this case, only the file in the first directory is considered as a source of the project and the others are hidden. If "/**" is used in the string list Source_Dirs, it is an error to have several files with the same source file name in the same directory "/**" subtree, since there would be an ambiguity as to which one should be used. However, two files with the same source file name may exist in two single directories or directory subtrees. In this case, the one in the first directory or directory subtree is a source of the project.

If there are two sources in different directories of the same "/**" subtree, one way to resolve the problem is to exclude the directory of the file that should not be used as a source of the project.