Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
Remove glog source code from third party
Browse files Browse the repository at this point in the history
- glog source code is now downloaded through the download script.
- Added patches for glog.
  • Loading branch information
hbdeshmukh committed Dec 17, 2017
1 parent 8a84039 commit c43107d
Show file tree
Hide file tree
Showing 77 changed files with 45 additions and 20,990 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ if(USE_TCMALLOC)
if (COMPILER_HAS_WNO_RETURN_TYPE_C_LINKAGE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage")
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party)
endif()

# Add Protocol Buffers.
Expand Down Expand Up @@ -649,7 +650,7 @@ if (WIN32)
include_directories(${THIRD_PARTY_SOURCE_DIR}/glog/src/windows)
else()
include_directories(${THIRD_PARTY_SOURCE_DIR}/glog/src)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/glog)
endif()

include_directories("${THIRD_PARTY_SOURCE_DIR}/re2")
Expand Down
8 changes: 8 additions & 0 deletions third_party/download_and_patch_prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ third_party_dir_names=("benchmark"
"linenoise"
"re2"
"gperftools"
"glog"
)

third_party_lib_urls=("https://github.com/google/benchmark/archive/v1.1.0.tar.gz"
Expand All @@ -57,6 +58,7 @@ third_party_lib_urls=("https://github.com/google/benchmark/archive/v1.1.0.tar.gz
"https://github.com/antirez/linenoise/archive/1.0.tar.gz"
"https://github.com/google/re2/archive/2017-01-01.tar.gz"
"https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz"
"https://github.com/google/glog/archive/v0.3.5.tar.gz"
)

downloaded_archive_names=("v1.1.0.tar.gz"
Expand All @@ -65,6 +67,7 @@ downloaded_archive_names=("v1.1.0.tar.gz"
"1.0.tar.gz"
"2017-01-01.tar.gz"
"gperftools-2.5.tar.gz"
"v0.3.5.tar.gz"
)

tar_options=("-xzf"
Expand All @@ -73,6 +76,7 @@ tar_options=("-xzf"
"-xzf"
"-xzf"
"-xzf"
"-xzf"
)

for ((lib_index=0; lib_index < ${#third_party_dir_names[*]}; lib_index++))
Expand Down Expand Up @@ -125,3 +129,7 @@ patch ${THIRD_PARTY_SRC_DIR}/re2/CMakeLists.txt ${PATCH_DIR}/re2/re2CMake.patch
# Apply benchmark patches.
patch ${THIRD_PARTY_SRC_DIR}/benchmark/CMakeLists.txt ${PATCH_DIR}/benchmark/benchmarkCMake.patch
patch ${THIRD_PARTY_SRC_DIR}/benchmark/src/CMakeLists.txt ${PATCH_DIR}/benchmark/benchmarkSrcCMakeLists.patch

# Apply glog patches.
patch ${THIRD_PARTY_SRC_DIR}/glog/CMakeLists.txt ${PATCH_DIR}/glog/glogCMakeLists.txt.patch
patch ${THIRD_PARTY_SRC_DIR}/glog/src/utilities.cc ${PATCH_DIR}/glog/utilities.cc.patch
23 changes: 23 additions & 0 deletions third_party/patches/glog/glogCMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--- CMakeLists.txt 2017-12-15 14:10:23.000000002 -0600
+++ CMakeLists-new.txt 2017-12-15 14:07:52.000000002 -0600
@@ -26,7 +26,7 @@
set (CPACK_PACKAGE_VERSION_PATCH ${GLOG_PATCH_VERSION})
set (CPACK_PACKAGE_VERSION ${GLOG_VERSION})

-option (WITH_GFLAGS "Use gflags" ON)
+option (WITH_GFLAGS "Use gflags" OFF)
option (WITH_THREADS "Enable multithreading support" ON)

list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@@ -377,6 +377,11 @@

add_compile_options ($<$<BOOL:${HAVE_NO_UNNAMED_TYPE_TEMPLATE_ARGS}>:-Wno-unnamed-type-template-args>)

+CHECK_CXX_COMPILER_FLAG("-Wno-sign-compare" COMPILER_HAS_WNO_SIGN_ERROR)
+if (COMPILER_HAS_WNO_SIGN_ERROR)
+ add_compile_options(-Wno-sign-compare)
+endif()
+
add_library (glog
${GLOG_SRCS}
)
11 changes: 11 additions & 0 deletions third_party/patches/glog/utilities.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- utilities.cc 2017-12-15 14:10:40.000000002 -0600
+++ utilities.cc.new 2017-12-15 14:08:13.000000002 -0600
@@ -300,7 +300,7 @@
g_my_user_name = "invalid-user";
}
}
-REGISTER_MODULE_INITIALIZER(utilities, MyUserNameInitializer());
+REGISTER_MODULE_INITIALIZER(utilities, MyUserNameInitializer())

#ifdef HAVE_STACKTRACE
void DumpStackTraceToString(string* stacktrace) {
1 change: 1 addition & 0 deletions third_party/reset_third_party_dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ third_party_dir_names=("benchmark"
"linenoise"
"re2"
"gperftools"
"glog"
)

for ((lib_index=0; lib_index < ${#third_party_dir_names[*]}; lib_index++))
Expand Down
2 changes: 0 additions & 2 deletions third_party/src/glog/AUTHORS

This file was deleted.

208 changes: 0 additions & 208 deletions third_party/src/glog/CMakeLists.txt

This file was deleted.

65 changes: 0 additions & 65 deletions third_party/src/glog/COPYING

This file was deleted.

0 comments on commit c43107d

Please sign in to comment.