Class: Inliner::Compilers::TCC

Inherits:
Compiler
  • Object
show all
Defined in:
lib/ffi-inliner/inliner.rb

Instance Attribute Summary

Attributes inherited from Compiler

#progname

Instance Method Summary collapse

Methods inherited from Compiler

check_and_create, #compile, #initialize

Constructor Details

This class inherits a constructor from Inliner::Compilers::Compiler

Instance Method Details

#cmdObject



123
124
125
126
127
128
129
# File 'lib/ffi-inliner/inliner.rb', line 123

def cmd
  if Config::CONFIG['target_os'] =~ /mswin|mingw/
    "tcc -rdynamic -shared #{libs} -o \"#{@fm.so_fn}\" \"#{@fm.c_fn}\" 2>\"#{@fm.log_fn}\""
  else
    "tcc -shared #{libs} -o \"#{@fm.so_fn}\" \"#{@fm.c_fn}\" 2>\"#{@fm.log_fn}\""
  end
end

#exists?Boolean

Returns:

  • (Boolean)


120
121
122
# File 'lib/ffi-inliner/inliner.rb', line 120

def exists?
  IO.popen("#{@progname}") { |f| f.gets } ? true : false
end