electron/patches/ffmpeg/link_with_loader_path.patch
electron-roller[bot] f2240e07f0
chore: bump chromium to 137.0.7149.0 (main) (#46777)
* chore: bump chromium in DEPS to 137.0.7144.0

* chore: bump chromium in DEPS to 137.0.7145.0

* chore: bump chromium in DEPS to 137.0.7147.0

* chore: update patches

* Remove deprecated GetVar(std::string_view, std::string*) overload

Refs 6468873

* fixup! Remove deprecated GetVar(std::string_view, std::string*) overload

* fixup! Remove deprecated GetVar(std::string_view, std::string*) overload

* chore: bump chromium in DEPS to 137.0.7149.0

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2025-04-28 11:39:12 -04:00

29 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Tue, 2 Aug 2022 11:53:00 +0900
Subject: fix: link with @loader_path/libffmpeg.dylib
Submitted to https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/3803946.
When building with `is_component_build=false is_component_ffmpeg=true`,
we must manually instruct executables to link with the ffmpeg.dylib,
which is generated at the @loader_path, where for most targets is the
out/{Release,Debug} dir.
Using @rpath is wrong because the @rpath of most targets does not
include the out dir, and the linker won't be able to find ffmpeg.dylib
because of so.
diff --git a/BUILD.gn b/BUILD.gn
index 6af67ce26eefaf833cc7bf4a66de16f6ed5315ab..4a998334d458cdd9ab9a8874a1fa02d24298536a 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -453,7 +453,7 @@ if (is_component_ffmpeg) {
if (!is_component_build) {
if (is_mac) {
- ldflags += [ "-Wl,-install_name,@rpath/libffmpeg.dylib" ]
+ ldflags += [ "-Wl,-install_name,@loader_path/libffmpeg.dylib" ]
} else if (is_linux) {
all_dependent_configs =
[ "//build/config/gcc:rpath_for_built_shared_libraries" ]