Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weak_libraries #896

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/xcodeproj/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def initialize(xcconfig_hash_or_file = {})
@attributes = {}
@includes = []
@other_linker_flags = {}
[:simple, :frameworks, :weak_frameworks, :libraries, :arg_files, :force_load].each do |key|
[:simple, :frameworks, :weak_frameworks, :libraries, :weak_libraries, :arg_files, :force_load].each do |key|
@other_linker_flags[key] = Set.new
end
merge!(extract_hash(xcconfig_hash_or_file))
Expand Down Expand Up @@ -126,10 +126,11 @@ def to_hash(prefix = nil)
:frameworks => '-framework ',
:weak_frameworks => '-weak_framework ',
:libraries => '-l',
:weak_libraries => '-weak_l',
:arg_files => '@',
:force_load => '-force_load',
}
[:libraries, :frameworks, :weak_frameworks, :arg_files, :force_load].each do |key|
[:libraries, :frameworks, :weak_libraries, :weak_frameworks, :arg_files, :force_load].each do |key|
modifier = modifiers[key]
sorted = other_linker_flags[key].to_a.sort
if key == :force_load
Expand Down Expand Up @@ -182,6 +183,13 @@ def libraries
other_linker_flags[:libraries]
end

# @return [Set<String>] The list of the *weak* libraries required by
# this settings file.
#
def weak_libraries
other_linker_flags[:weak_libraries]
end

# @return [Set<String>] The list of the arg files required by this
# settings file.
#
Expand Down
3 changes: 3 additions & 0 deletions lib/xcodeproj/config/other_linker_flags_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def self.parse(flags)
:frameworks => [],
:weak_frameworks => [],
:libraries => [],
:weak_libraries => [],
:arg_files => [],
:simple => [],
:force_load => [],
Expand All @@ -33,6 +34,8 @@ def self.parse(flags)
key = :weak_frameworks
when '-l'
key = :libraries
when '-weak_l'
key = :weak_libraries
when '@'
key = :arg_files
when '-force_load'
Expand Down