rb_sys 0.9.36 → 0.9.38

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 597f75a81d483edd85cc5bf1a09be027d4b612dff53ed6f2ecb1818230aaa1ff
4
- data.tar.gz: 7c4a90b0a9f13a310c30b3e5366949e8d4d50cc9b44c05e005d65b39b24fa7ee
3
+ metadata.gz: 7d4ca0e7a03a649cabcf365abb97e67a56dfe2cb9517597a179f5f6f8cd89de7
4
+ data.tar.gz: 1a4a6e2f26fe766ed781270cc8bed950d6a0c4f510a8e442cc5649f40dea2a8f
5
5
  SHA512:
6
- metadata.gz: a31f920df196e7c39fc232ee27c437f5fcbaff163675f57a931761ec1f6ee8f2c8c9659e346a3b6b7559a2ce263d0ebe2b8fd5a00fd5667aeab9d0e21aaf97a5
7
- data.tar.gz: d00f112746b3b056c98a1480e7c172c6b0a877042f7430a549bfa9d2114057a9bb6e90294385b5af6684358893715412ebeb7a4aa3d1ef970e7e4cf939ec7bc6
6
+ metadata.gz: 49dbba58b16a1a47fe7616bc6ee866b64cdf474b385ff9dc73d584877ba4b70203f195fafd91614c76fffd04bb4b6ba59002f1290e60372ddb9917a5ce97cf94
7
+ data.tar.gz: 8eea32117820b1b9c03b5c88732fa5071e20cde66a9cdbfe4af7d11d741b2d112bdce0bd27ca727828b5c106c619ce7177eaf015b843a525455d5356713b5828
checksums.yaml.gz.sig CHANGED
Binary file
@@ -131,7 +131,6 @@ module RbSys
131
131
  # We want to use the same linker that Ruby uses, so that the linker flags from
132
132
  # mkmf work properly.
133
133
  def linker_args
134
- # Have to handle CC="cl /nologo" on mswin
135
134
  cc_flag = Shellwords.split(makefile_config("CC"))
136
135
  linker = cc_flag.shift
137
136
  link_args = cc_flag.flat_map { |a| ["-C", "link-arg=#{a}"] }
@@ -142,8 +141,11 @@ module RbSys
142
141
  end
143
142
 
144
143
  def mswin_link_args
145
- libruby = ruby_static? ? makefile_config("LIBRUBY_A") : makefile_config("LIBRUBY")
146
- ["-C", "link-arg=#{libruby}"]
144
+ args = []
145
+ args += ["-l", makefile_config("LIBRUBYARG_SHARED").chomp(".lib")]
146
+ args += split_flags("LIBS").flat_map { |lib| ["-l", lib.chomp(".lib")] }
147
+ args += split_flags("LOCAL_LIBS").flat_map { |lib| ["-l", lib.chomp(".lib")] }
148
+ args
147
149
  end
148
150
 
149
151
  def libruby_args(dest_dir)
data/lib/rb_sys/mkmf.rb CHANGED
@@ -10,6 +10,8 @@ require_relative "mkmf/config"
10
10
  module RbSys
11
11
  # Helper class for creating Rust Makefiles
12
12
  module Mkmf
13
+ GLOBAL_RUSTFLAGS = ["--cfg=rb_sys_gem"]
14
+
13
15
  # Helper for building Rust extensions by creating a Ruby compatible makefile
14
16
  # for Rust. By using this class, your rust extension will be 100% compatible
15
17
  # with the rake-compiler gem, which allows for easy cross compilation.
@@ -62,6 +64,7 @@ module RbSys
62
64
 
63
65
  #{conditional_assign("RB_SYS_CARGO_PROFILE", builder.profile)}
64
66
  #{conditional_assign("RB_SYS_CARGO_FEATURES", builder.features.join(","))}
67
+ #{conditional_assign("RB_SYS_GLOBAL_RUSTFLAGS", GLOBAL_RUSTFLAGS.join(" "))}
65
68
  #{conditional_assign("RB_SYS_EXTRA_RUSTFLAGS", builder.extra_rustflags.join(" "))}
66
69
 
67
70
  # Set dirname for the profile, since the profiles do not directly map to target dir (i.e. dev -> debug)
@@ -105,7 +108,7 @@ module RbSys
105
108
  #{endif_stmt}
106
109
 
107
110
  #{env_vars(builder)}
108
- #{export_env("RUSTFLAGS", "$(RUSTFLAGS) $(RB_SYS_EXTRA_RUSTFLAGS)")}
111
+ #{export_env("RUSTFLAGS", "$(RB_SYS_GLOBAL_RUSTFLAGS) $(RB_SYS_EXTRA_RUSTFLAGS) $(RUSTFLAGS)")}
109
112
 
110
113
  FORCE: ;
111
114
 
@@ -113,13 +116,11 @@ module RbSys
113
116
  \t$(ECHO) creating target directory \\($(@)\\)
114
117
  \t$(Q) $(MAKEDIRS) $(TARGET_DIR)
115
118
 
116
- $(DEFFILE): $(TARGET_DIR)
117
- \t$(ECHO) generating $(@)
118
- \t$(Q) ($(COPY) $(srcdir)/$(TARGET).def $@ 2> /dev/null) || (echo EXPORTS && echo $(TARGET_ENTRY)) > $@
119
+ #{deffile_definition}
119
120
 
120
121
  #{optional_rust_toolchain(builder)}
121
122
 
122
- $(RUSTLIB): $(DEFFILE) FORCE
123
+ $(RUSTLIB): #{deffile_definition ? "$(DEFFILE) " : nil}FORCE
123
124
  \t$(ECHO) generating $(@) \\("$(RB_SYS_CARGO_PROFILE)"\\)
124
125
  \t$(Q) #{full_cargo_command}
125
126
 
@@ -185,6 +186,18 @@ module RbSys
185
186
  cargo_command
186
187
  end
187
188
 
189
+ def deffile_definition
190
+ warn("EXPORT_PREFIX is not defined, please require \"mkmf\" before requiring \"rb_sys/mkmf\"") unless defined?(EXPORT_PREFIX)
191
+
192
+ return unless defined?(EXPORT_PREFIX) && EXPORT_PREFIX
193
+
194
+ @deffile_definition ||= <<~MAKE
195
+ $(DEFFILE): $(TARGET_DIR)
196
+ \t$(ECHO) generating $(@)
197
+ \t$(Q) ($(COPY) $(srcdir)/$(TARGET).def $@ 2> /dev/null) || (echo EXPORTS && echo $(TARGET_ENTRY)) > $@
198
+ MAKE
199
+ end
200
+
188
201
  def optional_rust_toolchain(builder)
189
202
  <<~MAKE
190
203
  #{conditional_assign("RB_SYS_FORCE_INSTALL_RUST_TOOLCHAIN", builder.force_install_rust_toolchain)}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbSys
4
- VERSION = "0.9.36"
4
+ VERSION = "0.9.38"
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb_sys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.36
4
+ version: 0.9.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
@@ -30,7 +30,7 @@ cert_chain:
30
30
  Rl+ASkq2/1i07TkBpCf+2hq66+h/hx+/Y/KrUzXfe0jtvil0WESkJT2kqRqHWNhD
31
31
  9GKBxaQlXokNDtWCm1/gl6cD8WRZ0N5S4ZGJT1FLLsA=
32
32
  -----END CERTIFICATE-----
33
- date: 2022-11-05 00:00:00.000000000 Z
33
+ date: 2022-11-10 00:00:00.000000000 Z
34
34
  dependencies: []
35
35
  description:
36
36
  email:
metadata.gz.sig CHANGED
Binary file