-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: support build glog/gflags from source (#3778)
* build(deps): include glog as submodule - link glog staticlly or dynamicly. - deps issue for libunwind, no lzma dependency. - glog dependency to libunwind * build(shared): gflags/glog directly from source
- Loading branch information
1 parent
f6a1fd3
commit 56ff310
Showing
13 changed files
with
93 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
[submodule "cmake-modules"] | ||
path = cmake-modules | ||
url = https://github.com/bilke/cmake-modules.git | ||
[submodule "glog"] | ||
path = contrib/glog | ||
url = https://github.com/google/glog | ||
[submodule "gflags"] | ||
path = contrib/gflags | ||
url = https://github.com/gflags/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
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(WITH_GTEST OFF) | ||
set(WITH_GFLAGS ON) | ||
set(WITH_UNWIND ON) | ||
|
||
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