Sha256: 71bf47cb67ff61814a88e71a4ba566bd94d086247f284fbe00e8361b1f00ebc2

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

require 'mkmf'

CMAKE = find_executable "cmake"
abort "cmake >= 3.2 is required" unless CMAKE

SCRIPT_DIR = File.expand_path('../', __FILE__)
SRC_DIR = File.join(SCRIPT_DIR, 'src')
CURRENT_DIR = Dir.pwd
LIB_DIR = File.expand_path('../../lib', SCRIPT_DIR)
INSTALL_DIR = File.join(LIB_DIR, 'virgil', 'crypto')
INCLUDE_DIRS = [
  RUBY_INCLUDE_DIR = RbConfig::CONFIG['rubyhdrdir'],
  RUBY_CONFIG_INCLUDE_DIR=RbConfig::CONFIG['rubyarchhdrdir']
].join(' ').quote
RUBY_LIB_DIR = RbConfig::CONFIG['libdir']

CMAKE_COMMAND = [
  CMAKE,
  '-DCMAKE_BUILD_TYPE=Release',
  "-DRUBY_VERSION=#{RUBY_VERSION}",
  "-DRUBY_INCLUDE_DIR=#{RUBY_INCLUDE_DIR}",
  "-DRUBY_CONFIG_INCLUDE_DIR=#{RUBY_CONFIG_INCLUDE_DIR}",
  "-DRUBY_INCLUDE_DIRS=#{INCLUDE_DIRS}",
  "-DRUBY_LIBRARY=#{RUBY_LIB_DIR}",
  '-DRUBY_LIB_NAME=native',
  '-DSWIG_MODULE_NAME=\"virgil::crypto::native\"',
  '-DCMAKE_SWIG_FLAGS=-autorename',
  "-DCMAKE_INSTALL_PREFIX=#{CURRENT_DIR}",
  "-DINSTALL_API_DIR_NAME=#{INSTALL_DIR}",
  "-DINSTALL_LIB_DIR_NAME=#{INSTALL_DIR}",
  '-DLANG=ruby',
  SRC_DIR
].join(' ')

system(CMAKE_COMMAND)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
virgil-crypto-2.0.2b2 ext/native/extconf.rb
virgil-crypto-2.0.2b1 ext/native/extconf.rb