@ -115,7 +115,7 @@ configure_file(util/build_version.cc.in ${BUILD_VERSION_CC} @ONLY)
add_library ( build_version OBJECT ${ BUILD_VERSION_CC } )
add_library ( build_version OBJECT ${ BUILD_VERSION_CC } )
target_include_directories ( build_version PRIVATE
target_include_directories ( build_version PRIVATE
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u t i l )
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u t i l )
if ( WIN32 )
if ( MSVC )
if ( ${ USE_AVX2 } EQUAL 1 )
if ( ${ USE_AVX2 } EQUAL 1 )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /nologo /arch:AVX2 /EHsc /GS /Gd /GR /GF /fp:precise /Zc:wchar_t /Zc:forScope /errorReport:queue" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /nologo /arch:AVX2 /EHsc /GS /Gd /GR /GF /fp:precise /Zc:wchar_t /Zc:forScope /errorReport:queue" )
else ( )
else ( )
@ -126,6 +126,9 @@ if(WIN32)
else ( )
else ( )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wextra -Wall" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wextra -Wall" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers" )
if ( MINGW )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format" )
endif ( )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
if ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
if ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer" )
@ -187,7 +190,7 @@ else()
set ( OPTIMIZE_DEBUG ${ OPTIMIZE_DEBUG_DEFAULT } )
set ( OPTIMIZE_DEBUG ${ OPTIMIZE_DEBUG_DEFAULT } )
endif ( )
endif ( )
if ( WIN32 )
if ( MSVC )
if ( ( ${ OPTIMIZE_DEBUG } EQUAL 1 ) )
if ( ( ${ OPTIMIZE_DEBUG } EQUAL 1 ) )
message ( STATUS "Debug optimization is enabled" )
message ( STATUS "Debug optimization is enabled" )
set ( CMAKE_CXX_FLAGS_DEBUG "/Oxt /MDd" )
set ( CMAKE_CXX_FLAGS_DEBUG "/Oxt /MDd" )
@ -235,6 +238,9 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
add_definitions ( -DOS_ANDROID )
add_definitions ( -DOS_ANDROID )
elseif ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
elseif ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
add_definitions ( -DWIN32 -DOS_WIN -D_MBCS -DWIN64 -DNOMINMAX )
add_definitions ( -DWIN32 -DOS_WIN -D_MBCS -DWIN64 -DNOMINMAX )
if ( MINGW )
add_definitions ( -D_WIN32_WINNT=_WIN32_WINNT_VISTA )
endif ( )
endif ( )
endif ( )
if ( NOT WIN32 )
if ( NOT WIN32 )
@ -514,18 +520,18 @@ add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES})
target_link_libraries ( ${ ROCKSDB_STATIC_LIB }
target_link_libraries ( ${ ROCKSDB_STATIC_LIB }
$ { T H I R D P A R T Y _ L I B S } $ { S Y S T E M _ L I B S } )
$ { T H I R D P A R T Y _ L I B S } $ { S Y S T E M _ L I B S } )
if ( WIN32 )
set_target_properties ( ${ ROCKSDB_STATIC_LIB } PROPERTIES
C O M P I L E _ F L A G S " / F d $ { C M A K E _ C F G _ I N T D I R } / $ { R O C K S D B _ S T A T I C _ L I B } . p d b " )
endif ( )
if ( WIN32 )
if ( WIN32 )
add_library ( ${ ROCKSDB_IMPORT_LIB } SHARED ${ SOURCES } )
add_library ( ${ ROCKSDB_IMPORT_LIB } SHARED ${ SOURCES } )
target_link_libraries ( ${ ROCKSDB_IMPORT_LIB }
target_link_libraries ( ${ ROCKSDB_IMPORT_LIB }
$ { T H I R D P A R T Y _ L I B S } $ { S Y S T E M _ L I B S } )
$ { T H I R D P A R T Y _ L I B S } $ { S Y S T E M _ L I B S } )
set_target_properties ( ${ ROCKSDB_IMPORT_LIB } PROPERTIES
set_target_properties ( ${ ROCKSDB_IMPORT_LIB } PROPERTIES
C O M P I L E _ F L A G S " - D R O C K S D B _ D L L - D R O C K S D B _ L I B R A R Y _ E X P O R T S / F d $ { C M A K E _ C F G _ I N T D I R } / $ { R O C K S D B _ I M P O R T _ L I B } . p d b " )
C O M P I L E _ D E F I N I T I O N S " R O C K S D B _ D L L ; R O C K S D B _ L I B R A R Y _ E X P O R T S " )
else ( )
if ( MSVC )
set_target_properties ( ${ ROCKSDB_STATIC_LIB } PROPERTIES
C O M P I L E _ F L A G S " / F d $ { C M A K E _ C F G _ I N T D I R } / $ { R O C K S D B _ S T A T I C _ L I B } . p d b " )
set_target_properties ( ${ ROCKSDB_IMPORT_LIB } PROPERTIES
C O M P I L E _ F L A G S " / F d $ { C M A K E _ C F G _ I N T D I R } / $ { R O C K S D B _ I M P O R T _ L I B } . p d b " )
endif ( )
endif ( )
endif ( )
option ( WITH_JNI "build with JNI" OFF )
option ( WITH_JNI "build with JNI" OFF )
@ -692,7 +698,7 @@ enable_testing()
add_custom_target ( check COMMAND ${ CMAKE_CTEST_COMMAND } )
add_custom_target ( check COMMAND ${ CMAKE_CTEST_COMMAND } )
set ( TESTUTILLIB testutillib ${ ARTIFACT_SUFFIX } )
set ( TESTUTILLIB testutillib ${ ARTIFACT_SUFFIX } )
add_library ( ${ TESTUTILLIB } STATIC ${ TESTUTIL_SOURCE } )
add_library ( ${ TESTUTILLIB } STATIC ${ TESTUTIL_SOURCE } )
if ( WIN32 )
if ( MSVC )
set_target_properties ( ${ TESTUTILLIB } PROPERTIES COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/testutillib${ARTIFACT_SUFFIX}.pdb" )
set_target_properties ( ${ TESTUTILLIB } PROPERTIES COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/testutillib${ARTIFACT_SUFFIX}.pdb" )
endif ( )
endif ( )
set_target_properties ( ${ TESTUTILLIB }
set_target_properties ( ${ TESTUTILLIB }