Skip to content

Instantly share code, notes, and snippets.

@WiesnerPeti
Created January 3, 2020 12:51
Show Gist options
  • Save WiesnerPeti/71f4646cbcddcd1ad0913a5c79ba1fdd to your computer and use it in GitHub Desktop.
Save WiesnerPeti/71f4646cbcddcd1ad0913a5c79ba1fdd to your computer and use it in GitHub Desktop.
Stringify XCCONFIG other linker flags hashmap
#Helper to stringify OTHER_LDFLAGS content
def stringFromhash(hash)
items = hash.reduce([]) do |sum,(key,val)|
if key == :simple
sum += val.to_a.map{ |i| "#{i}"}
elsif key == :frameworks
sum += val.to_a.map{ |i| "-framework \"#{i}\""}
elsif key == :weak_frameworks
sum += val.to_a.map{ |i| "-weak_framework \"#{i}\""}
elsif key == :libraries
sum += val.to_a.map{ |i| "-l\"#{i}\""}
elsif key == :force_load
sum += val.to_a.map{ |i| "-force_load \"#{i}\""}
end
end
return items.join(' ')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment