ryb 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ryb/ninja.rb +20 -4
- data/lib/ryb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8640199eb16f4e9ba71a9455cbe642ca4c3a8b2b
|
4
|
+
data.tar.gz: 5e8ab9305ada127d68496ceca96c3de4bffc47dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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" =>
|
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" =>
|
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" =>
|
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