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

Method Prepare

Source/cmUVProcessChain.cxx:191–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191bool cmUVProcessChain::InternalData::Prepare(
192 cmUVProcessChainBuilder const* builder)
193{
194 this->Builder = builder;
195
196 if (this->Builder->Loop) {
197 this->Loop = this->Builder->Loop;
198 } else {
199 this->BuiltinLoop.init();
200 this->Loop = this->BuiltinLoop;
201 }
202
203 auto const& input =
204 this->Builder->Stdio[cmUVProcessChainBuilder::Stream_INPUT];
205 auto& inputData = this->InputStreamData;
206 switch (input.Type) {
207 case cmUVProcessChainBuilder::None:
208 inputData.Stdio.flags = UV_IGNORE;
209 break;
210
211 case cmUVProcessChainBuilder::Builtin: {
212 // FIXME
213 break;
214 }
215
216 case cmUVProcessChainBuilder::External:
217 inputData.Stdio.flags = UV_INHERIT_FD;
218 inputData.Stdio.data.fd = input.FileDescriptor;
219 break;
220 }
221
222 auto const& output =
223 this->Builder->Stdio[cmUVProcessChainBuilder::Stream_OUTPUT];
224 auto& outputData = this->OutputStreamData;
225 switch (output.Type) {
226 case cmUVProcessChainBuilder::None:
227 outputData.Stdio.flags = UV_IGNORE;
228 break;
229
230 case cmUVProcessChainBuilder::Builtin: {
231 int pipeFd[2];
232 if (cmGetPipes(pipeFd) < 0) {
233 return false;
234 }
235
236 if (outputData.BuiltinStream.init(*this->Loop, 0) < 0) {
237 return false;
238 }
239 if (uv_pipe_open(outputData.BuiltinStream, pipeFd[0]) < 0) {
240 return false;
241 }
242
243 if (this->TempOutputPipe.init(*this->Loop, 0) < 0) {
244 return false;
245 }
246 if (uv_pipe_open(this->TempOutputPipe, pipeFd[1]) < 0) {
247 return false;
248 }

Callers 2

StartMethod · 0.45

Calls 6

cmGetPipesFunction · 0.85
emplace_backMethod · 0.80
uv_pipe_openFunction · 0.50
initMethod · 0.45
sizeMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected