Top Level Namespace
Defined Under Namespace
Classes: Similie
Instance Method Summary collapse
- #inc_paths(lib, defaults) ⇒ Object
- #lib_flags(lib, defaults) ⇒ Object
- #lib_name(re) ⇒ Object
- #lib_paths(lib, defaults) ⇒ Object
Instance Method Details
#inc_paths(lib, defaults) ⇒ Object
3 4 5 6 |
# File 'ext/extconf.rb', line 3 def inc_paths lib, defaults path = %x{pkg-config #{lib} --cflags 2>/dev/null}.strip path.size > 0 ? path : defaults.map {|name| "-I#{name}"}.join(' ') end |
#lib_flags(lib, defaults) ⇒ Object
13 14 15 16 17 |
# File 'ext/extconf.rb', line 13 def lib_flags lib, defaults path = %x{pkg-config #{lib} --libs-only-l 2>/dev/null}.strip path.size > 0 ? path.split(/\s+/).select {|name| %r{core|highgui}.match(name)}.join(' ') : defaults.map {|name| "-l#{name}"}.join(' ') end |
#lib_name(re) ⇒ Object
19 20 21 |
# File 'ext/extconf.rb', line 19 def lib_name re $LDFLAGS.scan(re).flatten.first end |
#lib_paths(lib, defaults) ⇒ Object
8 9 10 11 |
# File 'ext/extconf.rb', line 8 def lib_paths lib, defaults path = %x{pkg-config #{lib} --libs-only-L 2>/dev/null}.strip path.size > 0 ? path : defaults.map {|name| "-L#{name}"}.join(' ') end |