瀏覽代碼

GenEx: Fix TARGET_PDB_FILE_BASE_NAME with PDB_NAME and DEBUG_POSTFIX

When `PDB_NAME` is explicitly set, the `<CONFIG>_POSTFIX` is not added
to the `.pdb` names.

Fixes: #26733
Giacomo Rombaut 7 月之前
父節點
當前提交
fe11677945

+ 1 - 2
Source/cmGeneratorExpressionNode.cxx

@@ -4182,8 +4182,7 @@ struct TargetOutputNameArtifactResultGetter<ArtifactPdbTag>
       return std::string();
       return std::string();
     }
     }
 
 
-    return target->GetPDBOutputName(context->Config) +
-      target->GetFilePostfix(context->Config);
+    return target->GetPDBOutputName(context->Config);
   }
   }
 };
 };
 
 

+ 2 - 1
Source/cmGeneratorTarget.cxx

@@ -3772,7 +3772,8 @@ std::string cmGeneratorTarget::GetPDBOutputName(
   std::string const& config) const
   std::string const& config) const
 {
 {
   std::string base =
   std::string base =
-    this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact);
+    this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact) +
+    this->GetFilePostfix(config);
 
 
   std::vector<std::string> props;
   std::vector<std::string> props;
   std::string configUpper = cmSystemTools::UpperCase(config);
   std::string configUpper = cmSystemTools::UpperCase(config);

+ 2 - 2
Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME.cmake

@@ -122,8 +122,8 @@ check_value ("TARGET_LINKER_FILE_BASE_NAME static linker all properties + postfi
 ]])
 ]])
 if (CMAKE_C_LINKER_SUPPORTS_PDB)
 if (CMAKE_C_LINKER_SUPPORTS_PDB)
   string (APPEND GENERATE_CONTENT [[
   string (APPEND GENERATE_CONTENT [[
-check_value ("TARGET_PDB_FILE_BASE_NAME executable PDB all properties + postfix" "$<TARGET_PDB_FILE_BASE_NAME:exec4>" "exec4_pdb_postfix")
-check_value ("TARGET_PDB_FILE_BASE_NAME shared PDB all properties + postfix" "$<TARGET_PDB_FILE_BASE_NAME:shared4>" "shared4_pdb_postfix")
+check_value ("TARGET_PDB_FILE_BASE_NAME executable PDB all properties + postfix" "$<TARGET_PDB_FILE_BASE_NAME:exec4>" "exec4_pdb")
+check_value ("TARGET_PDB_FILE_BASE_NAME shared PDB all properties + postfix" "$<TARGET_PDB_FILE_BASE_NAME:shared4>" "shared4_pdb")
 ]])
 ]])
 endif()
 endif()