Skip to content

Commit 1248a9d

Browse files
rvaggryzokuken
authored andcommitted
feat: hoist shared libs to PRODUCT_DIR for all platforms
Ref: nodejs/node-gyp#2233
1 parent b12bd01 commit 1248a9d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pylib/gyp/generator/make.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -1621,10 +1621,8 @@ def WriteTarget(
16211621
if any(dep.endswith(".so") or ".so." in dep for dep in deps):
16221622
# We want to get the literal string "$ORIGIN"
16231623
# into the link command, so we need lots of escaping.
1624-
ldflags.append(r"-Wl,-rpath=\$$ORIGIN/lib.%s/" % self.toolset)
1625-
ldflags.append(
1626-
r"-Wl,-rpath-link=\$(builddir)/lib.%s/" % self.toolset
1627-
)
1624+
ldflags.append(r"-Wl,-rpath=\$$ORIGIN/")
1625+
ldflags.append(r"-Wl,-rpath-link=\$(builddir)/")
16281626
library_dirs = config.get("library_dirs", [])
16291627
ldflags += [("-L%s" % library_dir) for library_dir in library_dirs]
16301628
self.WriteList(ldflags, "LDFLAGS_%s" % configname)
@@ -2172,14 +2170,16 @@ def ExpandInputRoot(self, template, expansion, dirname):
21722170

21732171
def _InstallableTargetInstallPath(self):
21742172
"""Returns the location of the final output for an installable target."""
2173+
# Functionality removed for all platforms to match Xcode and hoist
2174+
# shared libraries into PRODUCT_DIR for users:
21752175
# Xcode puts shared_library results into PRODUCT_DIR, and some gyp files
21762176
# rely on this. Emulate this behavior for mac.
2177-
if self.type == "shared_library" and (
2178-
self.flavor != "mac" or self.toolset != "target"
2179-
):
2180-
# Install all shared libs into a common directory (per toolset) for
2181-
# convenient access with LD_LIBRARY_PATH.
2182-
return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias)
2177+
# if self.type == "shared_library" and (
2178+
# self.flavor != "mac" or self.toolset != "target"
2179+
# ):
2180+
# # Install all shared libs into a common directory (per toolset) for
2181+
# # convenient access with LD_LIBRARY_PATH.
2182+
# return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias)
21832183
return "$(builddir)/" + self.alias
21842184

21852185

0 commit comments

Comments
 (0)