class MxxRu::Cpp::Toolsets::ClangMswinFamily

Toolset implemetation for Clang compiler for Win32.

Public Instance Methods

clean_dll_specific_files( a_dll_file, a_dll_info, a_target ) click to toggle source

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

Delete import library if exists.

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 257
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
dll_file_name( source_name, target ) click to toggle source

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

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 237
def dll_file_name( source_name, target )
  return construct_target_name( source_name, NO_PREFIX, '.dll', target )
end
enclose_linker_include_lib_options_into_brackes( options ) click to toggle source
# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 343
def enclose_linker_include_lib_options_into_brackes( options )
  " #{options} "
end
exe_file_name( source_name, target ) click to toggle source

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

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 227
def exe_file_name( source_name, target )
  return construct_target_name( source_name, NO_PREFIX, ".exe", target )
end
lib_file_name( source_name, target ) click to toggle source

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

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 232
def lib_file_name( source_name, target )
  return construct_target_name( source_name, NO_PREFIX, '.lib', target )
end
lib_linking_mode_switch( linking_mode ) click to toggle source

Return command line switch for forcing specified library type.

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 339
def lib_linking_mode_switch( linking_mode )
  ""
end
librarian_name() click to toggle source

Returns librarian name.

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 217
def librarian_name
  tag( LIBRARIAN_NAME_TAG, "llvm-ar" )
end
make_dll_requirements( a_dll_name, a_dll_info, a_linker_lists, a_target ) click to toggle source

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

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 293
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
make_lib_command_lines( lib_name, obj_files, librarian_options, target ) click to toggle source

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

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 242
def make_lib_command_lines(
  lib_name,
  obj_files,
  librarian_options,
  target )

  result = "r #{librarian_options.join(' ')} " +
    "#{lib_name} #{obj_files.join(' ')}"

  return [ "#{librarian_name} #{result}" ]
end
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/clang_family.rb, line 353
def make_mswin_res_command_lines(
  res_name,
  rc_file,
  rc_options,
  target )

  return [ "#{rc_name} " +
    "#{rc_options.join(' ')} /r " +
    "/fo#{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/clang_family.rb, line 348
def mswin_res_file_name( source_name )
  return source_name + ".res"
end
port_specific_lib_name_checker(library_name) click to toggle source

Checks library name for suffix '.lib' and return name without that suffix.

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 330
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
rc_name() click to toggle source

Returns resource compiler name.

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 222
def rc_name
  return tag( RC_NAME_TAG, "rc" )
end
setup_mandatory_options( target ) click to toggle source

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

# File lib/mxx_ru/cpp/toolsets/clang_family.rb, line 191
def setup_mandatory_options( target )

  super( target )

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

  target.mxx_all_include_paths.each { |p|
    target.compiler_option( "-I" + p )
    target.mswin_rc_option( "/i" + p )
  }

  # Resource compiler specific 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( "/i" + p )
  }
end