Class: MxxRu::Cpp::Toolsets::GccMswinFamily

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

Overview

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

Direct Known Subclasses

GccCygwin, GccMingw

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, #dll_file_name, #enclose_linker_include_lib_options_into_brackes, #force_cpp0x_std, #initialize, #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_exe_command_lines, #make_lib_command_lines, #make_linker_include_lib_options, #obj_file_ext, #port_specific_exe_link_options, #setup_mandatory_options

Constructor Details

This class inherits a constructor from MxxRu::Cpp::Toolsets::GccFamily

Instance Method Details

#clean_dll_specific_files(a_dll_file, a_dll_info, a_target) ⇒ Object

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

Delete import library if exists.



342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/mxx_ru/cpp/toolsets/gcc_family.rb', line 342

def clean_dll_specific_files(
  a_dll_file,
  a_dll_info,
  a_target )

  # Delete import library if exists.
  if nil != a_dll_info.link_name
    implib_name = File.join( [ a_dll_info.link_path,
      lib_file_name( a_dll_info.link_name, a_target ) ] )
    MxxRu::Util::delete_file( implib_name )
  end
end

#exe_file_name(source_name, target) ⇒ Object

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



335
336
337
# File 'lib/mxx_ru/cpp/toolsets/gcc_family.rb', line 335

def exe_file_name( source_name, target )
  return construct_target_name( source_name, NO_PREFIX, ".exe", target )
end

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



356
357
358
359
360
361
362
363
364
365
366
# File 'lib/mxx_ru/cpp/toolsets/gcc_family.rb', line 356

def implib_link_name(
  dll_real_name,
  target )

  # It's required to pass import library name to linker on mswin platform
  if nil != target.mxx_implib_path
    return lib_link_name( target.mxx_target_name, target )
  end

  return nil
end

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



369
370
371
372
373
374
375
# File 'lib/mxx_ru/cpp/toolsets/gcc_family.rb', line 369

def implib_link_path(
  dll_real_name,
  dll_real_path,
  target )
  return target.mxx_obj_placement.get_lib(
    target.mxx_implib_path, self, target )
end

#make_dll_requirements(a_dll_name, a_dll_info, a_linker_lists, a_target) ⇒ Object

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



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/mxx_ru/cpp/toolsets/gcc_family.rb', line 378

def make_dll_requirements(
  a_dll_name,
  a_dll_info,
  a_linker_lists,
  a_target )

  result = DllRequirements.new

  # Dependencies are exists only if import library is present.
  if nil != a_dll_info.link_name
    result.add_libs( [ a_dll_info.link_name ] )
    result.add_lib_paths( [ a_dll_info.link_path ] )
  end

  return result
end

Return string containing port-specific linker option for DLL linking.

All parameters are similar to make_dll_command_lines parameters.

Return empty string in a base class.



400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/mxx_ru/cpp/toolsets/gcc_family.rb', line 400

def port_specific_dll_link_options(
  a_dll_name, a_dll_info, a_linker_lists, a_target )
  # Build import library if it's required.
  if nil != a_dll_info.link_name
    full_lib_name = File.join( [ a_dll_info.link_path,
      lib_file_name( a_dll_info.link_name, a_target ) ] )

    return "-Wl,--out-implib=#{full_lib_name}" +
      ",--export-all-symbols"
  end

  return ""
end

#port_specific_lib_name_checker(library_name) ⇒ Object

Checks library name for suffix ‘.lib’ and return name without that suffix.



416
417
418
419
420
421
422
# File 'lib/mxx_ru/cpp/toolsets/gcc_family.rb', line 416

def port_specific_lib_name_checker(library_name)
  if /\.lib$/i =~ library_name
    MxxRu::Util::remove_file_ext(library_name)            
  else
    library_name
  end
end