Sha256: ed631aeb9af3621edb7b5552fd1b09ec30fb59eaabc1b20d776068e6091c82f8
Contents?: true
Size: 1005 Bytes
Versions: 36
Compression:
Stored size: 1005 Bytes
Contents
require 'rbconfig' require File.expand_path '../compiler/generic_compiler', __FILE__ require File.expand_path '../compiler/gcc', __FILE__ require File.expand_path '../compiler/clang', __FILE__ require File.expand_path '../compiler/apple_llvm', __FILE__ module Libv8 module Compiler module_function def type_of(compiler) case version_string_of(compiler) when /^Apple LLVM\b/ then AppleLLVM when /\bclang\b/i then Clang when /^gcc/i then GCC else GenericCompiler end end def version_string_of(compiler) command_result = execute_command "env LC_ALL=C LANG=C #{compiler} -v 2>&1" unless command_result.status.success? raise "Could not get version string of compiler #{compiler}" end command_result.output end def execute_command(command) output = `#{command}` status = $? ExecutionResult.new output, status end class ExecutionResult < Struct.new(:output, :status) end end end
Version data entries
36 entries across 36 versions & 1 rubygems