diff --git a/third_party/zlib/zlib.gyp b/third_party/zlib/zlib.gyp index b6a6bc91..df26cc23 100644 --- a/third_party/zlib/zlib.gyp +++ b/third_party/zlib/zlib.gyp @@ -13,18 +13,28 @@ # limitations under the License. { - 'variables': { - 'conditions': [ - # Use the system zlib by default where available, as it is on most - # platforms. Windows does not have a system zlib, so use “embedded” which - # directs the build to use the source code in the zlib subdirectory. - ['OS!="win"', { - 'zlib_source%': 'system', - }, { - 'zlib_source%': 'embedded', - }], - ], - }, + 'includes': [ + '../../build/crashpad_dependencies.gypi', + ], + 'conditions': [ + ['1==1', { # Defer processing until crashpad_dependencies is set + 'variables': { + 'conditions': [ + ['crashpad_dependencies=="external"', { + 'zlib_source%': 'external', + }, 'OS!="win"', { + # Use the system zlib by default where available, as it is on most + # platforms. Windows does not have a system zlib, so use “embedded” + # which directs the build to use the source code in the zlib + # subdirectory. + 'zlib_source%': 'system', + }, { + 'zlib_source%': 'embedded', + }], + ], + }, + }], + ], 'targets': [ { 'target_name': 'zlib', @@ -141,6 +151,17 @@ }], ], }], + ['zlib_source=="external"', { + 'type': 'none', + 'direct_dependent_settings': { + 'defines': [ + 'CRASHPAD_ZLIB_SOURCE_EXTERNAL', + ], + }, + 'dependencies': [ + '../../../../zlib/zlib.gyp:zlib', + ], + }], ], }, ], diff --git a/third_party/zlib/zlib_crashpad.h b/third_party/zlib/zlib_crashpad.h index d3a23861..fd497a85 100644 --- a/third_party/zlib/zlib_crashpad.h +++ b/third_party/zlib/zlib_crashpad.h @@ -19,9 +19,8 @@ // available at any other location in the source tree. It will #include the // proper depending on how the build has been configured. -#if defined(CRASHPAD_ZLIB_SOURCE_EXTERNAL) -#include "third_party/zlib/zlib.h" -#elif defined(CRASHPAD_ZLIB_SOURCE_SYSTEM) +#if defined(CRASHPAD_ZLIB_SOURCE_SYSTEM) || \ + defined(CRASHPAD_ZLIB_SOURCE_EXTERNAL) #include #elif defined(CRASHPAD_ZLIB_SOURCE_EMBEDDED) #include "third_party/zlib/zlib/zlib.h"