FASTBuild: fix inconsistencies in rules application

Fix `ApplyLinkRuleLauncher()` to apply `RULE_LAUNCH_COMPILE`.
Remove ApplyCompileRuleLauncher since it's not used and `RULE_LAUNCH_COMPILE` is handled in `AddCompilerLaunchersForLanguages()`
Fixes: #27183
This commit is contained in:
Eduard Voronkin
2025-09-02 07:43:00 -07:00
parent bf46c263f8
commit 2db39a59b5
3 changed files with 5 additions and 13 deletions
+1 -12
View File
@@ -332,7 +332,7 @@ bool cmFastbuildNormalTargetGenerator::DetectBaseLinkerCommand(
return true;
}
void cmFastbuildNormalTargetGenerator::ApplyCompileRuleLauncher(
void cmFastbuildNormalTargetGenerator::ApplyLinkRuleLauncher(
std::string& command)
{
std::string const val = this->GetLocalGenerator()->GetRuleLauncher(
@@ -343,17 +343,6 @@ void cmFastbuildNormalTargetGenerator::ApplyCompileRuleLauncher(
}
}
void cmFastbuildNormalTargetGenerator::ApplyLinkRuleLauncher(
std::string& command)
{
std::string const val = this->GetLocalGenerator()->GetRuleLauncher(
this->GetGeneratorTarget(), "RULE_LAUNCH_COMPILE", Config);
if (cmNonempty(val)) {
LogMessage("RULE_LAUNCH_COMPILE: " + val);
command = cmStrCat(val, " ", command);
}
}
void cmFastbuildNormalTargetGenerator::ApplyLWYUToLinkerCommand(
FastbuildLinkerNode& linkerNode)
{
@@ -126,7 +126,6 @@ private:
std::string& outLinkerExecutable,
std::string& outLinkerArgs);
void ApplyCompileRuleLauncher(std::string& command);
void ApplyLinkRuleLauncher(std::string& command);
void ApplyLWYUToLinkerCommand(FastbuildLinkerNode& linkerNode);
@@ -29,6 +29,10 @@ else()
string(REPLACE "${CMAKE_END_TEMP_FILE}" "" CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE}")
add_executable(main main.c)
if(CMAKE_GENERATOR MATCHES "FASTBuild")
# FASTBuild needs output to exist.
file(TOUCH "${CMAKE_CURRENT_BINARY_DIR}${cfg_dir}/main${CMAKE_EXECUTABLE_SUFFIX}")
endif()
if (NOT DEFINED CMAKE_LINK_WARNING_AS_ERROR)
set_property(TARGET main PROPERTY LINK_WARNING_AS_ERROR ${link_warning_as_error})
endif()