Add the correct rpath to use Swiftshader / Vulkan on macOS

Previously the @executable_path rpath was only added when doing
component builds and non-component builds failed to find Vulkan and
Swiftshader on macOS.

Bug: None
Change-Id: I0277566e4bf181703dff26bb1bf3e57858864009
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37442
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Corentin Wallez 2021-01-12 19:01:04 +00:00 committed by Commit Bot service account
parent f600666866
commit 4b30f93762
1 changed files with 15 additions and 1 deletions

View File

@ -77,6 +77,17 @@ config("dawn_native_weak_framework") {
}
}
# Config that adds the @executable_path rpath if needed so that Swiftshader or the Vulkan loader are found.
config("dawn_native_vulkan_rpath") {
if (is_mac && dawn_enable_vulkan &&
(use_swiftshader || enable_vulkan_loader)) {
ldflags = [
"-rpath",
"@executable_path/",
]
}
}
dawn_json_generator("dawn_native_utils_gen") {
target = "dawn_native_utils"
outputs = [
@ -633,7 +644,10 @@ dawn_component("dawn_native") {
]
sources = [ "DawnNative.cpp" ]
configs = [ ":dawn_native_internal" ]
public_configs = [ ":dawn_native_weak_framework" ]
public_configs = [
":dawn_native_weak_framework",
":dawn_native_vulkan_rpath",
]
if (dawn_enable_d3d12) {
sources += [ "d3d12/D3D12Backend.cpp" ]