suriab / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

link_settings are incorrectly propagated #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a gyp file with targets the like the folllowing:
targets [
  {
    'target_name': 'some_lib',
    'type': 'shared_library',
    'link_settings': {
      'libraries': [
        '-lz'
      ],
    },
  },
  {
    'target_name': 'myexec',
    'type': 'executable',
    'dependencies': [
      'some_lib',
    ],
  },
]

2. Generate a make build.
3. make myexec V=1

What is the expected output? What do you see instead?

You should not see "-lz' on the link line for myexec, but you do.

Original issue reported on code.google.com by ajw...@chromium.org on 4 Nov 2009 at 9:16

GoogleCodeExporter commented 9 years ago
This patch should fix it:

diff --git a/gyp/input.py b/gyp/input.py
index b869f46..21636fe 100644
--- a/gyp/input.py
+++ b/gyp/input.py
@@ -1426,7 +1423,7 @@ class DependencyGraphNode(object):
     # Nothing else can be a link dependency of them, there can only be
     # dependencies in the sense that a dependent target might run an
     # executable or load the loadable_module.
-    if not initial and target_type in ('executable', 'loadable_module'):
+    if not initial and target_type in linkable_types:
       return dependencies

     # The target is linkable, add it to the list of link dependencies.

Original comment by masud.s....@gmail.com on 13 Sep 2012 at 11:59

GoogleCodeExporter commented 9 years ago
A fix for this has been committed:
https://code.google.com/p/gyp/source/detail?r=1717

(not sure why it didn't automatically update the bug report).

Original comment by sba...@bloomberg.net on 5 Sep 2013 at 8:14

GoogleCodeExporter commented 9 years ago
There’s no commit-bot for GYP.

Original comment by mark@chromium.org on 5 Sep 2013 at 8:20