ryb 0.2.0.3 → 0.2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e105917adf373e3f300976e75698d67cfbfdf0c
4
- data.tar.gz: 7ed7d76c858b36d4028d5fd024b0f74d8f5213ab
3
+ metadata.gz: f669ebc63d3f7cd43065a2fa8f720c5e766d473d
4
+ data.tar.gz: b8173d293781e933906d75631e9e8d7d3ebf4724
5
5
  SHA512:
6
- metadata.gz: 42f190480119ca9191efcc91ac3ce6689c9b73f242e35b763b756e1c33c240708c3078f1dc7aa1f9a199b8fc885fefe4a6134d08eed1978e3e0543eeb69069b0
7
- data.tar.gz: 40782b36d9c61193297dc6bdcec82172c17be5bc98af9501d35998611e97116abd369f9b2c75af69373bbfd0aea15fed59720693393a55bcedc636c272cddeb7
6
+ metadata.gz: b0e7d3cac2c0d76bfd21d46ec982aa7c1ccd24edf55703bcba05e69ed4c1fed78d4d8769ebfcd3dcd961ae92c5a7fee5e9229cc5c5dbbd14db5c6094cf076ea4
7
+ data.tar.gz: a00d6dee9ce6f61d26a97cb31d08a03cd9986cfffd0fac16a50b354acbc41d792868ea97cf9129243ef8cf764fb42e254713a8a1de8aed4500539fbe07349280
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ryb (0.2.0.1)
4
+ ryb (0.2.1.0)
5
5
  gli (~> 2)
6
6
  hashie
7
7
  ninja-gen
@@ -11,7 +11,7 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- aruba (0.13.0)
14
+ aruba (0.14.0)
15
15
  childprocess (~> 0.5.6)
16
16
  contracts (~> 0.9)
17
17
  cucumber (>= 1.3.19)
@@ -41,7 +41,7 @@ GEM
41
41
  hashie (3.4.3)
42
42
  multi_json (1.11.2)
43
43
  multi_test (0.1.2)
44
- ninja-gen (0.1.1.1)
44
+ ninja-gen (0.1.3.0)
45
45
  pour (0.0.3.1)
46
46
  typespec
47
47
  rspec (3.4.0)
@@ -58,7 +58,7 @@ GEM
58
58
  rspec-support (~> 3.4.0)
59
59
  rspec-support (3.4.1)
60
60
  thor (0.19.1)
61
- typespec (0.1.0.8)
61
+ typespec (0.1.1.1)
62
62
  visual_studio (0.1.0.2)
63
63
 
64
64
  PLATFORMS
@@ -17,13 +17,24 @@ module Ryb
17
17
 
18
18
  class ExternalDependency < Dependency
19
19
  property :lib_or_framework, Typespec.string
20
+ property :mangler, Typespec.or[Typespec.fn, Typespec.nothing]
20
21
 
21
- def initialize(lib_or_framework)
22
+ def initialize(lib_or_framework, opts={})
22
23
  self.lib_or_framework = lib_or_framework
24
+ self.mangler = opts[:mangler]
25
+ end
26
+
27
+ def mangled(*triplet)
28
+ if self.mangler()
29
+ self.mangler.(triplet, self.lib_or_framework())
30
+ else
31
+ self.lib_or_framework
32
+ end
23
33
  end
24
34
 
25
35
  alias :eql? :==
26
36
  def ==(other)
37
+ return false unless self.mangler == other.mangler
27
38
  self.lib_or_framework == other.lib_or_framework
28
39
  end
29
40
  end
@@ -147,9 +147,19 @@ module Ryb
147
147
  @spec.dependencies = @spec.dependencies + [Ryb::InternalDependency.new(product)]
148
148
  end
149
149
 
150
- def add_external_dependency(lib_or_framework)
150
+ def add_dependencies(products)
151
+ [*products].each(&self.add_dependency)
152
+ end
153
+
154
+ def add_external_dependency(lib_or_framework, opts={})
151
155
  @spec.dependencies ||= []
152
- @spec.dependencies = @spec.dependencies + [Ryb::ExternalDependency.new(lib_or_framework)]
156
+ @spec.dependencies = @spec.dependencies + [Ryb::ExternalDependency.new(lib_or_framework, opts)]
157
+ end
158
+
159
+ def add_external_dependencies(libs_and_frameworks, opts={})
160
+ [*libs_and_frameworks].each do |lib_or_framework|
161
+ self.add_external_dependency(lib_or_framework, opts)
162
+ end
153
163
  end
