Class: Emplace::Windows
Instance Method Summary
collapse
Methods inherited from CMakeBuild
#cmake, #fetch, #sh, #test, #write_file
Instance Method Details
#arch ⇒ Object
122
123
124
125
126
127
128
129
|
# File 'lib/emplace.rb', line 122
def arch
case platform
when'x64'
'x64'
else
'x86'
end
end
|
#build(dir) ⇒ Object
133
134
135
|
# File 'lib/emplace.rb', line 133
def build(dir)
sh "cmake --build #{dir} --target install --config #{configuration}"
end
|
#cmake_generator ⇒ Object
114
115
116
117
118
119
120
121
|
# File 'lib/emplace.rb', line 114
def cmake_generator
case arch
when 'x86'
'Visual Studio 14'
when 'x64'
'Visual Studio 14 Win64'
end
end
|
#configuration ⇒ Object
151
152
153
|
# File 'lib/emplace.rb', line 151
def configuration
ENV['CONFIGURATION'] || 'Debug'
end
|
139
140
141
|
# File 'lib/emplace.rb', line 139
def (name, dir)
sh "7z x #{package_name(name)}", dir
end
|
#package(name, dir) ⇒ Object
136
137
138
|
# File 'lib/emplace.rb', line 136
def package(name, dir)
sh "7z a #{package_name(name)} #{name}", dir
end
|
#package_name(name) ⇒ Object
145
146
147
|
# File 'lib/emplace.rb', line 145
def package_name(name)
"#{name}-#{system_name}.zip"
end
|
148
149
150
|
# File 'lib/emplace.rb', line 148
def platform
ENV['PLATFORM'] || 'x64'
end
|
#system_name ⇒ Object
130
131
132
|
# File 'lib/emplace.rb', line 130
def system_name
"#{super}-msvc"
end
|