summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-08-03 17:38:21 (GMT)
committerBrad King <brad.king@kitware.com>2022-08-03 18:58:47 (GMT)
commit5e0b06fe849ee035bedbeac1bd2bfe05f7f8d860 (patch)
tree44f64b7e1e85375dce2816e19428f118e1d6a522 /Source/cmGlobalUnixMakefileGenerator3.h
parent9d24d62098d6bf2f9dc4c8e97b39310181443ba3 (diff)
downloadCMake-5e0b06fe849ee035bedbeac1bd2bfe05f7f8d860.zip
CMake-5e0b06fe849ee035bedbeac1bd2bfe05f7f8d860.tar.gz
CMake-5e0b06fe849ee035bedbeac1bd2bfe05f7f8d860.tar.bz2
Makefiles: Restore path consistency in the global dispatch makefile
Directory-level rules in `CMakeFiles/Makefile2` were previously previously written by each directory's local generator using its own decision for using relative or absolute paths. Since commit d33b12d84b (Add support for build tree symlink inside source tree, 2022-02-25, v3.24.0-rc1~583^2), each local generator explicitly models the relationship between its source and build paths, and uses this to determine when it is safe to use relative paths. Because `add_subdirectory` supports arbitrary placement of the source and build directories, different local generators may have different relationships between their source and build paths. This can cause disagreement among rules written to `CMakeFiles/Makefile2`. Restore consistency by always using the root local generator to write rules to `CMakeFiles/Makefile2`. Relative paths should always be expressed w.r.t. the top-level build directory since that is the working directory in which the `make` tool processing the file will run. Fixes: #23814
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.h')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 5157826..b9d333e 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -200,13 +200,16 @@ protected:
void WriteMainCMakefile();
void WriteConvenienceRules2(std::ostream& ruleFileStream,
- cmLocalUnixMakefileGenerator3&);
+ cmLocalUnixMakefileGenerator3& rootLG,
+ cmLocalUnixMakefileGenerator3& lg);
void WriteDirectoryRule2(std::ostream& ruleFileStream,
+ cmLocalUnixMakefileGenerator3& rootLG,
DirectoryTarget const& dt, const char* pass,
bool check_all, bool check_relink,
std::vector<std::string> const& commands = {});
void WriteDirectoryRules2(std::ostream& ruleFileStream,
+ cmLocalUnixMakefileGenerator3& rootLG,
DirectoryTarget const& dt);
void AppendGlobalTargetDepends(std::vector<std::string>& depends,