Merge branch 'ms_win_port' of http://vstfbing:8080/tfs/Bing/_git/repo.RocksDB into ms_win_port

main
Dmitri Smirnov 10 years ago
commit 5219226d3d
  1. 38
      CMakeLists.txt
  2. 30
      thirdparty.inc

@ -44,10 +44,6 @@ add_custom_command(OUTPUT ${BUILD_VERSION_CC}
add_custom_target(GenerateBuildVersion DEPENDS ${BUILD_VERSION_CC}) add_custom_target(GenerateBuildVersion DEPENDS ${BUILD_VERSION_CC})
add_definitions(${GFLAGS_CXX_FLAGS} ${SNAPPY_CXX_FLAGS})
include_directories(${GFLAGS_INCLUDE} ${SNAPPY_INCLUDE} ${JEMALLOC_INCLUDE})
set (THIRDPARTY_LIBS ${GFLAGS_LIBS} ${SNAPPY_LIBS} ${JEMALLOC_LIBS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /nologo /W3 /WX /EHsc /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP /errorReport:queue") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /nologo /W3 /WX /EHsc /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP /errorReport:queue")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FC /d2Zi+ /wd4018 /wd4100 /wd4101 /wd4127 /wd4189 /wd4200 /wd4244 /wd4267 /wd4296 /wd4305 /wd4307 /wd4309 /wd4512 /wd4701 /wd4702 /wd4800 /wd4804 /wd4996") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FC /d2Zi+ /wd4018 /wd4100 /wd4101 /wd4127 /wd4189 /wd4200 /wd4244 /wd4267 /wd4296 /wd4305 /wd4307 /wd4309 /wd4512 /wd4701 /wd4702 /wd4800 /wd4804 /wd4996")
@ -63,13 +59,11 @@ include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/port) include_directories(${PROJECT_SOURCE_DIR}/port)
include_directories(${PROJECT_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src) include_directories(${PROJECT_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src)
set(ROCKSDB_LIBS rocksdblib) set(ROCKSDB_LIBS rocksdblib${ARTIFACT_SUFFIX})
set(ROCKSDB_LIBS_JE rocksdblib_je)
set(THIRDPARTY_LIBS ${THIRDPARTY_LIBS} gtest) set(THIRDPARTY_LIBS ${THIRDPARTY_LIBS} gtest)
set(SYSTEM_LIBS Shlwapi.lib Rpcrt4.lib) set(SYSTEM_LIBS Shlwapi.lib Rpcrt4.lib)
set(LIBS ${ROCKSDB_LIBS} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS}) set(LIBS ${ROCKSDB_LIBS} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
set(LIBS_JE ${ROCKSDB_LIBS_JE} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
add_subdirectory(third-party/gtest-1.7.0/fused-src/gtest) add_subdirectory(third-party/gtest-1.7.0/fused-src/gtest)
@ -226,23 +220,14 @@ set(SOURCES
utilities/write_batch_with_index/write_batch_with_index_internal.cc utilities/write_batch_with_index/write_batch_with_index_internal.cc
) )
add_library(rocksdblib ${SOURCES}) add_library(rocksdblib${ARTIFACT_SUFFIX} ${SOURCES})
set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/rocksdblib.pdb") set_target_properties(rocksdblib${ARTIFACT_SUFFIX} PROPERTIES COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/rocksdblib${ARTIFACT_SUFFIX}.pdb")
add_dependencies(rocksdblib GenerateBuildVersion) add_dependencies(rocksdblib${ARTIFACT_SUFFIX} GenerateBuildVersion)
add_library(rocksdblib_je ${SOURCES})
set_target_properties(rocksdblib_je PROPERTIES COMPILE_FLAGS "${JEMALLOC_CXX_FLAGS} /Fd${CMAKE_CFG_INTDIR}/rocksdblib_je.pdb")
add_dependencies(rocksdblib_je GenerateBuildVersion)
add_library(rocksdb SHARED ${SOURCES})
set_target_properties(rocksdb PROPERTIES COMPILE_FLAGS "-DROCKSDB_DLL -DROCKSDB_LIBRARY_EXPORTS /Fd${CMAKE_CFG_INTDIR}/rocksdb.pdb")
add_dependencies(rocksdb GenerateBuildVersion)
target_link_libraries(rocksdb ${LIBS})
add_library(rocksdb_je SHARED ${SOURCES}) add_library(rocksdb${ARTIFACT_SUFFIX} SHARED ${SOURCES})
set_target_properties(rocksdb_je PROPERTIES COMPILE_FLAGS "${JEMALLOC_CXX_FLAGS} -DROCKSDB_DLL -DROCKSDB_LIBRARY_EXPORTS /Fd${CMAKE_CFG_INTDIR}/rocksdb_je.pdb") set_target_properties(rocksdb${ARTIFACT_SUFFIX} PROPERTIES COMPILE_FLAGS "-DROCKSDB_DLL -DROCKSDB_LIBRARY_EXPORTS /Fd${CMAKE_CFG_INTDIR}/rocksdb${ARTIFACT_SUFFIX}.pdb")
add_dependencies(rocksdb_je GenerateBuildVersion) add_dependencies(rocksdb${ARTIFACT_SUFFIX} GenerateBuildVersion)
target_link_libraries(rocksdb_je ${LIBS_JE}) target_link_libraries(rocksdb${ARTIFACT_SUFFIX} ${LIBS})
set(APPS set(APPS
db/db_bench.cc db/db_bench.cc
@ -340,9 +325,6 @@ foreach(sourcefile ${EXES})
string(REPLACE ".cc" "" exename ${sourcefile}) string(REPLACE ".cc" "" exename ${sourcefile})
string(REPLACE ".c" "" exename ${exename}) string(REPLACE ".c" "" exename ${exename})
string(REGEX REPLACE "^((.+)/)+" "" exename ${exename}) string(REGEX REPLACE "^((.+)/)+" "" exename ${exename})
add_executable(${exename} ${sourcefile}) add_executable(${exename}${ARTIFACT_SUFFIX} ${sourcefile})
target_link_libraries(${exename} ${LIBS}) target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${LIBS})
add_executable(${exename}_je ${sourcefile})
set_target_properties(${exename}_je PROPERTIES COMPILE_FLAGS ${JEMALLOC_CXX_FLAGS})
target_link_libraries(${exename}_je ${LIBS_JE})
endforeach(sourcefile ${EXES}) endforeach(sourcefile ${EXES})

@ -3,6 +3,11 @@
# This example assumes all the libraries locate in the same directory tree under THIRDPARTY_HOME environment variable # 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) # Set environment variable THIRDPARTY_HOME to point to your third party libraries home (Unix style dir separators)
# Edit these lines to enable/disable external libraries use
set(USE_GFLAGS 1)
set(USE_SNAPPY 1)
set(USE_JEMALLOC 1)
# #
# Edit these 4 lines to define paths to GFLAGS # Edit these 4 lines to define paths to GFLAGS
# #
@ -38,3 +43,28 @@ set(JEMALLOC_LIB_RELEASE ${JEMALLOC_HOME}/bin/retail/amd64/jemalloc.lib)
# Don't touch these lines # Don't touch these lines
set(JEMALLOC_CXX_FLAGS -DJEMALLOC) set(JEMALLOC_CXX_FLAGS -DJEMALLOC)
set(JEMALLOC_LIBS debug ${JEMALLOC_LIB_DEBUG} optimized ${JEMALLOC_LIB_RELEASE}) set(JEMALLOC_LIBS debug ${JEMALLOC_LIB_DEBUG} optimized ${JEMALLOC_LIB_RELEASE})
# Aggregate all third-party dependencies
set (THIRDPARTY_LIBS "")
set (ARTIFACT_SUFFIX "")
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)
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_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)

Loading…
Cancel
Save