MCPcopy Create free account
hub / github.com/Kitware/CMake / OutputTargetRules

Method OutputTargetRules

Source/cmLocalVisualStudio7Generator.cxx:1912–1958  ·  view source on GitHub ↗

look for custom rules on a target and collect them together

Source from the content-addressed store, hash-verified

1910
1911// look for custom rules on a target and collect them together
1912void cmLocalVisualStudio7Generator::OutputTargetRules(
1913 std::ostream& fout, std::string const& configName, cmGeneratorTarget* target,
1914 std::string const& /*libName*/)
1915{
1916 if (target->GetType() > cmStateEnums::GLOBAL_TARGET) {
1917 return;
1918 }
1919 EventWriter event(this, configName, fout);
1920
1921 // Add pre-build event.
1922 char const* tool =
1923 this->FortranProject ? "VFPreBuildEventTool" : "VCPreBuildEventTool";
1924 event.Start(tool);
1925 event.Write(target->GetPreBuildCommands());
1926 event.Finish();
1927
1928 // Add pre-link event.
1929 tool = this->FortranProject ? "VFPreLinkEventTool" : "VCPreLinkEventTool";
1930 event.Start(tool);
1931 bool addedPrelink = false;
1932 cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
1933 target->GetModuleDefinitionInfo(configName);
1934 if (mdi && mdi->DefFileGenerated) {
1935 addedPrelink = true;
1936 std::vector<cmCustomCommand> commands = target->GetPreLinkCommands();
1937 cmGlobalVisualStudioGenerator* gg =
1938 static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator);
1939 gg->AddSymbolExportCommand(target, commands, configName);
1940 event.Write(commands);
1941 }
1942 if (!addedPrelink) {
1943 event.Write(target->GetPreLinkCommands());
1944 }
1945 std::unique_ptr<cmCustomCommand> pcc(
1946 this->MaybeCreateImplibDir(target, configName, this->FortranProject));
1947 if (pcc) {
1948 event.Write(*pcc);
1949 }
1950 event.Finish();
1951
1952 // Add post-build event.
1953 tool =
1954 this->FortranProject ? "VFPostBuildEventTool" : "VCPostBuildEventTool";
1955 event.Start(tool);
1956 event.Write(target->GetPostBuildCommands());
1957 event.Finish();
1958}
1959
1960void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout,
1961 cmGeneratorTarget* target)

Callers 1

WriteConfigurationMethod · 0.95

Calls 7

MaybeCreateImplibDirMethod · 0.80
GetTypeMethod · 0.45
StartMethod · 0.45
WriteMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected