MscBuilder.patch

Massimo Del Fedele, 01/14/2012 03:33 PM

Download (2.56 KB)

View differences:

MscBuilder.icpp (copia locale)
314 314
					c = cc_speed;
315 315
				int slot = AllocSlot();
316 316
				if(slot < 0 || !Run(c + PdbPch(package, slot, !sContainsPchOptions(cc) && !sContainsPchOptions(soptions[i]))
317
				+ soptions[i] + (ext == ".c" ? " -Tc " : " -Tp ")
317
				+ " " + soptions[i] + (ext == ".c" ? " -Tc " : " -Tp ")
318 318
				+ GetHostPathQ(fn) + " -Fo" + GetHostPathQ(objfile), slot, GetHostPath(objfile), 1))
319 319
					execerr = true;
320 320
			}
......
373 373
		Vector<Host::FileInfo> objinfo = host->GetFileInfo(obj);
374 374
		for(int i = 0; i < obj.GetCount(); i++)
375 375
			if(objinfo[i] > producttime) {
376
				String lib;
376
				String linker, lib;
377 377
				if(is_shared) {
378
					lib << LinkerName() << " -dll -nologo -machine:" << MachineName()
378
					linker << LinkerName() << "-dll -nologo ";
379
					lib << "-machine:" << MachineName()
379 380
						<< " -pdb:" << GetHostPathQ(ForceExt(product, ".pdb"))
380 381
						<< " -out:" << GetHostPathQ(product);
381 382
					if(!HasFlag("MSC10") && !HasFlag("MSC10X64"))
......
435 436
					}
436 437
				}
437 438
				else{
438
					lib << (HasFlag("INTEL") ? "xilib" : "link /lib") << " -nologo";
439
					linker << (HasFlag("INTEL") ? "xilib" : "link /lib") << " -nologo ";
439 440
					if(HasFlag("FORCE_SIZE")){
440 441
						if(sContainsPchOptions(release_size_options))
441 442
							lib << " -ltcg";
......
451 452
				PutConsole("Creating library...");
452 453
				IdeConsoleEndGroup();
453 454
				DeleteFile(product);
454
				if(Execute(lib)) {
455
				String tmpFileName;
456
				if(linker.GetCount() + lib.GetCount() >= 8192)
457
				{
458
					tmpFileName = GetTempFileName();
459
					// we can't simply put all data on a single line
460
					// as it has a limit of around 130000 chars too, so we split
461
					// in multiple lines
462
					FileOut f(tmpFileName);
463
					while(lib != "")
464
					{
465
						int found = 0;
466
						bool quotes = false;
467
						int lim = min(8192, lib.GetCount());
468
						for(int i = 0; i < lim; i++)
469
						{
470
							char c = lib[i];
471
							if(isspace(c) && !quotes)
472
								found = i;
473
							else if(c == '"')
474
								quotes = !quotes;
475
						}
476
						if(!found)
477
							found = lib.GetCount();
478
						f.PutLine(lib.Left(found));
479
						lib.Remove(0, found);
480
					}
481
					f.Close();
482
					linker << "@" << tmpFileName;
483
				}
484
				else
485
					linker << lib;
486
				bool res = Execute(linker);
487
				if(tmpFileName != "")
488
					FileDelete(tmpFileName);
489
				if(res) {
455 490
					DeleteFile(product);
456 491
					return false;
457 492
				}