Skip to content

Commit

Permalink
Merge remote-tracking branch 'ui/rocksdb-646'
Browse files Browse the repository at this point in the history
  • Loading branch information
gocarlos committed Dec 18, 2019
2 parents 3690fb3 + cc99b69 commit d3fb742
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 77 deletions.
7 changes: 6 additions & 1 deletion recipes/rocksdb/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ PROJECT(conancmakewrapper)

set(CMAKE_VERBOSE_MAKEFILE ON)

include("${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake")
include("conanbuildinfo.cmake")
CONAN_BASIC_SETUP()

if (WIN32 AND MSVC AND BUILD_SHARED_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

add_subdirectory("source_subfolder")
10 changes: 5 additions & 5 deletions recipes/rocksdb/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sources:
"6.4.6":
sha256: 540BBF9369A31E0891FCB4056A36FFA439C59FC179AA0B1F46E3478417F97643
url: https://github.com/facebook/rocksdb/archive/v6.4.6.tar.gz
"6.5.2":
sha256: a923e36aa1cdd1429ae93a0b26baf477c714060ce7dd1c52e873754e1468d7ff
url: https://github.com/facebook/rocksdb/archive/v6.5.2.tar.gz
patches:
"6.4.6":
"6.5.2":
- base_path: source_subfolder
patch_file: patches/0001-build-libs.patch
patch_file: patches/0001-install-libs.patch
17 changes: 14 additions & 3 deletions recipes/rocksdb/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class RocksDB(ConanFile):
"with_snappy": [True, False],
"with_lz4": [True, False],
"with_zlib": [True, False],
"with_zstd": [True, False]
"with_zstd": [True, False],
"with_tbb": [True, False]
}
default_options = {
"shared": False,
Expand All @@ -29,7 +30,8 @@ class RocksDB(ConanFile):
"with_lz4": False,
"with_zlib": False,
"with_zstd": False,
"with_gflags": False
"with_gflags": False,
"with_tbb": False
}
exports_sources = ["CMakeLists.txt", "patches/*"]
generators = ["cmake"]
Expand All @@ -38,6 +40,10 @@ class RocksDB(ConanFile):
def _source_subfolder(self):
return "source_subfolder"

@property
def _build_subfolder(self):
return "build_subfolder"

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand All @@ -59,9 +65,12 @@ def _configure_cmake(self):
cmake.definitions["WITH_LZ4"] = self.options.with_lz4
cmake.definitions["WITH_ZLIB"] = self.options.with_zlib
cmake.definitions["WITH_ZSTD"] = self.options.with_zstd
cmake.definitions["WITH_TBB"] = self.options.with_tbb
# not available yet in CCI
cmake.definitions["WITH_JEMALLOC"] = False
cmake.configure()
cmake.definitions["WITH_NUMA"] = False

cmake.configure(build_folder=self._build_subfolder)
return cmake

def build(self):
Expand All @@ -81,6 +90,8 @@ def requirements(self):
self.requires("zlib/1.2.11")
if self.options.with_zstd:
self.requires("zstd/1.3.8")
if self.options.with_tbb:
self.requires("tbb/2019_u9")

def package(self):
self.copy("COPYING", dst="licenses", src=self._source_subfolder)
Expand Down
67 changes: 0 additions & 67 deletions recipes/rocksdb/all/patches/0001-build-libs.patch

This file was deleted.

52 changes: 52 additions & 0 deletions recipes/rocksdb/all/patches/0001-install-libs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db9e371..963793b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -844,6 +844,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS)

install(DIRECTORY include/rocksdb COMPONENT devel DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

+ if (NOT BUILD_SHARED_LIBS)
install(
TARGETS ${ROCKSDB_STATIC_LIB}
EXPORT RocksDBTargets
@@ -851,7 +852,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS)
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
-
+ else()
install(
TARGETS ${ROCKSDB_SHARED_LIB}
EXPORT RocksDBTargets
@@ -861,7 +862,9 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS)
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
+ endif()

+ if (NOT)
install(
EXPORT RocksDBTargets
COMPONENT devel
@@ -876,6 +879,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS)
COMPONENT devel
DESTINATION ${package_config_destination}
)
+ endif()
endif()

option(WITH_TESTS "build with tests" ON)
diff --git a/cmake/modules/ReadVersion.cmake b/cmake/modules/ReadVersion.cmake
index ae356d9..ebfd7d6 100644
--- a/cmake/modules/ReadVersion.cmake
+++ b/cmake/modules/ReadVersion.cmake
@@ -1,7 +1,7 @@
# Read rocksdb version from version.h header file.

function(get_rocksdb_version version_var)
- file(READ "${CMAKE_SOURCE_DIR}/include/rocksdb/version.h" version_header_file)
+ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/include/rocksdb/version.h" version_header_file)
foreach(component MAJOR MINOR PATCH)
string(REGEX MATCH "#define ROCKSDB_${component} ([0-9]+)" _ ${version_header_file})
set(ROCKSDB_VERSION_${component} ${CMAKE_MATCH_1})
2 changes: 1 addition & 1 deletion recipes/rocksdb/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
versions:
"6.4.6":
"6.5.2":
folder: all

0 comments on commit d3fb742

Please sign in to comment.