Skip to content

Commit 2ecabd2

Browse files
committed
Switch folly to using a submodule instead of a fork.
To sync the folly submodule the first time, you'll need to issue: git submodule init git submodule update From then on, you'll also want to make sure folly is up to date by issuing `git submodule update` after a `git pull`.
1 parent 3fd7ec1 commit 2ecabd2

File tree

173 files changed

+57
-52035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+57
-52035
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "hphp/submodules/folly"]
2+
path = hphp/submodules/folly
3+
url = git://github.com/facebook/folly.git

CMake/FollySetup.cmake

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# folly-config.h is a generated file from autotools
2+
# We need to do the equivalent checks here and use
3+
# add_definitions as needed
4+
add_definitions(-DFOLLY_NO_CONFIG=1)
5+
6+
INCLUDE(CheckCXXSourceCompiles)
7+
CHECK_CXX_SOURCE_COMPILES("
8+
extern \"C\" void (*test_ifunc(void))() { return 0; }
9+
void func() __attribute__((ifunc(\"test_ifunc\")));
10+
" FOLLY_IFUNC)
11+
if (FOLLY_IFUNC)
12+
add_definitions("-DHAVE_IFUNC=1")
13+
endif()
14+
15+
set(CMAKE_REQUIRED_LIBRARIES rt)
16+
CHECK_CXX_SOURCE_COMPILES("#include <time.h>
17+
int main() {
18+
clock_gettime((clockid_t)0, NULL);
19+
return 0;
20+
}" HAVE_CLOCK_GETTIME)
21+
22+
if (HAVE_CLOCK_GETTIME)
23+
add_definitions("-DFOLLY_HAVE_CLOCK_GETTIME=1")
24+
endif()
25+
set(CMAKE_REQUIRED_LIBRARIES)
26+
27+
find_path(FEATURES_H_INCLUDE_DIR NAMES features.h)
28+
if (FEATURES_H_INCLUDE_DIR)
29+
include_directories("${FEATURES_H_INCLUDE_DIR}")
30+
add_definitions("-DFOLLY_HAVE_FEATURES_H=1")
31+
endif()

hphp/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717

1818
include(HPHPSetup)
19+
include(FollySetup)
1920

2021
# HHVM Build
2122
SET(USE_HHVM TRUE)

hphp/submodules/folly

Submodule folly added at 78d1c04

hphp/third_party/folly/CMakeLists.txt

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# folly-config.h is a generated file from autotools
2-
# We need to do the equivalent checks here and use
3-
# add_definitions as needed
4-
add_definitions(-DFOLLY_NO_CONFIG=1)
5-
61
set(FOLLY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/folly")
72

3+
if (NOT EXISTS "${FOLLY_DIR}/Portability.h")
4+
message(FATAL_ERROR "${FOLLY_DIR}/Portability.h missing, did you forget to run `git submodule init && git submodule update`?")
5+
endif()
6+
87
# Generated files from folly/build/generate_*.py
98
auto_sources(genfiles "*.cpp" "RECURSE" "${CMAKE_CURRENT_SOURCE_DIR}/gen")
109

@@ -20,11 +19,15 @@ foreach (file ${files})
2019
endforeach()
2120
list(REMOVE_ITEM files
2221
${FOLLY_DIR}/Benchmark.cpp
22+
${FOLLY_DIR}/build/GenerateFingerprintTables.cpp
23+
${FOLLY_DIR}/detail/Clock.cpp
2324
${FOLLY_DIR}/experimental/File.cpp
2425
${FOLLY_DIR}/experimental/exception_tracer/ExceptionTracer.cpp
26+
${FOLLY_DIR}/experimental/exception_tracer/ExceptionTracerBenchmark.cpp
2527
${FOLLY_DIR}/experimental/exception_tracer/ExceptionTracerLib.cpp
2628
${FOLLY_DIR}/experimental/exception_tracer/ExceptionTracerTest.cpp
2729
${FOLLY_DIR}/experimental/io/AsyncIO.cpp
30+
${FOLLY_DIR}/experimental/io/HugePageUtil.cpp
2831
${FOLLY_DIR}/experimental/symbolizer/SymbolizerTest.cpp
2932
${FOLLY_DIR}/experimental/symbolizer/ElfUtil.cpp
3033
)
@@ -40,6 +43,11 @@ endif()
4043
# and some other folly pieces we're not including yet
4144
# For now, that's not actually a requirement, so skip it
4245
list(REMOVE_ITEM files ${FOLLY_DIR}/Subprocess.cpp)
46+
47+
# io/Compression requires snappy library
48+
# Don't add dep until we need it
49+
list(REMOVE_ITEM files ${FOLLY_DIR}/io/Compression.cpp)
50+
4351
add_library(folly STATIC ${files} ${genfiles} ${cfiles} )
4452

4553
find_package(Boost 1.48.0 COMPONENTS system program_options filesystem regex REQUIRED)
@@ -52,15 +60,6 @@ include_directories(${LIBGLOG_INCLUDE_DIR})
5260
find_package(PThread REQUIRED)
5361
include_directories(${LIBPTHREAD_INCLUDE_DIRS})
5462

55-
INCLUDE(CheckCXXSourceCompiles)
56-
CHECK_CXX_SOURCE_COMPILES("
57-
extern \"C\" void (*test_ifunc(void))() { return 0; }
58-
void func() __attribute__((ifunc(\"test_ifunc\")));
59-
" FOLLY_IFUNC)
60-
if (FOLLY_IFUNC)
61-
add_definitions("-DHAVE_IFUNC=1")
62-
endif()
63-
6463
target_link_libraries(folly ${Boost_LIBRARIES}
6564
${LIBGLOG_LIBRARY}
6665
${LIBPTHREAD_LIBRARIES})

hphp/third_party/folly/folly

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../submodules/folly/folly

hphp/third_party/folly/folly/ApplyTuple.h

-111
This file was deleted.

hphp/third_party/folly/folly/Arena-inl.h

-94
This file was deleted.

0 commit comments

Comments
 (0)