Commit db8ae836 by Robert Sesek Committed by Commit Bot

[Mac/GN] Properly set the install_name and rpath for shared_library targets and their consumers.

BUG=621932 R=cwallez@chromium.org Change-Id: I10b0fd5a668d74b7062747002bc48ef0e0a6df9c Reviewed-on: https://chromium-review.googlesource.com/354302Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent 4fb43115
...@@ -369,6 +369,14 @@ static_library("libANGLE") { ...@@ -369,6 +369,14 @@ static_library("libANGLE") {
} }
} }
config("shared_library_public_config") {
if (is_mac && !is_component_build) {
# Executable targets that depend on the shared libraries below need to have
# the rpath setup in non-component build configurations.
ldflags = [ "-rpath", "@executable_path/" ]
}
}
shared_library("libGLESv2") { shared_library("libGLESv2") {
sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src") sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src")
...@@ -377,6 +385,11 @@ shared_library("libGLESv2") { ...@@ -377,6 +385,11 @@ shared_library("libGLESv2") {
[ "/DEF:" + rebase_path("src/libGLESv2/libGLESv2.def", root_build_dir) ] [ "/DEF:" + rebase_path("src/libGLESv2/libGLESv2.def", root_build_dir) ]
} }
if (is_mac && !is_component_build) {
ldflags = [ "-install_name", "@rpath/${target_name}.dylib" ]
public_configs = [ ":shared_library_public_config" ]
}
configs -= angle_undefine_configs configs -= angle_undefine_configs
configs += [ configs += [
":internal_config", ":internal_config",
...@@ -401,6 +414,11 @@ shared_library("libEGL") { ...@@ -401,6 +414,11 @@ shared_library("libEGL") {
ldflags = [ "/DEF:" + rebase_path("src/libEGL/libEGL.def", root_build_dir) ] ldflags = [ "/DEF:" + rebase_path("src/libEGL/libEGL.def", root_build_dir) ]
} }
if (is_mac && !is_component_build) {
ldflags = [ "-install_name", "@rpath/${target_name}.dylib" ]
public_configs = [ ":shared_library_public_config" ]
}
configs -= angle_undefine_configs configs -= angle_undefine_configs
configs += [ configs += [
":internal_config", ":internal_config",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment