Browse Source

Merge branch 'build_enhancement' of https://github.com/debris/cpp-ethereum into build_enhancement

cl-refactor
debris 10 years ago
parent
commit
8731da36cc
  1. 3
      extdep/CMakeLists.txt
  2. 22
      extdep/leveldb.cmake
  3. 18
      extdep/leveldb_osx.patch
  4. 14
      extdep/snappy.cmake

3
extdep/CMakeLists.txt

@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
# all dependencies will be installed into this directory, separated by platform
string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name)
set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install/${_system_name}")
@ -14,6 +13,8 @@ include(jsoncpp.cmake)
include(argtable2.cmake)
include(json-rpc-cpp.cmake)
include(cryptopp.cmake)
include(snappy.cmake)
include(leveldb.cmake)
# will be re-eanbled later
# include(curl.cmake)

22
extdep/leveldb.cmake

@ -0,0 +1,22 @@
if(APPLE)
ExternalProject_Add(leveldb
DEPENDS snappy
URL https://leveldb.googlecode.com/files/leveldb-1.15.0.tar.gz
BINARY_DIR leveldb-prefix/src/leveldb
CONFIGURE_COMMAND patch < ${CMAKE_CURRENT_SOURCE_DIR}/leveldb_osx.patch
BUILD_COMMAND export ETH_DEPENDENCY_INSTALL_DIR=${ETH_DEPENDENCY_INSTALL_DIR} && make -j 3
INSTALL_COMMAND cp -rf include/leveldb ${ETH_DEPENDENCY_INSTALL_DIR}/include/ && mv libleveldb.a ${ETH_DEPENDENCY_INSTALL_DIR}/lib && mv libleveldb.dylib.1.15 ${ETH_DEPENDENCY_INSTALL_DIR}/lib/libleveldb.dylib
)
elseif(WIN32)
ExternalProject_Add(leveldb
GIT_REPOSITORY https://code.google.com/p/leveldb
GIT_TAG windows
BINARY_DIR leveldb-prefix/src/leveldb
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
else()
endif()

18
extdep/leveldb_osx.patch

@ -0,0 +1,18 @@
--- Makefile 2014-11-07 00:54:05.000000000 +0100
+++ MakefilePatch 2014-11-07 00:56:59.000000000 +0100
@@ -17,11 +17,11 @@
# this file is generated by the previous line to set build flags and sources
include build_config.mk
-CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
-CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)
+CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
+CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -DSNAPPY -I$(ETH_DEPENDENCY_INSTALL_DIR)/include
-LDFLAGS += $(PLATFORM_LDFLAGS)
-LIBS += $(PLATFORM_LIBS)
+LDFLAGS += $(PLATFORM_LDFLAGS) -L$(ETH_DEPENDENCY_INSTALL_DIR)/lib
+LIBS += $(PLATFORM_LIBS) -lsnappy
LIBOBJECTS = $(SOURCES:.cc=.o)
MEMENVOBJECTS = $(MEMENV_SOURCES:.cc=.o)

14
extdep/snappy.cmake

@ -0,0 +1,14 @@
if(APPLE)
ExternalProject_Add(snappy
URL https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz
BINARY_DIR snappy-prefix/src/snappy
CONFIGURE_COMMAND ./configure --disable-dependency-tracking --prefix=${ETH_DEPENDENCY_INSTALL_DIR}
BUILD_COMMAND ""
INSTALL_COMMAND make install
)
elseif(WIN32)
else()
endif()
Loading…
Cancel
Save