-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(shared): gflags/glog directly from source
- Loading branch information
1 parent
bdba1b5
commit e4572f6
Showing
14 changed files
with
86 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule gflags
updated
22 files
+4 −0 | .gitmodules | |
+3 −11 | BUILD | |
+8 −11 | CMakeLists.txt | |
+24 −38 | INSTALL.md | |
+1 −1 | README.md | |
+0 −5 | bazel/expanded_template/BUILD | |
+0 −63 | bazel/expanded_template/expand_template.cc | |
+0 −35 | bazel/expanded_template/expanded_template.bzl | |
+36 −41 | bazel/gflags.bzl | |
+3 −3 | cmake/config.cmake.in | |
+2 −2 | cmake/package.pc.in | |
+6 −8 | cmake/utils.cmake | |
+1 −0 | doc | |
+0 −0 | doc/.nojekyll | |
+0 −4 | doc/README.md | |
+0 −115 | doc/designstyle.css | |
+0 −638 | doc/index.html | |
+6 −6 | src/gflags.cc | |
+1 −1 | src/gflags.h.in | |
+13 −7 | src/gflags_completions.cc | |
+7 −7 | src/gflags_reporting.cc | |
+1 −1 | test/gflags_build.py.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# parent project use gflags::gflags alias, so build either shared or static | ||
if (BUILD_SHARED_LIBS) | ||
set(GFLAGS_BUILD_SHARED_LIBS ON) | ||
set(GFLAGS_BUILD_STATIC_LIBS OFF) | ||
else() | ||
set(GFLAGS_BUILD_SHARED_LIBS OFF) | ||
set(GFLAGS_BUILD_STATIC_LIBS ON) | ||
endif() | ||
|
||
set(GFLAGS_NAMESPACE google) | ||
|
||
add_subdirectory(${CMAKE_SOURCE_DIR}/contrib/gflags ${CMAKE_BINARY_DIR}/contrib/gflags) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
set(WITH_GTEST OFF) | ||
set(WITH_GFLAGS ON) | ||
set(WITH_UNWIND ON) | ||
|
||
if (BUILD_SHARED_LIBS) | ||
# visibility issue building shared glog against static gflags | ||
# so explicitly skip the gflags dependency | ||
set(WITH_GFLAGS OFF) | ||
set(WITH_UNWIND OFF) | ||
endif() | ||
execute_process( | ||
COMMAND patch -p 1 -N -i ${CMAKE_SOURCE_DIR}/contrib/glog-cmake/find-gflags.patch | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/contrib/glog | ||
) | ||
|
||
add_subdirectory(${CMAKE_SOURCE_DIR}/contrib/glog ${CMAKE_BINARY_DIR}/contrib/glog) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 846b444..50c0c07 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -79,12 +79,16 @@ if (WITH_GMOCK AND TARGET GTest::gmock) | ||
endif (WITH_GMOCK AND TARGET GTest::gmock) | ||
|
||
if (WITH_GFLAGS) | ||
- find_package (gflags 2.2.2) | ||
- | ||
- if (gflags_FOUND) | ||
- set (HAVE_LIB_GFLAGS 1) | ||
- determine_gflags_namespace (gflags_NAMESPACE) | ||
- endif (gflags_FOUND) | ||
+ if (NOT TARGET gflags::gflags) | ||
+ find_package (gflags 2.2.2) | ||
+ | ||
+ if (gflags_FOUND) | ||
+ set (HAVE_LIB_GFLAGS 1) | ||
+ determine_gflags_namespace (gflags_NAMESPACE) | ||
+ endif (gflags_FOUND) | ||
+ else() | ||
+ set(gflags_NAMESPACE google) | ||
+ endif() | ||
endif (WITH_GFLAGS) | ||
|
||
find_package (Threads) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters