summaryrefslogtreecommitdiffstats
path: root/chromium/sdch
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/sdch')
-rw-r--r--chromium/sdch/BUILD.gn78
-rw-r--r--chromium/sdch/README.chromium4
-rw-r--r--chromium/sdch/sdch.gyp20
-rw-r--r--chromium/sdch/win/config.h14
4 files changed, 111 insertions, 5 deletions
diff --git a/chromium/sdch/BUILD.gn b/chromium/sdch/BUILD.gn
new file mode 100644
index 00000000000..24af3a41da7
--- /dev/null
+++ b/chromium/sdch/BUILD.gn
@@ -0,0 +1,78 @@
+# 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("sdch_config") {
+ include_dirs = [ "open-vcdiff/src" ]
+}
+
+static_library("sdch") {
+ sources = [
+ "logging_forward.h",
+ "open-vcdiff/src/addrcache.cc",
+ "open-vcdiff/src/blockhash.cc",
+ "open-vcdiff/src/blockhash.h",
+ "open-vcdiff/src/checksum.h",
+ "open-vcdiff/src/codetable.cc",
+ "open-vcdiff/src/codetable.h",
+ "open-vcdiff/src/compile_assert.h",
+ "open-vcdiff/src/decodetable.cc",
+ "open-vcdiff/src/decodetable.h",
+ "open-vcdiff/src/encodetable.cc",
+ "open-vcdiff/src/encodetable.h",
+ "open-vcdiff/src/google/output_string.h",
+ "open-vcdiff/src/google/vcdecoder.h",
+ "open-vcdiff/src/headerparser.cc",
+ "open-vcdiff/src/headerparser.h",
+ "open-vcdiff/src/instruction_map.cc",
+ "open-vcdiff/src/instruction_map.h",
+ "open-vcdiff/src/rolling_hash.h",
+ "open-vcdiff/src/testing.h",
+ "open-vcdiff/src/varint_bigendian.cc",
+ "open-vcdiff/src/varint_bigendian.h",
+ "open-vcdiff/src/vcdecoder.cc",
+ "open-vcdiff/src/vcdiff_defs.h",
+ "open-vcdiff/src/vcdiffengine.cc",
+ "open-vcdiff/src/vcdiffengine.h",
+ "open-vcdiff/vsprojects/config.h",
+ "open-vcdiff/vsprojects/stdint.h",
+ ]
+
+ direct_dependent_configs = [ ":sdch_config" ]
+
+ deps = [
+ "//base",
+ "//third_party/zlib",
+ ]
+
+ if (is_linux || is_android) {
+ include_dirs = [ "linux" ]
+ } else if (is_ios) {
+ include_dirs = [ "ios" ]
+ } else if (is_mac) {
+ include_dirs = [ "mac" ]
+ } else if (is_win) {
+ include_dirs = [ "win" ]
+ }
+
+ # open-vcdiff's logging.h introduces static initializers. This was
+ # reported upstream years ago (
+ # https://code.google.com/p/open-vcdiff/issues/detail?id=33 ). Since
+ # upstream won't fix this, work around it on the chromium side:
+ # Inject a header that forwards to base/logging.h instead (which doesn't
+ # introduce static initializers, and which prevents open-vcdiff's
+ # logging.h from being used).
+ logging_file = rebase_path("logging_forward.h", root_build_dir)
+ if (is_win) {
+ cflags = [
+ "/FI", rebase_path("//build/intsafe_workaround.h", root_build_dir),
+ "/FI", logging_file,
+ ]
+ } else {
+ cflags = [ "-include", logging_file ]
+ if (is_linux) {
+ # TODO(mostynb): remove this if open-vcdiff is ever updated for c++11:
+ cflags += [ "-Wno-deprecated-declarations" ]
+ }
+ }
+}
diff --git a/chromium/sdch/README.chromium b/chromium/sdch/README.chromium
index 0275c7a6de3..93ae6a04b1a 100644
--- a/chromium/sdch/README.chromium
+++ b/chromium/sdch/README.chromium
@@ -13,3 +13,7 @@ The ios directory contains a config.h generated from a run of configure
CPPFLAGS=-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
CXX=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -x c++ -arch armv6
CXXFLAGS=-mno-thumb -miphoneos-version-min=4.2
+
+The win directory contains a config.h that forwards to one provided with
+open-vcdiff. We have this to avoid putting open-vcdiff's minimal stdint.h hack
+into our include path.
diff --git a/chromium/sdch/sdch.gyp b/chromium/sdch/sdch.gyp
index 8d609d5d4a2..ff2c077b256 100644
--- a/chromium/sdch/sdch.gyp
+++ b/chromium/sdch/sdch.gyp
@@ -57,9 +57,7 @@
[ 'os_bsd==1 or OS=="solaris"', { 'include_dirs': [ 'bsd' ] } ],
[ 'OS == "ios"', { 'include_dirs': [ 'ios' ] } ],
[ 'OS == "mac"', { 'include_dirs': [ 'mac' ] } ],
- [ 'OS == "win"', { 'include_dirs': [ 'open-vcdiff/vsprojects' ] } ],
- # TODO(mark): Remove usage of the deprecated auto_ptr.
- [ 'clang == 1', { 'cflags': [ '-Wno-deprecated-declarations' ] } ],
+ [ 'OS == "win"', { 'include_dirs': [ 'win' ] } ],
],
# open-vcdiff's logging.h introduces static initializers. This was
# reported upstream years ago (
@@ -85,10 +83,22 @@
# ForcedIncludeFiles is relative to include_dirs, cflags relative to the
# build directory.
'xcode_settings': { 'GCC_PREFIX_HEADER': '<(logging_path)' },
+ 'msvs_system_include_dirs': [
+ '<(DEPTH)/build',
+ ],
'msvs_settings': {
- 'VCCLCompilerTool': { 'ForcedIncludeFiles': [ 'sdch/<(logging_path)' ] }
+ 'VCCLCompilerTool': {
+ 'ForcedIncludeFiles': [
+ 'intsafe_workaround.h', # http://crbug.com/308740
+ 'sdch/<(logging_path)',
+ ]
+ }
},
- 'cflags': [ '-include', '<(logging_dir)/sdch/<(logging_path)' ],
+ 'cflags': [
+ '-include', '<(logging_dir)/sdch/<(logging_path)',
+ # TODO(mostynb): remove this if open-vcdiff is ever updated for c++11:
+ '-Wno-deprecated-declarations',
+ ],
},
],
}
diff --git a/chromium/sdch/win/config.h b/chromium/sdch/win/config.h
new file mode 100644
index 00000000000..b5fb37c8d0e
--- /dev/null
+++ b/chromium/sdch/win/config.h
@@ -0,0 +1,14 @@
+// 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.
+
+// This file and directory exist so that we can use the provided config.h
+// without putting vsprojects into our include path (which would also give us an
+// incorrect/incompatible stdint.h).
+
+#ifndef SDCH_WIN_CONFIG_H_
+#define SDCH_WIN_CONFIG_H_
+
+#include "../open-vcdiff/vsprojects/config.h"
+
+#endif // SDCH_WIN_CONFIG_H_