blob: 04db5df64af11b9c6bf8c021761c130274ce7512 [file] [log] [blame]
msarett0e5b2492016-05-26 11:05:37 -07001# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5config("qcms_config") {
6 include_dirs = [ "src" ]
7}
8
9# Do not build QCMS on Android or iOS. (See http://crbug.com/577155)
10disable_qcms = is_android || is_ios
11
12source_set("qcms") {
13 if (disable_qcms) {
14 sources = [
15 "src/empty.c",
16 ]
17 } else {
18 sources = [
19 "src/chain.c",
20 "src/chain.h",
21 "src/iccread.c",
22 "src/matrix.c",
23 "src/matrix.h",
24 "src/qcms.h",
25 "src/qcms_util.c",
26 "src/qcmsint.h",
27 "src/qcmstypes.h",
28 "src/transform.c",
29 "src/transform_util.c",
30 "src/transform_util.h",
31 ]
32
33 if (current_cpu == "x86" || current_cpu == "x64") {
34 defines = [ "SSE2_ENABLE" ]
35 sources += [ "src/transform-sse2.c" ]
36 }
37 }
38
39 configs -= [ "//build/config/compiler:chromium_code" ]
40 configs += [ "//build/config/compiler:no_chromium_code" ]
41 public_configs = [ ":qcms_config" ]
42
43 if (is_win) {
44 cflags = [
45 "/wd4018", # Signed/unsigned mismatch in comparison.
46 "/wd4056", # Overflow in floating-point constant arithmetic (INFINITY).
47 "/wd4756", # Overflow in constant arithmetic (INFINITY).
48 ]
49 }
50}
51
52if (!disable_qcms) {
53 executable("qcms_tests") {
54 if (current_cpu == "x86" || current_cpu == "x64") {
55 defines = [ "SSE2_ENABLE" ]
56 }
57 sources = [
58 "src/tests/qcms_test_internal_srgb.c",
59 "src/tests/qcms_test_main.c",
60 "src/tests/qcms_test_munsell.c",
61 "src/tests/qcms_test_ntsc_gamut.c",
62 "src/tests/qcms_test_output_trc.c",
63 "src/tests/qcms_test_tetra_clut_rgba.c",
64 "src/tests/qcms_test_util.c",
65 ]
66
67 deps = [
68 "//build/config/sanitizers:deps",
69 "//build/win:default_exe_manifest",
70 "//third_party/qcms",
71 ]
72
73 configs -= [ "//build/config/compiler:chromium_code" ]
74 configs += [ "//build/config/compiler:no_chromium_code" ]
75 public_configs = [ ":qcms_config" ]
76 }
77}