Mercurial > projects > ldc
comparison gen/main.cpp @ 1187:a95fc9fcad5c
Make sure -defaultlib and -debuglib don't get cut off if longer than 63 chars,
and clean up some overly verbose code.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Wed, 01 Apr 2009 00:52:31 +0200 |
parents | e40c65bd8c5d |
children | 1546b5162152 |
comparison
equal
deleted
inserted
replaced
1186:7562457bb7f3 | 1187:a95fc9fcad5c |
---|---|
271 | 271 |
272 if (libs) | 272 if (libs) |
273 { | 273 { |
274 for (int i = 0; i < libs->dim; i++) | 274 for (int i = 0; i < libs->dim; i++) |
275 { | 275 { |
276 char *arg = (char *)mem.malloc(64); | 276 char* lib = (char *)libs->data[i]; |
277 char *arg = (char *)mem.malloc(strlen(lib) + 3); | |
277 strcpy(arg, "-l"); | 278 strcpy(arg, "-l"); |
278 strncat(arg, (char *)libs->data[i], 64); | 279 strcpy(arg+2, lib); |
279 global.params.linkswitches->push(arg); | 280 global.params.linkswitches->push(arg); |
280 } | 281 } |
281 } | 282 } |
282 else if (!noDefaultLib) | 283 else if (!noDefaultLib) |
283 { | 284 { |
284 char *arg; | 285 global.params.linkswitches->push(mem.strdup("-lldc-runtime")); |
285 arg = (char *)mem.malloc(64); | 286 global.params.linkswitches->push(mem.strdup("-ltango-cc-tango")); |
286 strcpy(arg, "-lldc-runtime"); | 287 global.params.linkswitches->push(mem.strdup("-ltango-gc-basic")); |
287 global.params.linkswitches->push(arg); | |
288 arg = (char *)mem.malloc(64); | |
289 strcpy(arg, "-ltango-cc-tango"); | |
290 global.params.linkswitches->push(arg); | |
291 arg = (char *)mem.malloc(64); | |
292 strcpy(arg, "-ltango-gc-basic"); | |
293 global.params.linkswitches->push(arg); | |
294 // pass the runtime again to resolve issues | 288 // pass the runtime again to resolve issues |
295 // with linking order | 289 // with linking order |
296 arg = (char *)mem.malloc(64); | 290 global.params.linkswitches->push(mem.strdup("-lldc-runtime")); |
297 strcpy(arg, "-lldc-runtime"); | |
298 global.params.linkswitches->push(arg); | |
299 } | 291 } |
300 | 292 |
301 if (global.params.run) | 293 if (global.params.run) |
302 quiet = 1; | 294 quiet = 1; |
303 | 295 |