Top Level Namespace

Defined Under Namespace

Modules: Fiddle

Instance Method Summary collapse

Instance Method Details

#disable_optimization_build_flag(flags) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'ext/fiddle/extconf.rb', line 10

def disable_optimization_build_flag(flags)
  if gcc?
    expanded_flags = RbConfig.expand(flags.dup)
    optimization_option_pattern = /(^|\s)?-O\d(\s|$)?/
    if optimization_option_pattern.match?(expanded_flags)
      expanded_flags.gsub(optimization_option_pattern, '\\1-Og\\2')
    else
      flags + " -Og"
    end
  else
    flags
  end
end

#enable_debug_build_flag(flags) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'ext/fiddle/extconf.rb', line 24

def enable_debug_build_flag(flags)
  if gcc?
    expanded_flags = RbConfig.expand(flags.dup)
    debug_option_pattern = /(^|\s)-g(?:gdb)?\d?(\s|$)/
    if debug_option_pattern.match?(expanded_flags)
      expanded_flags.gsub(debug_option_pattern, '\\1-ggdb3\\2')
    else
      flags + " -ggdb3"
    end
  else
    flags
  end
end

#gcc?Boolean

:stopdoc:

Returns:

  • (Boolean)


6
7
8
# File 'ext/fiddle/extconf.rb', line 6

def gcc?
  RbConfig::CONFIG["GCC"] == "yes"
end