Index: sdch/sdch.gyp |
diff --git a/sdch/sdch.gyp b/sdch/sdch.gyp |
index d84be582ed7f9dba0b326e61b428ecd4ed3e0b8b..7601e99c338fe678077669d47e3237a94eaeaee9 100644 |
--- a/sdch/sdch.gyp |
+++ b/sdch/sdch.gyp |
@@ -14,6 +14,7 @@ |
'../third_party/zlib/zlib.gyp:zlib', |
], |
'sources': [ |
+ 'logging_forward.h', |
'open-vcdiff/src/addrcache.cc', |
'open-vcdiff/src/blockhash.cc', |
'open-vcdiff/src/blockhash.h', |
@@ -31,8 +32,6 @@ |
'open-vcdiff/src/headerparser.h', |
'open-vcdiff/src/instruction_map.cc', |
'open-vcdiff/src/instruction_map.h', |
- 'open-vcdiff/src/logging.cc', |
- 'open-vcdiff/src/logging.h', |
wtc
2013/11/12 02:17:39
Please confirm that you don't want to remove these
wtc
2013/11/12 02:19:30
Please ignore this question. I found the answer in
|
'open-vcdiff/src/rolling_hash.h', |
'open-vcdiff/src/testing.h', |
'open-vcdiff/src/varint_bigendian.cc', |
@@ -46,6 +45,7 @@ |
], |
'include_dirs': [ |
'open-vcdiff/src', |
+ '..', |
wtc
2013/11/12 02:17:39
Is this pointing to the src/sdch directory? Why is
Nico
2013/11/12 03:34:10
It's pointing to src/, so that the include of "bas
wtc
2013/11/12 18:14:03
Thank you. This was not obvious to me, so it might
Nico
2013/11/12 18:34:42
Makes sense, done.
|
], |
'direct_dependent_settings': { |
'include_dirs': [ |
@@ -59,6 +59,37 @@ |
[ 'OS == "mac"', { 'include_dirs': [ 'mac' ] } ], |
[ 'OS == "win"', { 'include_dirs': [ 'open-vcdiff/vsprojects' ] } ], |
], |
+ # 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: Define |
+ # the header guard so that open-vcdiff's logging.h doesn't get used, and |
+ # inject a header that forwards to base/logging.h instead (which doesn't |
+ # introduce static initializers). |
+ 'defines': [ |
+ 'OPEN_VCDIFF_LOGGING_H_', |
wtc
2013/11/12 02:17:39
Why don't we define this macro in logging_forward.
Nico
2013/11/12 03:34:10
That works too. I put it here so that it's next to
|
+ ], |
+ 'variables': { |
+ 'logging_path': 'logging_forward.h', |
+ 'conditions': [ |
+ # gyp leaves unspecified what the cwd is when running the compiler, |
+ # and gyp/linux doesn't have a built-in way for forcing an include. |
+ # So hardcode the base directory. If this spreads, provide native |
+ # support in gyp, like we have for gyp/mac and gyp/windows. |
+ # path. |
+ ['"<(GENERATOR)"=="ninja"', { 'logging_dir': '../..' }, |
+ { 'logging_dir': '.' } |
+ ], |
+ ], |
+ }, |
+ # GCC_PREFIX_HEADER is relative to the current directory, |
+ # ForcedIncludeFiles is relative to include_dirs, cflags relative to the |
+ # build directory. |
+ 'xcode_settings': { 'GCC_PREFIX_HEADER': '<(logging_path)' }, |
+ 'msvs_settings': { |
+ 'VCCLCompilerTool': { 'ForcedIncludeFiles': [ 'sdch/<(logging_path)' ] } |
+ }, |
+ 'cflags': [ '-include', '<(logging_dir)/sdch/<(logging_path)' ], |
}, |
], |
} |