MCPcopy Create free account
hub / github.com/boostorg/build / GccLinkingGenerator

Class GccLinkingGenerator

v2/tools/gcc.py:381–420  ·  view source on GitHub ↗

The class which check that we don't try to use the static property while creating or using shared library, since it's not supported by gcc/libc.

Source from the content-addressed store, hash-verified

379
380
381class GccLinkingGenerator(unix.UnixLinkingGenerator):
382 """
383 The class which check that we don&#x27;t try to use the <runtime-link>static
384 property while creating or using shared library, since it&#x27;s not supported by
385 gcc/libc.
386 """
387 def run(self, project, name, ps, sources):
388 # TODO: Replace this with the use of a target-os property.
389
390 no_static_link = False
391 if bjam.variable('UNIX'):
392 no_static_link = True;
393 ##FIXME: what does this mean?
394## {
395## switch [ modules.peek : JAMUNAME ]
396## {
397## case * : no-static-link = true ;
398## }
399## }
400
401 reason = None
402 if no_static_link and ps.get('runtime-link') == 'static':
403 if ps.get('link') == 'shared':
404 reason = "On gcc, DLL can't be build with '<runtime-link>static'."
405 elif type.is_derived(self.target_types[0], 'EXE'):
406 for s in sources:
407 source_type = s.type()
408 if source_type and type.is_derived(source_type, 'SHARED_LIB'):
409 reason = "On gcc, using DLLS together with the " +\
410 "<runtime-link>static options is not possible "
411 if reason:
412 print 'warning:', reason
413 print 'warning:',\
414 "It is suggested to use '<runtime-link>static' together",\
415 "with '<link>static'." ;
416 return
417 else:
418 generated_targets = unix.UnixLinkingGenerator.run(self, project,
419 name, ps, sources)
420 return generated_targets
421
422if on_windows():
423 flags('gcc.link.dll', '.IMPLIB-COMMAND', [], ['-Wl,--out-implib,'])

Callers 1

gcc.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected