Skip to content

Instantly share code, notes, and snippets.

@adsr
Created January 6, 2015 18:17
Show Gist options
  • Save adsr/f86f417a9fa1c8b810dc to your computer and use it in GitHub Desktop.
Save adsr/f86f417a9fa1c8b810dc to your computer and use it in GitHub Desktop.
diff --git hphp/CMakeLists.txt hphp/CMakeLists.txt
index ffe1e87..4fa93fe 100644
--- hphp/CMakeLists.txt
+++ hphp/CMakeLists.txt
@@ -62,10 +62,14 @@ if (ENABLE_COTIRE)
endif()
add_definitions("-DHHVM")
add_definitions("-DUSE_CMAKE")
+if (NO_THRIFT)
+ add_definitions("-DNO_THRIFT=1")
+endif ()
+
add_subdirectory(tools/bootstrap)
add_subdirectory(compiler)
add_subdirectory(hack)
add_subdirectory(hhbbc)
diff --git hphp/runtime/ext/thrift/binary.cpp hphp/runtime/ext/thrift/binary.cpp
index 07a80ad..0b011d3 100644
--- hphp/runtime/ext/thrift/binary.cpp
+++ hphp/runtime/ext/thrift/binary.cpp
@@ -13,10 +13,12 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
+#ifndef NO_THRIFT
+
#include "hphp/runtime/ext/thrift/transport.h"
#include "hphp/runtime/ext/thrift/ext_thrift.h"
#include "hphp/runtime/ext/std/ext_std_classobj.h"
#include "hphp/runtime/ext/ext_collections.h"
#include "hphp/runtime/ext/reflection/ext_reflection.h"
@@ -630,5 +632,7 @@ Variant HHVM_FUNCTION(thrift_protocol_read_binary_struct,
return ret_val;
}
///////////////////////////////////////////////////////////////////////////////
}
+
+#endif // NO_THRIFT
diff --git hphp/runtime/ext/thrift/compact.cpp hphp/runtime/ext/thrift/compact.cpp
index bce0b3a..bceb387 100644
--- hphp/runtime/ext/thrift/compact.cpp
+++ hphp/runtime/ext/thrift/compact.cpp
@@ -13,10 +13,12 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
+#ifndef NO_THRIFT
+
#include "hphp/runtime/base/request-local.h"
#include "hphp/runtime/ext/thrift/transport.h"
#include "hphp/runtime/ext/ext_collections.h"
#include "hphp/runtime/ext/reflection/ext_reflection.h"
#include "hphp/runtime/ext/thrift/ext_thrift.h"
@@ -1061,5 +1063,7 @@ Variant HHVM_FUNCTION(thrift_protocol_read_compact_struct,
reader.readStruct(ret, spec.toArray());
return ret;
}
}
+
+#endif // NO_THRIFT
diff --git hphp/runtime/ext/thrift/ext_thrift.cpp hphp/runtime/ext/thrift/ext_thrift.cpp
index 76c0d9d..d76dc33 100644
--- hphp/runtime/ext/thrift/ext_thrift.cpp
+++ hphp/runtime/ext/thrift/ext_thrift.cpp
@@ -13,10 +13,12 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
+#ifndef NO_THRIFT
+
#include "hphp/runtime/ext/thrift/ext_thrift.h"
namespace HPHP {
static class ThriftExtension : public Extension {
@@ -34,5 +36,7 @@ public:
loadSystemlib("thrift");
}
} s_thrift_extension;
}
+
+#endif // NO_THRIFT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment