mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-10 11:29:09 -05:00
automoc: revert attempts to silence linker warning on macos
We've made several attempts to add a dummy symbol to `mocs_compilation.cpp` when there are no automoc sources: * commit4a9daae483(automoc: silence linker warning on macos, 2022-05-25, v3.24.0-rc1~55^2) * commit844244ccdc(automoc: avoid compiler warnings in linker-warning- silencing code, 2022-08-10, v3.24.1~6^2) * commitfc8628389f(automoc: avoid more compiler warnings in linker- warning-silencing code, 2022-08-29) The last attempt derives a symbol name from the path to the source file, but that breaks reproducible builds because it is not stable w.r.t. the location of the build tree. Revert all these attempts for the 3.24 release series, and return to what 3.23 and below did. Further investigation will be needed to resolve the original issue. Fixes: #23937 Issue: #23551, #23823, #23823
This commit is contained in:
@@ -2175,18 +2175,9 @@ void cmQtAutoMocUicT::JobMocsCompilationT::Process()
|
||||
|
||||
if (this->MocEval().CompFiles.empty()) {
|
||||
// Placeholder content
|
||||
cmCryptoHash hash(cmCryptoHash::AlgoSHA256);
|
||||
const std::string hashedPath = hash.HashString(compAbs);
|
||||
const std::string functionName =
|
||||
"cmake_automoc_silence_linker_warning" + hashedPath;
|
||||
|
||||
content += "// No files found that require moc or the moc files are "
|
||||
"included\n"
|
||||
"void " +
|
||||
functionName +
|
||||
"();\n"
|
||||
"void " +
|
||||
functionName + "() {}\n";
|
||||
"enum some_compilers { need_more_than_nothing };\n";
|
||||
} else {
|
||||
// Valid content
|
||||
const bool mc = this->BaseConst().MultiConfig;
|
||||
|
||||
Reference in New Issue
Block a user