OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 config("sdch_config") { | 5 config("sdch_config") { |
6 include_dirs = [ "open-vcdiff/src" ] | 6 include_dirs = [ "open-vcdiff/src" ] |
7 } | 7 } |
8 | 8 |
9 static_library("sdch") { | 9 static_library("sdch") { |
10 sources = [ | 10 sources = [ |
(...skipping 27 matching lines...) Expand all Loading... |
38 "open-vcdiff/vsprojects/stdint.h", | 38 "open-vcdiff/vsprojects/stdint.h", |
39 ] | 39 ] |
40 | 40 |
41 public_configs = [ ":sdch_config" ] | 41 public_configs = [ ":sdch_config" ] |
42 | 42 |
43 deps = [ | 43 deps = [ |
44 "//base", | 44 "//base", |
45 "//third_party/zlib", | 45 "//third_party/zlib", |
46 ] | 46 ] |
47 | 47 |
| 48 # gn orders flags on a target before flags from configs. The default config |
| 49 # adds -Wall, and these flags have to be after -Wall -- so they need to come |
| 50 # from a config and can't be on the target directly. |
| 51 config("sdch_warnings") { |
| 52 cflags = [] |
| 53 if (is_linux) { |
| 54 # TODO(mostynb): remove this if open-vcdiff is ever updated for c++11: |
| 55 cflags += [ "-Wno-deprecated-declarations" ] |
| 56 } |
| 57 |
| 58 if (is_clang) { |
| 59 # sdch uses the pre-c++11 typedef-as-static_assert hack. |
| 60 # https://code.google.com/p/open-vcdiff/issues/detail?id=44 |
| 61 cflags += [ "-Wno-unused-local-typedef" ] |
| 62 } |
| 63 } |
| 64 configs += [ ":sdch_warnings" ] |
| 65 |
48 if (is_linux || is_android) { | 66 if (is_linux || is_android) { |
49 include_dirs = [ "linux" ] | 67 include_dirs = [ "linux" ] |
50 } else if (is_ios) { | 68 } else if (is_ios) { |
51 include_dirs = [ "ios" ] | 69 include_dirs = [ "ios" ] |
52 } else if (is_mac) { | 70 } else if (is_mac) { |
53 include_dirs = [ "mac" ] | 71 include_dirs = [ "mac" ] |
54 } else if (is_win) { | 72 } else if (is_win) { |
55 include_dirs = [ "win" ] | 73 include_dirs = [ "win" ] |
56 } | 74 } |
57 | 75 |
58 # open-vcdiff's logging.h introduces static initializers. This was | 76 # open-vcdiff's logging.h introduces static initializers. This was |
59 # reported upstream years ago ( | 77 # reported upstream years ago ( |
60 # https://code.google.com/p/open-vcdiff/issues/detail?id=33 ). Since | 78 # https://code.google.com/p/open-vcdiff/issues/detail?id=33 ). Since |
61 # upstream won't fix this, work around it on the chromium side: | 79 # upstream won't fix this, work around it on the chromium side: |
62 # Inject a header that forwards to base/logging.h instead (which doesn't | 80 # Inject a header that forwards to base/logging.h instead (which doesn't |
63 # introduce static initializers, and which prevents open-vcdiff's | 81 # introduce static initializers, and which prevents open-vcdiff's |
64 # logging.h from being used). | 82 # logging.h from being used). |
65 if (is_win) { | 83 if (is_win) { |
66 cflags = [ | 84 cflags = [ |
67 "/FI", "sdch/logging_forward.h", | 85 "/FI", "sdch/logging_forward.h", |
68 ] | 86 ] |
69 } else { | 87 } else { |
70 logging_file = rebase_path("logging_forward.h", root_build_dir) | 88 logging_file = rebase_path("logging_forward.h", root_build_dir) |
71 cflags = [ "-include", logging_file ] | 89 cflags = [ "-include", logging_file ] |
72 if (is_linux) { | |
73 # TODO(mostynb): remove this if open-vcdiff is ever updated for c++11: | |
74 cflags += [ "-Wno-deprecated-declarations" ] | |
75 } | |
76 } | 90 } |
77 } | 91 } |
OLD | NEW |