Sha256: b792b8a4ac8f7f986abfe5249643655157aa80628feccb84fee817a70429514d

Contents?: true

Size: 1.92 KB

Versions: 26

Compression:

Stored size: 1.92 KB

Contents

require_relative'../../common/utils'
require_relative '../toolchain/provider'
require_relative '../toolchain/errorparser/error_parser'
require_relative '../toolchain/errorparser/gcc_compiler_error_parser'
require_relative '../toolchain/errorparser/gcc_linker_error_parser'

module Bake
  module Toolchain
    gccCompilerErrorParser = GCCCompilerErrorParser.new

    CLANG_CHAIN = Provider.add("CLANG")

    CLANG_CHAIN[:COMPILER][:CPP].update({
      :COMMAND => "clang++",
      :DEFINE_FLAG => "-D",
      :OBJECT_FILE_FLAG => "-o",
      :OBJ_FLAG_SPACE => true,
      :COMPILE_FLAGS => "-c ",
      :DEP_FLAGS => "-MD -MF",
      :DEP_FLAGS_SPACE => true,
      :ERROR_PARSER => gccCompilerErrorParser
    })

    CLANG_CHAIN[:COMPILER][:C] = Utils.deep_copy(CLANG_CHAIN[:COMPILER][:CPP])
    CLANG_CHAIN[:COMPILER][:C][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:C][:SOURCE_FILE_ENDINGS]
    CLANG_CHAIN[:COMPILER][:C][:COMMAND] = "clang"

    CLANG_CHAIN[:COMPILER][:ASM] = Utils.deep_copy(CLANG_CHAIN[:COMPILER][:C])
    CLANG_CHAIN[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS]
    CLANG_CHAIN[:COMPILER][:ASM][:PREFIX] = Provider.default[:COMPILER][:ASM][:PREFIX]

    if Bake::Utils::OS::name == "Mac"
      CLANG_CHAIN[:ARCHIVER][:COMMAND] = "libtool"
      CLANG_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "-static -o"
    else
      CLANG_CHAIN[:ARCHIVER][:COMMAND] = "ar"
      CLANG_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "r"
    end

    CLANG_CHAIN[:ARCHIVER][:ERROR_PARSER] = gccCompilerErrorParser

    CLANG_CHAIN[:LINKER][:COMMAND] = "clang++"
    CLANG_CHAIN[:LINKER][:SCRIPT] = "-T"
    CLANG_CHAIN[:LINKER][:USER_LIB_FLAG] = "-l:"
    CLANG_CHAIN[:LINKER][:EXE_FLAG] = "-o"
    CLANG_CHAIN[:LINKER][:LIB_FLAG] = "-l"
    CLANG_CHAIN[:LINKER][:LIB_PATH_FLAG] = "-L"

    CLANG_CHAIN[:LINKER][:ERROR_PARSER] = GCCLinkerErrorParser.new
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
bake-toolkit-2.65.2 lib/bake/toolchain/clang.rb
bake-toolkit-2.65.1 lib/bake/toolchain/clang.rb
bake-toolkit-2.65.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.64.4 lib/bake/toolchain/clang.rb
bake-toolkit-2.64.3 lib/bake/toolchain/clang.rb
bake-toolkit-2.64.2 lib/bake/toolchain/clang.rb
bake-toolkit-2.64.1 lib/bake/toolchain/clang.rb
bake-toolkit-2.64.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.63.2 lib/bake/toolchain/clang.rb
bake-toolkit-2.63.1 lib/bake/toolchain/clang.rb
bake-toolkit-2.63.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.62.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.61.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.60.2 lib/bake/toolchain/clang.rb
bake-toolkit-2.60.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.59.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.58.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.57.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.56.0 lib/bake/toolchain/clang.rb
bake-toolkit-2.55.1 lib/bake/toolchain/clang.rb