Class: MxxRu::Cpp::Toolsets::GccDarwin

Inherits:
GccFamily
  • Object
show all
Defined in:
lib/mxx_ru/cpp/toolsets/gcc_darwin.rb

Overview

Toolset implemetation for GCC compiler for MacOS X (Darwin).

Constant Summary

Constants inherited from GccFamily

MxxRu::Cpp::Toolsets::GccFamily::GCC_PORT_CYGWIN, MxxRu::Cpp::Toolsets::GccFamily::GCC_PORT_MINGW, MxxRu::Cpp::Toolsets::GccFamily::GCC_PORT_TAG, MxxRu::Cpp::Toolsets::GccFamily::GCC_PORT_UNIX

Instance Method Summary collapse

Methods inherited from GccFamily

#c_compiler_name, #cpp_compiler_name, #exe_file_name, #force_cpp0x_std, #implib_link_name, #implib_link_path, #lib_file_name, #lib_link_name, #librarian_name, #linker_name, #make_c_obj_command_lines, #make_cpp_obj_command_lines, #make_dll_command_lines, #make_dll_requirements, #make_exe_command_lines, #make_lib_command_lines, #make_linker_include_lib_options, #obj_file_ext, #port_specific_dll_link_options, #port_specific_exe_link_options, #port_specific_lib_name_checker

Constructor Details

#initialize(a_name = "gcc") ⇒ GccDarwin

Returns a new instance of GccDarwin.



38
39
40
41
42
43
44
45
# File 'lib/mxx_ru/cpp/toolsets/gcc_darwin.rb', line 38

def initialize( a_name = "gcc" )
  super( a_name )

  setup_tag( GCC_PORT_TAG, GCC_PORT_UNIX )
  setup_tag( "host_os", "unix" )
  setup_tag( "target_os", "unix" )
  setup_tag( "unix_port", "darwin" )
end

Instance Method Details

#dll_file_name(source_name, target) ⇒ Object

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

If we are building bundle then extension should be ‘.bundle’



71
72
73
74
75
76
77
# File 'lib/mxx_ru/cpp/toolsets/gcc_darwin.rb', line 71

def dll_file_name( source_name, target )
  if target.target_type.name == MacOSBundleTargetType::TYPE
    construct_target_name( source_name, 'lib', '.bundle', target )
  else
    super
  end
end

#enclose_linker_include_lib_options_into_brackes(options) ⇒ Object

There ins’t any bracket on MacOS X.



64
65
66
# File 'lib/mxx_ru/cpp/toolsets/gcc_darwin.rb', line 64

def enclose_linker_include_lib_options_into_brackes( options )
  options
end

#setup_mandatory_options(target) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/mxx_ru/cpp/toolsets/gcc_darwin.rb', line 47

def setup_mandatory_options( target )
  super( target )

  if target.target_type.name == DllTargetType::TYPE
    target.linker_option( "-prebind" )
    target.linker_option( "-dynamiclib" )
    target.linker_option( "-single_module" )
  elsif target.target_type.name == MacOSBundleTargetType::TYPE
    target.linker_option( "-prebind" )
    target.linker_option( "-bundle" )
    target.linker_option( "-single_module" )
  elsif target.target_type.name == ExeTargetType::TYPE
    target.linker_option( "-prebind" )
  end
end