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

Method MaybeCreateImplibDir

Source/cmLocalVisualStudioGenerator.cxx:128–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128std::unique_ptr<cmCustomCommand>
129cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget* target,
130 std::string const& config,
131 bool isFortran)
132{
133 std::unique_ptr<cmCustomCommand> pcc;
134
135 // If an executable exports symbols then VS wants to create an
136 // import library but forgets to create the output directory.
137 // The Intel Fortran plugin always forgets to the directory.
138 if (target->GetType() != cmStateEnums::EXECUTABLE &&
139 !(isFortran && target->GetType() == cmStateEnums::SHARED_LIBRARY)) {
140 return pcc;
141 }
142 std::string outDir =
143 target->GetDirectory(config, cmStateEnums::RuntimeBinaryArtifact);
144 std::string impDir =
145 target->GetDirectory(config, cmStateEnums::ImportLibraryArtifact);
146 if (impDir == outDir) {
147 return pcc;
148 }
149
150 // Add a pre-build event to create the directory.
151 cmCustomCommandLines commands = cmMakeSingleCommandLine(
152 { cmSystemTools::GetCMakeCommand(), "-E", "make_directory", impDir });
153 pcc = cm::make_unique<cmCustomCommand>();
154 pcc->SetCommandLines(commands);
155 pcc->SetStdPipesUTF8(true);
156 pcc->SetEscapeOldStyle(false);
157 pcc->SetEscapeAllowMakeVars(true);
158 return pcc;
159}
160
161char const* cmLocalVisualStudioGenerator::ReportErrorLabel() const
162{

Callers 1

OutputTargetRulesMethod · 0.80

Calls 7

cmMakeSingleCommandLineFunction · 0.85
SetCommandLinesMethod · 0.80
SetStdPipesUTF8Method · 0.80
SetEscapeOldStyleMethod · 0.80
GetTypeMethod · 0.45
GetDirectoryMethod · 0.45

Tested by

no test coverage detected