Mercurial > projects > ldc
comparison gen/main.cpp @ 1635:601d3eea4a68
Make -nodefaultlib override -de{fault,bug}lib=foo instead of vice versa.
author | Matti Niemenmaa <matti.niemenmaa+hg@iki.fi> |
---|---|
date | Fri, 05 Mar 2010 21:40:51 +0200 |
parents | def7a1d494fd |
children | 9176437d98be |
comparison
equal
deleted
inserted
replaced
1634:9cc791423e20 | 1635:601d3eea4a68 |
---|---|
299 llvm::NoFramePointerElim = true; | 299 llvm::NoFramePointerElim = true; |
300 } | 300 } |
301 else | 301 else |
302 libs = global.params.defaultlibnames; | 302 libs = global.params.defaultlibnames; |
303 | 303 |
304 if (libs) | 304 if (!noDefaultLib) |
305 { | 305 { |
306 for (int i = 0; i < libs->dim; i++) | 306 if (libs) |
307 { | 307 { |
308 char* lib = (char *)libs->data[i]; | 308 for (int i = 0; i < libs->dim; i++) |
309 char *arg = (char *)mem.malloc(strlen(lib) + 3); | 309 { |
310 strcpy(arg, "-l"); | 310 char* lib = (char *)libs->data[i]; |
311 strcpy(arg+2, lib); | 311 char *arg = (char *)mem.malloc(strlen(lib) + 3); |
312 global.params.linkswitches->push(arg); | 312 strcpy(arg, "-l"); |
313 } | 313 strcpy(arg+2, lib); |
314 } | 314 global.params.linkswitches->push(arg); |
315 else if (!noDefaultLib) | 315 } |
316 { | 316 } |
317 else | |
318 { | |
317 #if DMDV2 | 319 #if DMDV2 |
318 global.params.linkswitches->push(mem.strdup("-ldruntime-ldc")); | 320 global.params.linkswitches->push(mem.strdup("-ldruntime-ldc")); |
319 #else | 321 #else |
320 global.params.linkswitches->push(mem.strdup("-lldc-runtime")); | 322 global.params.linkswitches->push(mem.strdup("-lldc-runtime")); |
321 global.params.linkswitches->push(mem.strdup("-ltango-cc-tango")); | 323 global.params.linkswitches->push(mem.strdup("-ltango-cc-tango")); |
322 global.params.linkswitches->push(mem.strdup("-ltango-gc-basic")); | 324 global.params.linkswitches->push(mem.strdup("-ltango-gc-basic")); |
323 // pass the runtime again to resolve issues | 325 // pass the runtime again to resolve issues |
324 // with linking order | 326 // with linking order |
325 global.params.linkswitches->push(mem.strdup("-lldc-runtime")); | 327 global.params.linkswitches->push(mem.strdup("-lldc-runtime")); |
326 #endif | 328 #endif |
329 } | |
327 } | 330 } |
328 | 331 |
329 if (global.params.run) | 332 if (global.params.run) |
330 quiet = 1; | 333 quiet = 1; |
331 | 334 |