MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / submitCMake

Method submitCMake

static/compiler-service.ts:253–289  ·  view source on GitHub ↗
(request: Record<string, any>)

Source from the content-addressed store, hash-verified

251 }
252
253 public submitCMake(request: Record<string, any>) {
254 request.allowStoreCodeDebug = this.allowStoreCodeDebug;
255 const jsonRequest = JSON.stringify(request);
256 if (options.doCache && !request.bypassCache) {
257 const cachedResult = this.cache.get(jsonRequest);
258 if (cachedResult) {
259 return Promise.resolve({
260 request: request,
261 result: cachedResult,
262 localCacheHit: true,
263 });
264 }
265 }
266 return new Promise((resolve, reject) => {
267 const compilerId = encodeURIComponent(request.compiler);
268 $.ajax({
269 type: 'POST',
270 url: `${this.getBaseUrl()}api/compiler/${compilerId}/cmake`,
271 dataType: 'json',
272 contentType: 'application/json',
273 data: jsonRequest,
274 success: result => {
275 if (result?.okToCache && options.doCache) {
276 this.cache.set(jsonRequest, result);
277 }
278 resolve({
279 request: request,
280 result: result,
281 localCacheHit: false,
282 });
283 },
284 error: (jqXHR, textStatus, errorThrown) => {
285 CompilerService.handleRequestError(request, reject, jqXHR, textStatus, errorThrown);
286 },
287 });
288 });
289 }
290
291 public requestPopularArguments(compilerId: string, usedOptions: string) {
292 return new Promise((resolve, reject) => {

Callers 2

sendCMakeCompileMethod · 0.80
sendCMakeCompileMethod · 0.80

Calls 5

getBaseUrlMethod · 0.95
resolveMethod · 0.80
handleRequestErrorMethod · 0.80
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected