summaryrefslogtreecommitdiffstats
path: root/third_party/qcms/BUILD.gn
blob: b0593192f536e5f87533c5c6468417103dc22199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

config("qcms_config") {
  include_dirs = [ "src" ]
}

source_set("qcms") {
  sources = [
    "src/chain.c",
    "src/chain.h",
    "src/iccread.c",
    "src/matrix.c",
    "src/matrix.h",
    "src/qcms.h",
    "src/qcmsint.h",
    "src/qcmstypes.h",
    "src/transform.c",
    "src/transform_util.c",
    "src/transform_util.h",
  ]

  configs -= [ "//build/config/compiler:chromium_code" ]
  configs += [ "//build/config/compiler:no_chromium_code" ]
  public_configs = [ ":qcms_config" ]

  if (cpu_arch == "x86" || cpu_arch == "x64") {
    defines = [ "SSE2_ENABLE" ]
    sources += [ "src/transform-sse2.c" ]
    if (!(is_win && cpu_arch == "x64")) {
      # QCMS assumes this target isn't compiled since MSVC x64 doesn't support
      # the MMX intrinsics present in the SSE1 code.
      sources += [ "src/transform-sse1.c" ]
    }
  }

  if (is_win) {
    cflags = [
      "/wd4056",  # Overflow in floating-point constant arithmetic (INFINITY).
      "/wd4756",  # Overflow in constant arithmetic (INFINITY).
    ]
  }
}