From c6c00b32dabd98962e26efbf6dce9f931076f31e Mon Sep 17 00:00:00 2001 From: phoglund Date: Wed, 4 May 2016 01:54:35 -0700 Subject: [PATCH] Revert of Remove the rtc_relative_path GYP variable and similar defines (patchset #1 id:1 of https://codereview.webrtc.org/1925733002/ ) Reason for revert: Breaks downstream gtest usage. Original issue's description: > Remove the rtc_relative_path GYP variable and similar defines > > This is a reland of https://codereview.webrtc.org/1903553003/ but with > the SRTP changes removed, since they're needed downstream. > > The defines that can be used to alter the include paths for Expat and gtest > are no longer needed in WebRTC or Chromium. Remove them to simplify GYP. > > Removed defines: > EXPAT_RELATIVE_PATH > GTEST_RELATIVE_PATH > > They're all set in the Chromium build so this shouldn't affect Chromium: > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/libjingle/libjingle.gyp > > BUG=webrtc:4256 > NOTRY=True > NOPRESUBMIT=True > TBR=perkj@webrtc.org > > Committed: https://crrev.com/081254f2c62037d016f9fc961764c6f01cb095da > Cr-Commit-Position: refs/heads/master@{#12536} TBR=perkj@webrtc.org,kjellander@webrtc.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=webrtc:4256 Review-Url: https://codereview.webrtc.org/1945803003 Cr-Commit-Position: refs/heads/master@{#12622} --- webrtc/base/base_tests.gyp | 8 ++++++++ webrtc/base/gunit.h | 4 ++++ webrtc/base/gunit_prod.h | 5 ++++- webrtc/build/common.gypi | 4 ++++ webrtc/libjingle/xmllite/xmlbuilder.h | 4 ++++ webrtc/libjingle/xmllite/xmlparser.h | 4 ++++ webrtc/libjingle/xmpp/xmppstanzaparser.cc | 4 ++++ webrtc/webrtc_tests.gypi | 3 +++ 8 files changed, 35 insertions(+), 1 deletion(-) diff --git a/webrtc/base/base_tests.gyp b/webrtc/base/base_tests.gyp index 8248cef9da..bc33028694 100644 --- a/webrtc/base/base_tests.gyp +++ b/webrtc/base/base_tests.gyp @@ -23,11 +23,19 @@ 'testechoserver.h', 'testutils.h', ], + 'defines': [ + 'GTEST_RELATIVE_PATH', + ], 'dependencies': [ 'base.gyp:rtc_base', '<(DEPTH)/testing/gtest.gyp:gtest', '<(webrtc_root)/test/test.gyp:field_trial', ], + 'direct_dependent_settings': { + 'defines': [ + 'GTEST_RELATIVE_PATH', + ], + }, 'export_dependent_settings': [ '<(DEPTH)/testing/gtest.gyp:gtest', ], diff --git a/webrtc/base/gunit.h b/webrtc/base/gunit.h index 986d4dcb62..1a6c36374e 100644 --- a/webrtc/base/gunit.h +++ b/webrtc/base/gunit.h @@ -13,7 +13,11 @@ #include "webrtc/base/logging.h" #include "webrtc/base/thread.h" +#if defined(GTEST_RELATIVE_PATH) #include "testing/gtest/include/gtest/gtest.h" +#else +#include "testing/base/public/gunit.h" +#endif // Wait until "ex" is true, or "timeout" expires. #define WAIT(ex, timeout) \ diff --git a/webrtc/base/gunit_prod.h b/webrtc/base/gunit_prod.h index 9850ed85d6..dc39bbd0eb 100644 --- a/webrtc/base/gunit_prod.h +++ b/webrtc/base/gunit_prod.h @@ -15,7 +15,10 @@ // Android doesn't use gtest at all, so anything that relies on gtest should // check this define first. #define NO_GTEST -#include "testing/gtest/include/gtest/gtest_prod.h" +#elif defined (GTEST_RELATIVE_PATH) +#include "gtest/gtest_prod.h" +#else +#include "testing/base/gunit_prod.h" #endif #endif // WEBRTC_BASE_GUNIT_PROD_H_ diff --git a/webrtc/build/common.gypi b/webrtc/build/common.gypi index 1409e0b1d3..5335cc8b16 100644 --- a/webrtc/build/common.gypi +++ b/webrtc/build/common.gypi @@ -64,6 +64,7 @@ 'webrtc_vp9_dir%': '<(webrtc_vp9_dir)', 'include_ilbc%': '<(include_ilbc)', 'include_opus%': '<(include_opus)', + 'rtc_relative_path%': 1, 'external_libraries%': '0', 'json_root%': '<(DEPTH)/third_party/jsoncpp/source/include/', # openssl needs to be defined or gyp will complain. Is is only used when @@ -237,6 +238,9 @@ ' #include "webrtc/libjingle/xmllite/xmlnsstack.h" +#ifdef EXPAT_RELATIVE_PATH #include "expat.h" +#else +#include "third_party/expat/v2_0_1/Source/lib/expat.h" +#endif // EXPAT_RELATIVE_PATH struct XML_ParserStruct; typedef struct XML_ParserStruct* XML_Parser; diff --git a/webrtc/libjingle/xmpp/xmppstanzaparser.cc b/webrtc/libjingle/xmpp/xmppstanzaparser.cc index 87398bcbba..035bb0b6f1 100644 --- a/webrtc/libjingle/xmpp/xmppstanzaparser.cc +++ b/webrtc/libjingle/xmpp/xmppstanzaparser.cc @@ -13,7 +13,11 @@ #include "webrtc/libjingle/xmllite/xmlelement.h" #include "webrtc/libjingle/xmpp/constants.h" #include "webrtc/base/common.h" +#ifdef EXPAT_RELATIVE_PATH #include "expat.h" +#else +#include "third_party/expat/v2_0_1/Source/lib/expat.h" +#endif namespace buzz { diff --git a/webrtc/webrtc_tests.gypi b/webrtc/webrtc_tests.gypi index b194121850..8c3512a7c8 100644 --- a/webrtc/webrtc_tests.gypi +++ b/webrtc/webrtc_tests.gypi @@ -269,6 +269,9 @@ 'base/socketaddress_unittest.cc', 'base/virtualsocket_unittest.cc', ], + 'defines': [ + 'GTEST_RELATIVE_PATH', + ], 'dependencies': [ '<(DEPTH)/testing/gtest.gyp:gtest', 'base/base.gyp:rtc_base',