-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add analogue to _concat for writable directories
The regular _concat function, when processing a list of strings, adds a prefix+suffix to each, possibly after expanding the list through a call to a function. The function is often RDirs, which can add additional paths (repositories, usually). This is used for things like path-to-include dir so we get "-Iinclude" etc. When used for a directory which we tell the compiler to write to, as opposed to just search, this can give the wrong result. For example, for $FORTRANMODIR, which describes where to put generated module files, we only want to write to the target directory (and in fact, for gfortran, it's an error to specify the module-write-dir more than once), but we might want to still search the backing directories - any repository, and in case of non-duplicating variantdir, the directory of the original source - in case there were already module files there that can be used. This new function wraps the first string from the expanded list in the prefix/suffix, and any remaining strings in the extra_prefix and extra_suffix arguments, for example to produce "-Jtargetmoddir -Isourcemoddir -Irepository" instead of "-Jtargetmoddir -Jsourcemoddir -Jrepository". The latter would abort the Fortran compiler with an error, and the equivalent for the D compilers would ignore the first (correct) directory and select the last one for use. In any case, we're not allowed to write to the repository, so the previous behavior using _concat was definitely wrong. Signed-off-by: Mats Wichmann <[email protected]>
- Loading branch information
Showing
9 changed files
with
247 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters