Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: pylib/gyp/generator/ninja.py

Issue 1813053003: ninja: Add target_rpath generator flag (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Add gyptest-target-rpath.py unit test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | test/linux/gyptest-target-rpath.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/ninja.py
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
index ffb3a8567fa4ee16fdc43777dcd8bb44844fd6e0..e5ae14b78f5e13573547bbb22fe942de7af57494 100644
--- a/pylib/gyp/generator/ninja.py
+++ b/pylib/gyp/generator/ninja.py
@@ -379,6 +379,8 @@ class NinjaWriter(object):
# should be used for linking.
self.uses_cpp = False
+ self.target_rpath = generator_flags.get('target_rpath', r'\$$ORIGIN/lib/')
+
self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec)
self.xcode_settings = self.msvs_settings = None
if self.flavor == 'mac':
@@ -1193,7 +1195,9 @@ class NinjaWriter(object):
rpath = 'lib/'
if self.toolset != 'target':
rpath += self.toolset
- ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath)
+ ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath)
+ else:
+ ldflags.append('-Wl,-rpath=%s' % self.target_rpath)
ldflags.append('-Wl,-rpath-link=%s' % rpath)
self.WriteVariableList(ninja_file, 'ldflags',
map(self.ExpandSpecial, ldflags))
« no previous file with comments | « AUTHORS ('k') | test/linux/gyptest-target-rpath.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698