diff options
| author | Jack Nagel | 2014-04-20 22:39:47 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-20 22:39:47 -0500 |
| commit | b47c7158d684f2e0454168f130f0414ea9d63105 (patch) | |
| tree | 25d404e1016fe27534329ea499305d9655f1c2fb /Library/ENV/4.3/cc | |
| parent | e4d66d2e5b2c5d9e09395ae2f2050fe05ffe2662 (diff) | |
| download | homebrew-b47c7158d684f2e0454168f130f0414ea9d63105.tar.bz2 | |
Remove nil split monkeypatch
Diffstat (limited to 'Library/ENV/4.3/cc')
| -rwxr-xr-x | Library/ENV/4.3/cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 13ad9d7a4..cfa68f6cf 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -217,15 +217,17 @@ class Cmd syspath.map{|d| "#{d}/lib" }.reject{|d| d == "#{brewfix}/lib" } end def cpath - cpath = ENV['CMAKE_PREFIX_PATH'].split(':').map{|d| "#{d}/include" } + ENV['CMAKE_INCLUDE_PATH'].split(':') + cpath = path_split("CMAKE_PREFIX_PATH").map! { |d| File.join(d, "include") } + cpath += path_split("CMAKE_INCLUDE_PATH") opt = cpath.grep(%r{^#{Regexp.escape(brewfix)}/opt}) sys = cpath - opt [sys, opt] end def libpath - ENV['CMAKE_PREFIX_PATH'].split(':').map{|d| "#{d}/lib" } + - ENV['CMAKE_LIBRARY_PATH'].split(':') - - syslibpath + libpath = path_split("CMAKE_PREFIX_PATH").map! { |d| File.join(d, "lib") } + libpath += path_split("CMAKE_LIBRARY_PATH") + libpath -= syslibpath + libpath end def ldflags args = path_flags("-L", libpath) @@ -278,6 +280,9 @@ class Cmd paths = paths.uniq.select { |path| File.directory?(path) } paths.map! { |path| prefix + path } end + def path_split(key) + ENV.fetch(key) { "" }.split(File::PATH_SEPARATOR) + end end if __FILE__ == $PROGRAM_NAME |
