| 126 | } |
| 127 | |
| 128 | std::unique_ptr<cmCustomCommand> |
| 129 | cmLocalVisualStudioGenerator::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 | |
| 161 | char const* cmLocalVisualStudioGenerator::ReportErrorLabel() const |
| 162 | { |
no test coverage detected