Module: LibSqreen::Paths

Defined in:
ext/libsqreen/paths.rb

Class Method Summary collapse

Class Method Details

.configObject



33
34
35
# File 'ext/libsqreen/paths.rb', line 33

def config
  RbConfig::MAKEFILE_CONFIG
end

.cpuObject



41
42
43
# File 'ext/libsqreen/paths.rb', line 41

def cpu
  RUBY_PLATFORM =~ /^(universal\.|)(.*?)-/ && $2
end

.header_filesObject



29
30
31
# File 'ext/libsqreen/paths.rb', line 29

def header_files
  ['waf.h']
end

.include_pathsObject



11
12
13
# File 'ext/libsqreen/paths.rb', line 11

def include_paths
  [Shellwords.escape(File.join(vendored_source_path, 'libsqreen', 'include'))]
end

.libnameObject



45
46
47
# File 'ext/libsqreen/paths.rb', line 45

def libname
  "libsqreen.#{config['LIBEXT']}"
end

.object_pathsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'ext/libsqreen/paths.rb', line 15

def object_paths
  objects = [
    File.join(vendored_source_path, 'libsqreen', cpu, platform, libname),
  ]

  return objects if platform == 'darwin'

  objects << File.join(vendored_source_path, 'libc++', cpu, platform, 'libc++.a')
  objects << File.join(vendored_source_path, 'libc++', cpu, platform, 'libc++abi.a')
  objects << File.join(vendored_source_path, 'libc++', cpu, platform, 'libunwind.a')

  objects
end

.platformObject



37
38
39
# File 'ext/libsqreen/paths.rb', line 37

def platform
  RUBY_PLATFORM =~ /(solaris|darwin|linux(?=-.*$)|linux$)/ && $1
end

.vendored_source_pathObject



49
50
51
# File 'ext/libsqreen/paths.rb', line 49

def vendored_source_path
  File.expand_path('../../../vendor', __FILE__)
end