aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake/external/leveldb.cmake
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-01-13 15:21:01 -0800
committerGravatar GitHub <noreply@github.com>2018-01-13 15:21:01 -0800
commitb15283bd27d6ac5eb784efc52ab13bc40b35a625 (patch)
tree6ab34707ec559c45cddff1583f0c44efff49d1ab /cmake/external/leveldb.cmake
parentb5454f1a913d246da9e56b4d8e1dd9873d6d65ce (diff)
Build gRPC for Firestore C++ (#652)
* Clean up quoting and other minor issues * Reorganize CMake build output Make it clearer which parts of the output pertain to external projects. * Use a consistent ordering of ExternalProject arguments * Prevent the top-level build from running in parallel This prevents spurious failures when running make -j. * Actually parse arguments in the xcodebuild function * Use ExternalProject features when available * submodule limits from CMake 3.0 * shallow clones from CMake 3.6 * git progress output from CMake 3.8 * Only build the parts of leveldb we need Skip building the tools and other libraries * Avoid installing ExternalProjects Consume build output directly so that we can build just the targets we need. Installing causes all targets to be built. This doesn't matter as much for these targets but the gRPC build includes a ton of stuff we don't need so it's worth adopting this as a general strategy. * Define an external build for grpc * Test that grpc can link successfully. * Add a FindGRPC CMake module * Actually comment ExternalProjext_GitSource
Diffstat (limited to 'cmake/external/leveldb.cmake')
-rw-r--r--cmake/external/leveldb.cmake26
1 files changed, 21 insertions, 5 deletions
diff --git a/cmake/external/leveldb.cmake b/cmake/external/leveldb.cmake
index b3b3fe1..5b2068a 100644
--- a/cmake/external/leveldb.cmake
+++ b/cmake/external/leveldb.cmake
@@ -13,6 +13,7 @@
# limitations under the License.
include(ExternalProject)
+include(ExternalProjectFlags)
if(WIN32 OR LEVELDB_ROOT)
# If the user has supplied a LEVELDB_ROOT then just use it. Add an empty
@@ -41,23 +42,38 @@ else()
$<$<CONFIG:Release>:${CMAKE_CXX_FLAGS_RELEASE}>"
)
+ ExternalProject_GitSource(
+ LEVELDB_GIT
+ GIT_REPOSITORY "https://github.com/google/leveldb.git"
+ GIT_TAG "v1.20"
+ )
+
ExternalProject_Add(
leveldb
+ DEPENDS
+ googletest # for sequencing
- GIT_REPOSITORY "https://github.com/google/leveldb.git"
- GIT_TAG "v1.20"
+ ${LEVELDB_GIT}
- PREFIX ${PROJECT_BINARY_DIR}/third_party/leveldb
+ PREFIX ${PROJECT_BINARY_DIR}/external/leveldb
+ # LevelDB's configuration is done in the Makefile
CONFIGURE_COMMAND ""
- BUILD_ALWAYS ON
+
+ # The Makefile-based build of leveldb does not support building
+ # out-of-source.
BUILD_IN_SOURCE ON
+
+ # Only build the leveldb library skipping the tools and in-memory
+ # implementation we don't use.
BUILD_COMMAND
- env CXXFLAGS=${LEVELDB_CXX_FLAGS} OPT=${LEVELDB_OPT} make -j all
+ env CXXFLAGS=${LEVELDB_CXX_FLAGS} OPT=${LEVELDB_OPT}
+ make -j out-static/libleveldb.a
INSTALL_DIR ${FIREBASE_INSTALL_DIR}
INSTALL_COMMAND ""
TEST_COMMAND ""
)
+
endif(WIN32 OR LEVELDB_ROOT)