Merge pull request #11187 from carlocab/cmake-rpath

formula: add rpath helper method
This commit is contained in:
Carlo Cabrera 2021-04-20 10:02:28 +01:00 committed by GitHub
commit d89eda09ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,7 @@
class Formula class Formula
undef shared_library undef shared_library
undef rpath
def shared_library(name, version = nil) def shared_library(name, version = nil)
suffix = if version == "*" || (name == "*" && version.blank?) suffix = if version == "*" || (name == "*" && version.blank?)
@ -13,6 +14,10 @@ class Formula
"#{name}.so#{suffix}" "#{name}.so#{suffix}"
end end
def rpath
"'$ORIGIN/../lib'"
end
class << self class << self
undef ignore_missing_libraries undef ignore_missing_libraries

View File

@ -1523,6 +1523,12 @@ class Formula
"#{name}#{infix}.dylib" "#{name}#{infix}.dylib"
end end
# Executable/Library RPATH according to platform conventions.
sig { returns(String) }
def rpath
"@loader_path/../lib"
end
# an array of all core {Formula} names # an array of all core {Formula} names
# @private # @private
def self.core_names def self.core_names