class MxxRu::Cpp::Toolsets::Gcc_mingw

Toolset implemetation for GCC compiler for Win32. This class is a base class for both MinGW and Cygwin

Public Class Methods

new( a_name = "gcc" ) click to toggle source
Calls superclass method MxxRu::Cpp::Toolsets::GccFamily::new
# File lib/mxx_ru/cpp/toolsets/gcc_mingw.rb, line 40
def initialize( a_name = "gcc" )
  super( a_name )

  setup_tag( GCC_PORT_TAG, GCC_PORT_MINGW )
  setup_tag( "host_os", "mswin" )
  setup_tag( "target_os", "mswin" )
end

Public Instance Methods

make_mswin_res_command_lines( res_name, rc_file, rc_options, target ) click to toggle source

See description at MxxRu::Cpp::Toolset#make_mswin_res_command_lines.

# File lib/mxx_ru/cpp/toolsets/gcc_mingw.rb, line 96
def make_mswin_res_command_lines(
  res_name,
  rc_file,
  rc_options,
  target )

  return [ "#{rc_name} " +
    "#{rc_options.join(' ')} " +
    "-o #{res_name} #{rc_file}" ]
end
mswin_res_file_name( source_name ) click to toggle source

See description at MxxRu::Cpp::Toolset#mswin_res_file_name.

# File lib/mxx_ru/cpp/toolsets/gcc_mingw.rb, line 91
def mswin_res_file_name( source_name )
  return source_name + ".res.o"
end
rc_name() click to toggle source

Returns resource compiler name.

# File lib/mxx_ru/cpp/toolsets/gcc_mingw.rb, line 49
def rc_name
  tag( RC_NAME_TAG, "windres" )
end
setup_mandatory_options( target ) click to toggle source

See description at MxxRu::Cpp::Toolset#setup_mandatory_options.

Setups resource compiler parameters.

Required options are set up based on screen_mode.

# File lib/mxx_ru/cpp/toolsets/gcc_mingw.rb, line 58
def setup_mandatory_options( target )
  super( target )

  if SCREEN_WINDOW == target.mxx_screen_mode
    target.linker_option( "-mwindows" )
  else
    target.linker_option( "-mconsole" )
  end

  if THREADING_MULTI == target.mxx_threading_mode
    target.compiler_option( "-mthreads" )
  end

  # All defines and all include_path should be distributed to resource compiler.
  target.mxx_all_defines.each { |d|
    target.mswin_rc_option( "-D " + d )
  }

  target.mxx_all_include_paths.each { |p|
    target.mswin_rc_option( "--include-dir=" + p )
  }

  # Personal resource compiler options.
  target.mxx_all_mswin_rc_defines.each { |d|
    target.mswin_rc_option( "-D " + d )
  }
  target.mxx_all_mswin_rc_include_paths.each { |p|
    target.mswin_rc_option( "--include-dir=" + p )
  }

end