Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  BUILD.gn   Sprache: unbekannt

 
# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//chromium/build/config/features.gni")
import("//libwebrtc/webrtc.gni")
import("//testing/test.gni")

# Only applied to CRC32C source and tests. (not exported)
config("crc32c_config") {
  visibility = [ ":*" ]

  include_dirs = [
    "config",
    "src/include",
  ]

  defines = [
    "BYTE_ORDER_BIG_ENDIAN=0",
    "CRC32C_TESTS_BUILT_WITH_GLOG=0",
  ]

  # If we ever support big-endian builds, add logic to conditionally enable
  # BYTE_ORDER_BIG_ENDIAN.

  if (current_cpu == "x86" || current_cpu == "x64") {
    defines += [
      "HAVE_MM_PREFETCH=1",
      "HAVE_SSE42=1",
    ]
    # To enable HAVE_SSE42 we need to build libwebrtc with -msse4.2
    # rather than -msse2.  See Bug 1927652 for making the sse4.2 build
    # change.  See Bug 1927655 for removing this build modification.
    if (build_with_mozilla) {
      defines += [ "HAVE_SSE42=0" ]
    }
  } else {
    defines += [
      "HAVE_MM_PREFETCH=0",
      "HAVE_SSE42=0",
    ]
  }
  if (is_clang || !is_win) {
    defines += [ "HAVE_BUILTIN_PREFETCH=1" ]
  } else {
    defines += [ "HAVE_BUILTIN_PREFETCH=0" ]
  }

  # See Bug 1927660 for re-enabling the ARM64 specific code that uses
  # ExtendArm64 rather than ExtendPortable.
  if (!build_with_mozilla && current_cpu == "arm64") {
    defines += [ "HAVE_ARM64_CRC32C=1" ]
  } else {
    defines += [ "HAVE_ARM64_CRC32C=0" ]
  }

  # Android added <sys/auxv.h> in API level 18.
  if (is_linux || is_chromeos || is_android) {
    defines += [
      "HAVE_STRONG_GETAUXVAL=1",
      "HAVE_WEAK_GETAUXVAL=1",
    ]
  } else {
    defines += [
      "HAVE_STRONG_GETAUXVAL=0",
      "HAVE_WEAK_GETAUXVAL=0",
    ]
  }
}

source_set("crc32c") {
  sources = [
    "src/include/crc32c/crc32c.h",
    "src/src/crc32c.cc",
    "src/src/crc32c_portable.cc",
  ]

  configs += [ ":crc32c_config" ]
  deps = [
    ":crc32c_arm64",
    ":crc32c_internal_headers",
    ":crc32c_sse42",
  ]
}

source_set("crc32c_sse42") {
  visibility = [ ":*" ]

  sources = [
    "src/src/crc32c_sse42.cc",
    "src/src/crc32c_sse42.h",
    "src/src/crc32c_sse42_check.h",
  ]

  configs += [ ":crc32c_config" ]
  if (current_cpu == "x86" || current_cpu == "x64") {
    if (is_win && !is_clang) {
      cflags = [ "/arch:AVX" ]
    } else {
      cflags = [ "-msse4.2" ]
    }
  }

  deps = [ ":crc32c_internal_headers" ]
}

source_set("crc32c_arm64") {
  visibility = [ ":*" ]

  sources = [
    "src/src/crc32c_arm64.cc",
    "src/src/crc32c_arm64.h",
    "src/src/crc32c_arm64_check.h",
  ]

  configs += [ ":crc32c_config" ]
  if (current_cpu == "arm64") {
    if (is_clang) {
      cflags = [
        "-march=armv8-a",

        # Some builds set -march to a different value from the above.
        # The specific feature flags below enable the instructions we need
        # in these cases. See https://crbug.com/934016 for example.
        "-Xclang",
        "-target-feature",
        "-Xclang",
        "+crc",
        "-Xclang",
        "-target-feature",
        "-Xclang",
        "+crypto",
        "-Xclang",
        "-target-feature",
        "-Xclang",
        "+aes",
      ]
    } else {
      cflags = [ "-march=armv8-a+crc+crypto" ]
    }
  }

  deps = [ ":crc32c_internal_headers" ]
}

source_set("crc32c_internal_headers") {
  sources = [
    "config/crc32c/crc32c_config.h",
    "src/src/crc32c_internal.h",
    "src/src/crc32c_prefetch.h",
    "src/src/crc32c_read_le.h",
    "src/src/crc32c_round_up.h",
  ]
}

if (!build_with_mozilla) {
test("crc32c_tests") {
  sources = [
    "src/src/crc32c_arm64_unittest.cc",
    "src/src/crc32c_extend_unittests.h",
    "src/src/crc32c_portable_unittest.cc",
    "src/src/crc32c_prefetch_unittest.cc",
    "src/src/crc32c_read_le_unittest.cc",
    "src/src/crc32c_round_up_unittest.cc",
    "src/src/crc32c_sse42_unittest.cc",
    "src/src/crc32c_unittest.cc",
  ]

  configs += [ ":crc32c_config" ]
  deps = [
    ":crc32c",
    ":crc32c_arm64",
    ":crc32c_internal_headers",
    ":crc32c_sse42",
    "//testing/gtest:gtest_main",
    "//third_party/googletest:gtest",
  ]
}

test("crc32c_benchmark") {
  sources = [ "src/src/crc32c_benchmark.cc" ]
  configs += [ ":crc32c_config" ]
  deps = [
    ":crc32c",
    ":crc32c_arm64",
    ":crc32c_internal_headers",
    ":crc32c_sse42",
    "//third_party/google_benchmark",
  ]
}
}

[ Dauer der Verarbeitung: 0.2 Sekunden  (vorverarbeitet)  ]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge