Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kvdb
rocksdb
提交
5555cc50
R
rocksdb
项目概览
kvdb
/
rocksdb
11 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rocksdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5555cc50
编写于
7月 09, 2015
作者:
D
Dmitri Smirnov
浏览文件
操作
浏览文件
下载
差异文件
Improve build system
上级
c903ccc4
54d124a3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
140 addition
and
40 deletion
+140
-40
CMakeLists.txt
CMakeLists.txt
+6
-5
thirdparty.inc
thirdparty.inc
+134
-35
未找到文件。
CMakeLists.txt
浏览文件 @
5555cc50
# This cmake build is for Windows only.
# This cmake build is for Windows
64-bit
only.
#
# Prerequisites:
# You must have Visual Studio 2013 Update 4 installed. Start the Developer Command Prompt window that is a part of Visual Studio installation.
# Run the build commands from within the Developer Command Prompt window to have paths to the compiler and runtime libraries set.
#
Make sure that Git is in your PATH
#
You must have git.exe in your %PATH% environment variable.
#
# To build Rocksdb for Windows is as easy as 1-2-3-4-5:
#
# 1. Update paths to third
party libraries in thirdparty.cmake
file
# 1. Update paths to third
-party libraries in thirdparty.inc
file
# 2. Create a new directory for build artifacts
# mkdir build
# cd build
# 3. Run cmake to generate project files for Windows
# cmake -G "Visual Studio 12 Win64" ..
# 3. Run cmake to generate project files for Windows, add more options to enable required third-party libraries.
# See thirdparty.inc for more information.
# cmake -G "Visual Studio 12 Win64" .. <more options>
# 4. Then build the project in debug mode (you may want to add /m:<N> flag to run msbuild in <N> parallel threads)
# msbuild ALL_BUILD.vcxproj
# 5. And release mode (/m:<N> is also supported)
...
...
thirdparty.inc
浏览文件 @
5555cc50
# Edit definitions below to specify paths to include files and libraries of all 3rd party libraries
# This example assumes all the libraries locate in the same directory tree under THIRDPARTY_HOME environment variable
# Set environment variable THIRDPARTY_HOME to point to your third party libraries home (Unix style dir separators)
#
# Edit these lines to set defaults for use of external libraries
#
set
(
USE_GFLAGS_DEFAULT
0
)
# GFLAGS is disabled by default, enable with -DGFLAGS=1 cmake command line agrument
set
(
USE_SNAPPY_DEFAULT
0
)
# SNAPPY is disabled by default, enable with -DSNAPPY=1 cmake command line agrument
set
(
USE_LZ4_DEFAULT
0
)
# LZ4 is disabled by default, enable with -DLZ4=1 cmake command line agrument
set
(
USE_ZLIB_DEFAULT
0
)
# ZLIB is disabled by default, enable with -DZLIB=1 cmake command line agrument
set
(
USE_JEMALLOC_DEFAULT
0
)
# JEMALLOC is disabled by default, enable with -DJEMALLOC=1 cmake command line agrument
# Edit these lines to enable/disable external libraries use
set
(
USE_GFLAGS
1
)
set
(
USE_SNAPPY
1
)
set
(
USE_JEMALLOC
1
)
#
# This example assumes all the libraries locate in directories under THIRDPARTY_HOME environment variable
# Set environment variable THIRDPARTY_HOME to point to your third party libraries home (Unix style dir separators)
# or change the paths below to reflect where the libraries actually reside
#
set
(
THIRDPARTY_LIBS
""
)
# Initialization, don't touch
#
# Edit these 4 lines to define paths to GFLAGS
...
...
@@ -16,10 +24,29 @@ set(GFLAGS_INCLUDE ${GFLAGS_HOME}/inc/include)
set
(
GFLAGS_LIB_DEBUG
$
{
GFLAGS_HOME
}
/
bin
/
debug
/
amd64
/
gflags
.
lib
)
set
(
GFLAGS_LIB_RELEASE
$
{
GFLAGS_HOME
}
/
bin
/
retail
/
amd64
/
gflags
.
lib
)
# ================================================== GFLAGS ==================================================
#
# Don't touch these lines
set
(
GFLAGS_CXX_FLAGS
-
DGFLAGS
=
gflags
)
set
(
GFLAGS_LIBS
debug
$
{
GFLAGS_LIB_DEBUG
}
optimized
$
{
GFLAGS_LIB_RELEASE
})
#
if
(
DEFINED
GFLAGS
)
set
(
USE_GFLAGS
$
{
GFLAGS
})
else
()
set
(
USE_GFLAGS
$
{
USE_GFLAGS_DEFAULT
})
endif
()
if
(
$
{
USE_GFLAGS
}
EQUAL
1
)
message
(
"GFLAGS library is enabled"
)
set
(
GFLAGS_CXX_FLAGS
-
DGFLAGS
=
gflags
)
set
(
GFLAGS_LIBS
debug
$
{
GFLAGS_LIB_DEBUG
}
optimized
$
{
GFLAGS_LIB_RELEASE
})
add_definitions
(
$
{
GFLAGS_CXX_FLAGS
})
include_directories
(
$
{
GFLAGS_INCLUDE
})
set
(
THIRDPARTY_LIBS
$
{
THIRDPARTY_LIBS
}
$
{
GFLAGS_LIBS
})
else
()
message
(
"GFLAGS library is disabled"
)
endif
()
# ================================================== SNAPPY ==================================================
#
# Edit these 4 lines to define paths to Snappy
#
...
...
@@ -28,43 +55,115 @@ set(SNAPPY_INCLUDE ${SNAPPY_HOME}/inc/inc)
set
(
SNAPPY_LIB_DEBUG
$
{
SNAPPY_HOME
}
/
bin
/
debug
/
amd64
/
snappy
.
lib
)
set
(
SNAPPY_LIB_RELEASE
$
{
SNAPPY_HOME
}
/
bin
/
retail
/
amd64
/
snappy
.
lib
)
#
# Don't touch these lines
set
(
SNAPPY_CXX_FLAGS
-
DSNAPPY
)
set
(
SNAPPY_LIBS
debug
$
{
SNAPPY_LIB_DEBUG
}
optimized
$
{
SNAPPY_LIB_RELEASE
})
#
if
(
DEFINED
SNAPPY
)
set
(
USE_SNAPPY
$
{
SNAPPY
})
else
()
set
(
USE_SNAPPY
$
{
USE_SNAPPY_DEFAULT
})
endif
()
if
(
$
{
USE_SNAPPY
}
EQUAL
1
)
message
(
"SNAPPY library is enabled"
)
set
(
SNAPPY_CXX_FLAGS
-
DSNAPPY
)
set
(
SNAPPY_LIBS
debug
$
{
SNAPPY_LIB_DEBUG
}
optimized
$
{
SNAPPY_LIB_RELEASE
})
add_definitions
(
$
{
SNAPPY_CXX_FLAGS
})
include_directories
(
$
{
SNAPPY_INCLUDE
})
set
(
THIRDPARTY_LIBS
$
{
THIRDPARTY_LIBS
}
$
{
SNAPPY_LIBS
})
else
()
message
(
"SNAPPY library is disabled"
)
endif
()
# ================================================== LZ4 ==================================================
#
# Edit these 4 lines to define paths to
Jemalloc
# Edit these 4 lines to define paths to
LZ4
#
set
(
JEMALLOC_HOME
$ENV
{
THIRDPARTY_HOME
}
/
Jemalloc
.
Library
)
set
(
JEMALLOC_INCLUDE
$
{
JEMALLOC
_HOME
}
/
inc
/
include
)
set
(
JEMALLOC_LIB_DEBUG
$
{
JEMALLOC_HOME
}
/
bin
/
debug
/
amd64
/
jemalloc
.
lib
)
set
(
JEMALLOC_LIB_RELEASE
$
{
JEMALLOC_HOME
}
/
bin
/
retail
/
amd64
/
jemalloc
.
lib
)
set
(
LZ4_HOME
$ENV
{
THIRDPARTY_HOME
}
/
LZ4
.
Library
)
set
(
LZ4_INCLUDE
$
{
LZ4
_HOME
}
/
inc
/
include
)
set
(
LZ4_LIB_DEBUG
$
{
LZ4_HOME
}
/
bin
/
debug
/
amd64
/
lz4
.
lib
)
set
(
LZ4_LIB_RELEASE
$
{
LZ4_HOME
}
/
bin
/
retail
/
amd64
/
lz4
.
lib
)
#
# Don't touch these lines
set
(
JEMALLOC_CXX_FLAGS
-
DJEMALLOC
)
set
(
JEMALLOC_LIBS
debug
$
{
JEMALLOC_LIB_DEBUG
}
optimized
$
{
JEMALLOC_LIB_RELEASE
})
#
if
(
DEFINED
LZ4
)
set
(
USE_LZ4
$
{
LZ4
})
else
()
set
(
USE_LZ4
$
{
USE_LZ4_DEFAULT
})
endif
()
if
(
$
{
USE_LZ4
}
EQUAL
1
)
message
(
"LZ4 library is enabled"
)
set
(
LZ4_CXX_FLAGS
-
DLZ4
)
set
(
LZ4_LIBS
debug
$
{
LZ4_LIB_DEBUG
}
optimized
$
{
LZ4_LIB_RELEASE
})
# Aggregate all third-party dependencies
add_definitions
(
$
{
LZ4_CXX_FLAGS
})
include_directories
(
$
{
LZ4_INCLUDE
})
set
(
THIRDPARTY_LIBS
$
{
THIRDPARTY_LIBS
}
$
{
LZ4_LIBS
})
else
()
message
(
"LZ4 library is disabled"
)
endif
()
set
(
THIRDPARTY_LIBS
""
)
set
(
ARTIFACT_SUFFIX
""
)
# ================================================== ZLIB ==================================================
#
# Edit these 4 lines to define paths to ZLIB
#
set
(
ZLIB_HOME
$ENV
{
THIRDPARTY_HOME
}
/
ZLIB
.
Library
)
set
(
ZLIB_INCLUDE
$
{
ZLIB_HOME
}
/
inc
/
include
)
set
(
ZLIB_LIB_DEBUG
$
{
ZLIB_HOME
}
/
bin
/
debug
/
amd64
/
zlib
.
lib
)
set
(
ZLIB_LIB_RELEASE
$
{
ZLIB_HOME
}
/
bin
/
retail
/
amd64
/
zlib
.
lib
)
if
(
$
{
USE_GFLAGS
}
EQUAL
1
)
set
(
THIRDPARTY_LIBS
$
{
THIRDPARTY_LIBS
}
$
{
GFLAGS_LIBS
})
add_definitions
(
$
{
GFLAGS_CXX_FLAGS
})
include_directories
(
$
{
GFLAGS_INCLUDE
})
endif
(
$
{
USE_GFLAGS
}
EQUAL
1
)
#
# Don't touch these lines
#
if
(
DEFINED
ZLIB
)
set
(
USE_ZLIB
$
{
ZLIB
})
else
()
set
(
USE_ZLIB
$
{
USE_ZLIB_DEFAULT
})
endif
()
if
(
$
{
USE_SNAPPY
}
EQUAL
1
)
set
(
THIRDPARTY_LIBS
$
{
THIRDPARTY_LIBS
}
$
{
SNAPPY_LIBS
})
add_definitions
(
$
{
SNAPPY_CXX_FLAGS
})
include_directories
(
$
{
SNAPPY_INCLUDE
})
endif
(
$
{
USE_SNAPPY
}
EQUAL
1
)
if
(
$
{
USE_ZLIB
}
EQUAL
1
)
message
(
"ZLIB library is enabled"
)
set
(
ZLIB_CXX_FLAGS
-
DZLIB
)
set
(
ZLIB_LIBS
debug
$
{
ZLIB_LIB_DEBUG
}
optimized
$
{
ZLIB_LIB_RELEASE
})
add_definitions
(
$
{
ZLIB_CXX_FLAGS
})
include_directories
(
$
{
ZLIB_INCLUDE
})
set
(
THIRDPARTY_LIBS
$
{
THIRDPARTY_LIBS
}
$
{
ZLIB_LIBS
})
else
()
message
(
"ZLIB library is disabled"
)
endif
()
#
# Edit these 4 lines to define paths to Jemalloc
#
set
(
JEMALLOC_HOME
$ENV
{
THIRDPARTY_HOME
}
/
Jemalloc
.
Library
)
set
(
JEMALLOC_INCLUDE
$
{
JEMALLOC_HOME
}
/
inc
/
include
)
set
(
JEMALLOC_LIB_DEBUG
$
{
JEMALLOC_HOME
}
/
bin
/
debug
/
amd64
/
jemalloc
.
lib
)
set
(
JEMALLOC_LIB_RELEASE
$
{
JEMALLOC_HOME
}
/
bin
/
retail
/
amd64
/
jemalloc
.
lib
)
# ================================================== JEMALLOC ==================================================
#
# Don't touch these lines
#
if
(
DEFINED
JEMALLOC
)
set
(
USE_JEMALLOC
$
{
JEMALLOC
})
else
()
set
(
USE_JEMALLOC
$
{
USE_JEMALLOC_DEFAULT
})
endif
()
if
(
$
{
USE_JEMALLOC
}
EQUAL
1
)
set
(
THIRDPARTY_LIBS
$
{
THIRDPARTY_LIBS
}
$
{
JEMALLOC_LIBS
})
add_definitions
(
$
{
JEMALLOC_CXX_FLAGS
})
include_directories
(
$
{
JEMALLOC_INCLUDE
})
set
(
ARTIFACT_SUFFIX
"_je"
)
endif
(
$
{
USE_JEMALLOC
}
EQUAL
1
)
message
(
"JEMALLOC library is enabled"
)
set
(
JEMALLOC_CXX_FLAGS
-
DJEMALLOC
)
set
(
JEMALLOC_LIBS
debug
$
{
JEMALLOC_LIB_DEBUG
}
optimized
$
{
JEMALLOC_LIB_RELEASE
})
add_definitions
(
$
{
JEMALLOC_CXX_FLAGS
})
include_directories
(
$
{
JEMALLOC_INCLUDE
})
set
(
THIRDPARTY_LIBS
$
{
THIRDPARTY_LIBS
}
$
{
JEMALLOC_LIBS
})
set
(
ARTIFACT_SUFFIX
"_je"
)
else
()
set
(
ARTIFACT_SUFFIX
""
)
message
(
"JEMALLOC library is disabled"
)
endif
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录