Class: Emplace::Windows

Inherits:
CMakeBuild show all
Defined in:
lib/emplace.rb

Instance Method Summary collapse

Methods inherited from CMakeBuild

#cmake, #fetch, #sh, #test, #write_file

Instance Method Details

#archObject



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_generatorObject



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

#configurationObject



151
152
153
# File 'lib/emplace.rb', line 151

def configuration
  ENV['CONFIGURATION'] || 'Debug'
end

#extract(name, dir) ⇒ Object



139
140
141
# File 'lib/emplace.rb', line 139

def extract(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

#platformObject



148
149
150
# File 'lib/emplace.rb', line 148

def platform
  ENV['PLATFORM'] || 'x64'
end

#system_nameObject



130
131
132
# File 'lib/emplace.rb', line 130

def system_name
  "#{super}-msvc"
end