ffi-compiler 1.3.2 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ffi-compiler/compile_task.rb +2 -2
- data/lib/ffi-compiler/loader.rb +15 -2
- data/lib/ffi-compiler/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59c39f1d0d925b12810c952af5c52fd0631ab72fab24601fb7b3b2eb9359f9a0
|
|
4
|
+
data.tar.gz: 45b7b6b883d0e484c87789287bb722105521033c0a70a2dfa6c7aa51162e902e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e1fafd139b595d06c04e9edcd46818b1d58a4986aa4617a84b0e2f794395f2575012b48368c0e5d019bb4914b0b882b82ac42bf33d63548bc93d42d94cccff8
|
|
7
|
+
data.tar.gz: a58808da33f2e358d8445178dbc19aa8fea350e0a0fcbbb54f58be19fc092cbd49fc3eb238af22ae6254501c47d358eeee517bf8ee7d4cb6f3f377ece1fec884
|
|
@@ -144,7 +144,7 @@ module FFI
|
|
|
144
144
|
src_files = []
|
|
145
145
|
obj_files = []
|
|
146
146
|
@source_dirs.each do |dir|
|
|
147
|
-
files = FileList["#{dir}/**/*.{c,cpp}"]
|
|
147
|
+
files = FileList["#{dir}/**/*.{c,cpp,m}"]
|
|
148
148
|
unless @exclude.empty?
|
|
149
149
|
files.delete_if { |f| f =~ Regexp.union(*@exclude) }
|
|
150
150
|
end
|
|
@@ -155,7 +155,7 @@ module FFI
|
|
|
155
155
|
index = 0
|
|
156
156
|
src_files.each do |src|
|
|
157
157
|
obj_file = obj_files[index]
|
|
158
|
-
if src =~ /\.
|
|
158
|
+
if src =~ /\.[cm]$/
|
|
159
159
|
file obj_file => [ src, File.dirname(obj_file) ] do |t|
|
|
160
160
|
sh "#{cc} #{cflags} -o #{shellescape(t.name)} -c #{shellescape(t.prerequisites[0])}"
|
|
161
161
|
end
|
data/lib/ffi-compiler/loader.rb
CHANGED
|
@@ -7,8 +7,21 @@ module FFI
|
|
|
7
7
|
module Loader
|
|
8
8
|
def self.find(name, start_path = nil)
|
|
9
9
|
library = Platform.system.map_library_name(name)
|
|
10
|
+
start_path ||= caller_path(caller[0])
|
|
11
|
+
|
|
12
|
+
# Load from modern extension fast-path when called from an active gem spec
|
|
13
|
+
if defined?(Gem::Specification) &&
|
|
14
|
+
(spec = Gem::Specification.find_active_stub_by_path(library)) &&
|
|
15
|
+
spec.respond_to?(:extension_dir) &&
|
|
16
|
+
start_path.start_with?(spec.gem_dir)
|
|
17
|
+
|
|
18
|
+
ext_path = File.join(spec.extension_dir, library)
|
|
19
|
+
return ext_path if File.exist?(ext_path)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Try to find the library in the legacy lib path, passed start_path or local folder
|
|
10
23
|
root = false
|
|
11
|
-
Pathname.new(start_path
|
|
24
|
+
Pathname.new(start_path).ascend do |path|
|
|
12
25
|
Dir.glob("#{path}/**/#{FFI::Platform::ARCH}-#{FFI::Platform::OS}/#{library}") do |f|
|
|
13
26
|
return f
|
|
14
27
|
end
|
|
@@ -37,4 +50,4 @@ module FFI
|
|
|
37
50
|
end
|
|
38
51
|
end
|
|
39
52
|
end
|
|
40
|
-
end
|
|
53
|
+
end
|
data/lib/ffi-compiler/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ffi-compiler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wayne Meissner
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rake
|
|
@@ -94,7 +93,6 @@ homepage: https://github.com/ffi/ffi-compiler
|
|
|
94
93
|
licenses:
|
|
95
94
|
- Apache-2.0
|
|
96
95
|
metadata: {}
|
|
97
|
-
post_install_message:
|
|
98
96
|
rdoc_options: []
|
|
99
97
|
require_paths:
|
|
100
98
|
- lib
|
|
@@ -109,8 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
109
107
|
- !ruby/object:Gem::Version
|
|
110
108
|
version: '0'
|
|
111
109
|
requirements: []
|
|
112
|
-
rubygems_version:
|
|
113
|
-
signing_key:
|
|
110
|
+
rubygems_version: 4.0.5
|
|
114
111
|
specification_version: 4
|
|
115
112
|
summary: Ruby FFI Rakefile generator
|
|
116
113
|
test_files: []
|