Sha256: a70199ff0220797a57f3a0a4c676e6ce88e060b946a0270292c1c58ae34459e5

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

require 'fileutils'
require 'mkmf'
require 'rbconfig'
include FileUtils

LIBDIR       = RbConfig::CONFIG['libdir']
INCLUDEDIR   = RbConfig::CONFIG['includedir']
EXT_DIR      = File.expand_path(File.join(File.dirname(__FILE__), 'graphql-idl-parser'))
FFI_DIR      = File.expand_path(File.join(EXT_DIR, 'graphql-idl-parser-ffi'))
HEADER_DIR   = File.expand_path(File.join(EXT_DIR, 'graphql-idl-parser-ffi', 'includes'))

if ENV['TRAVIS']
  type = 'debug'
  target = ''
  flag = '-O0'
else
  type = 'release'
  target = '--release'
  flag = '-O2'
end

RELEASE_DIR  = File.join(FFI_DIR, 'target', type)

if !system('cargo --version') || !system('rustc --version')
  raise '\n\n\n[ERROR]: You have to install Rust with Cargo (https://www.rust-lang.org/)'
end

`cargo build #{target} --manifest-path #{File.join(FFI_DIR, 'Cargo.toml')}`

$LIBS << ' -lgraphqlidlparser'

HEADER_DIRS = [INCLUDEDIR, HEADER_DIR]
LIB_DIRS = [LIBDIR, RELEASE_DIR]

dir_config('graphql-idl-parser', HEADER_DIRS, LIB_DIRS)

$CFLAGS << " #{flag} -std=c11 -Wall -pedantic -Werror -Wfatal-errors -Wstrict-aliasing"

create_makefile('graphql-idl-parser/graphqlidlparser')

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
graphql-idl-parser-0.1.1 ext/graphql-idl-parser/extconf.rb
graphql-idl-parser-0.1.0 ext/graphql-idl-parser/extconf.rb
graphql-idl-parser-0.0.1 ext/graphql-idl-parser/extconf.rb