ryb 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ryb/ninja.rb +20 -4
  3. data/lib/ryb/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb707fc36a01b1334c37b6f5acbd1031223cc552
4
- data.tar.gz: a27d120d06cf580cdca49645c7af9e6aa02379d0
3
+ metadata.gz: 8640199eb16f4e9ba71a9455cbe642ca4c3a8b2b
4
+ data.tar.gz: 5e8ab9305ada127d68496ceca96c3de4bffc47dc
5
5
  SHA512:
6
- metadata.gz: 39ebe38e3177c44a97fb97e3e2b26fbe58c4a983102b6f91f027ed9c9b38b1d538f6a32034f06e4f29fa8b4a11ebc88689ec01d0e81ae3c888be374aa0063a6c
7
- data.tar.gz: 6dbc2896494cd9f84917bec08617ade889dadb18fe7ee0fd7fe24280cfbc3b61639aa4d99d8dc702394daa4c6219d49fdbbd8cd6519b941ec38c4e9862e2d03a
6
+ metadata.gz: 9fea9b62733b7da8a3497243c6e8dd3cb59d27c31d8002758c11b729994b0ae73ddbf49990398de90a7aa325c86bcb3d0e0ee3572f28601f58e8bbdcdf4ec14d
7
+ data.tar.gz: 811921a91c99f17c1d45762c3e278e8eee1a9843d89444b915d40dba9227e0831e28f1f1263e05f6a4adb99f27573bde900f0962d77caf02e697cf8aa5c08b16
data/lib/ryb/ninja.rb CHANGED
@@ -27,7 +27,7 @@ module Ryb
27
27
  [:windows].map{|target| project.targets[target]}.compact.each do |target|
28
28
  [:x86, :x86_64].map{|arch| project.architectures[arch]}.compact.each do |arch|
29
29
  triplet = "#{config.name}_#{target.name}_#{arch.name}"
30
- (project.applications + project.libraries).each do |buildable|
30
+ (project.applications+project.libraries).each do |buildable|
31
31
  name = "#{buildable.name.pretty||buildable.name.capitalize} (#{config.name.pretty||config.name.capitalize}) for #{target.name.pretty||target.name.capitalize} (#{arch.name.pretty||arch.name.capitalize})"
32
32
  puts " Adding '#{name}'..."
33
33
  quadruplet = "#{buildable.name}_#{triplet}"
@@ -93,16 +93,32 @@ module Ryb
93
93
  outputs_to_inputs = Hash[sources.map{|source| ["${built}/obj/#{source.gsub(/\.[^.]+\z/,'')}.#{triplet}.obj", "${root}/#{source}"]}]
94
94
  build "cc_#{quadruplet}", outputs_to_inputs
95
95
  output = "#{buildable.name}${#{quadruplet}_suffix}"
96
+ inputs = outputs_to_inputs.map{|object,_| object}
97
+ dependencies = []
98
+ buildable.dependencies.each do |dependency|
99
+ dependency = (project.libraries.select{|buildable| buildable.name == dependency}).first
100
+ if dependency
101
+ case dependency.linkage
102
+ when :static
103
+ dependencies.push("${built}/lib/#{dependency.name}${#{dependency.name}_#{triplet}_suffix}.lib")
104
+ when :dynamic
105
+ # TODO(mtwilliams): Move import libraries to ${built}/lib.
106
+ dependencies.push("${built}/bin/#{dependency.name}${#{dependency.name}_#{triplet}_suffix}.lib")
107
+ end
108
+ else
109
+ raise "Not implemented, yet!"
110
+ end
111
+ end
96
112
  if buildable.is_a? Ryb::Application
97
- build "ld_#{quadruplet}", "${built}/bin/#{output}.exe" => outputs_to_inputs.map{|object,_| object}
113
+ build "ld_#{quadruplet}", "${built}/bin/#{output}.exe" => inputs+dependencies
98
114
  defaults "${built}/bin/#{output}.exe"
99
115
  elsif buildable.is_a? Ryb::Library
100
116
  case buildable.linkage
101
117
  when :static
102
- build "ar_#{quadruplet}", "${built}/lib/#{output}.lib" => outputs_to_inputs.map{|object,_| object}
118
+ build "ar_#{quadruplet}", "${built}/lib/#{output}.lib" => inputs
103
119
  when :dynamic
104
120
  # TODO(mtwilliams): Specify -DLL.
105
- build "ld_#{quadruplet}", "${built}/bin/#{output}.dll" => outputs_to_inputs.map{|object,_| object}
121
+ build "ld_#{quadruplet}", "${built}/bin/#{output}.dll" => inputs+dependencies
106
122
  end
107
123
  end
108
124
  end
data/lib/ryb/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Ryb
2
2
  module VERSION #:nodoc:
3
- MAJOR, MINOR, PATCH, PRE = [0, 1, 0]
3
+ MAJOR, MINOR, PATCH, PRE = [0, 1, 1]
4
4
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ryb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Williams