154
164
  end
155
165
 
@@ -41,7 +41,7 @@ module Ryb
41
41
  end
42
42
 
43
43
  module VERSION #:nodoc:
44
- MAJOR, MINOR, PATCH, PRE = [0, 2, 0, 3]
44
+ MAJOR, MINOR, PATCH, PRE = [0, 2, 1, 0]
45
45
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
46
46
  end
47
47
 
@@ -18,6 +18,9 @@ module Ryb
18
18
  end
19
19
 
20
20
  def generate
21
+ @ninjafile.rule "mv", "move /Y $in $out"
22
+ @ninjafile.rule "cp", "move /Y /B $in $out"
23
+
21
24
  @ninjafile.save(@path)
22
25
  end
23
26
 
@@ -101,7 +104,7 @@ module Ryb
101
104
 
102
105
  @ninjafile.rule(
103
106
  "so_#{namespace}",
104
- "ninja -t msvc -e #{env_block} -- link.exe $#{namespace}_ldflags_sys $#{namespace}_ldflags /DLL /OUT:$out $#{namespace}_deps $in"
107
+ "ninja -t msvc -e #{env_block} -- link.exe $#{namespace}_ldflags_sys $#{namespace}_ldflags /DLL /IMPLIB:$#{namespace}_as_linkable /OUT:$out $#{namespace}_deps $in"
105
108
  )
106
109
 
107
110
  c_sources = sources.select{|src| src.language == :c}.map(&:path).map{|src| "#@root/#{src}"}
@@ -115,12 +118,15 @@ module Ryb
115
118
  case product
116
119
  when Ryb::Application
117
120
  @ninjafile.build "ld_#{namespace}", {artifacts[0] => c_objects + cxx_objects}
121
+ @ninjafile.alias namespace, artifacts[0]
118
122
  when Ryb::Library
119
123
  case product.linkage
120
124
  when :static
121
125
  @ninjafile.build "ar_#{namespace}", {artifacts[0] => c_objects + cxx_objects}
126
+ @ninjafile.alias namespace, artifacts[0]
122
127
  when :dynamic
123
128
  @ninjafile.build "so_#{namespace}", {artifacts[1] => c_objects + cxx_objects}
129
+ @ninjafile.alias namespace, artifacts[1]
124
130
  end
125
131
  end
126
132
  end
@@ -144,7 +150,9 @@ module Ryb
144
150
  when Ryb::InternalDependency
145
151
  "${#{dep.product}_#{tripletised.triplet.join('_')}_as_linkable}"
146
152
  when Ryb::ExternalDependency
147
- dep.lib_or_framework
153
+ triplet = [tripletised.configuration, tripletised.platform, tripletised.architecture].map(&:name).map(&:to_sym)
154
+ mangled = dep.mangled(*triplet)
155
+ "#{mangled}.lib"
148
156
  end
149
157
  end
150
158
  end
@@ -174,6 +182,7 @@ module Ryb
174
182
  cflags_for_configuration(tripletised.configuration) +
175
183
  cflags_for_platform(tripletised.platform) +
176
184
  cflags_for_architecture(tripletised.architecture)
185
+ flags += VisualStudio::Compiler.include_paths_to_flags(project.paths.includes) if project.paths
177
186
  flags += VisualStudio::Compiler.include_paths_to_flags(product.paths.includes) if product.paths
178
187
  flags += VisualStudio::Compiler.defines_to_flags(project.defines)
179
188
  flags += VisualStudio::Compiler.defines_to_flags(product.defines)
@@ -185,11 +194,13 @@ module Ryb
185
194
  %w{/nologo}
186
195
  end
187
196
 
188
- def ldflags_for_product(_project, product, tripletised)
197
+ def ldflags_for_product(project, product, tripletised)
189
198
  flags = VisualStudio::Linker::STANDARD_FLAGS +
190
199
  ldflags_for_configuration(tripletised.configuration) +
191
200
  ldflags_for_platform(tripletised.platform) +
192
201
  ldflags_for_architecture(tripletised.architecture)
202
+ flags += VisualStudio::Linker.library_paths_to_flags(project.paths.libraries) if project.paths
203
+ flags += VisualStudio::Linker.library_paths_to_flags(product.paths.libraries) if product.paths
193
204
  flags += VisualStudio::Linker.architecture_to_flags(tripletised.architecture.name.to_sym)
194
205
  # TODO: Linkage.
195
206
  flags
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ryb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.3
4
+ version: 0.2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-07 00:00:00.000000000 Z
11
+ date: 2016-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli