Skip to content

Commit

Permalink
feat: hoist shared libs to PRODUCT_DIR for all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 13, 2020
1 parent b12bd01 commit e139d46
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pylib/gyp/generator/make.py
Expand Up @@ -1621,10 +1621,8 @@ def WriteTarget(
if any(dep.endswith(".so") or ".so." in dep for dep in deps):
# We want to get the literal string "$ORIGIN"
# into the link command, so we need lots of escaping.
ldflags.append(r"-Wl,-rpath=\$$ORIGIN/lib.%s/" % self.toolset)
ldflags.append(
r"-Wl,-rpath-link=\$(builddir)/lib.%s/" % self.toolset
)
ldflags.append(r"-Wl,-rpath=\$$ORIGIN/")
ldflags.append(r"-Wl,-rpath-link=\$(builddir)/")
library_dirs = config.get("library_dirs", [])
ldflags += [("-L%s" % library_dir) for library_dir in library_dirs]
self.WriteList(ldflags, "LDFLAGS_%s" % configname)
Expand Down Expand Up @@ -2172,14 +2170,16 @@ def ExpandInputRoot(self, template, expansion, dirname):

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


Expand Down

0 comments on commit e139d46

Please sign in to comment.