@ -14,10 +14,15 @@
# 3 . R u n c m a k e t o g e n e r a t e p r o j e c t f i l e s f o r W i n d o w s , a d d m o r e o p t i o n s t o e n a b l e r e q u i r e d t h i r d - p a r t y l i b r a r i e s .
# S e e t h i r d p a r t y . i n c f o r m o r e i n f o r m a t i o n .
# s a m p l e c o m m a n d : c m a k e - G " V i s u a l S t u d i o 1 2 W i n 6 4 " - D G F L A G S = 1 - D S N A P P Y = 1 - D J E M A L L O C = 1 . .
# 4 . T h e n b u i l d t h e p r o j e c t i n d e b u g mode ( you may want to add /m:<N> flag to run msbuild in <N> parallel threads )
# m s b u i l d A L L _ B U I L D . v c x p r o j
# 4 . T h e n b u i l d t h e p r o j e c t i n d e b u g mode ( you may want to add /m[:<N>] flag to run msbuild in <N> parallel threads
# o r s i m p l y / m o t u s e a l l a v a i l c o r e s )
# m s b u i l d r o c k s d b . s l n
#
# r o c k s d b . s l n b u i l d f e a t u r e s e x c l u s i o n s o f t e s t o n l y c o d e i n R e l e a s e . I f y o u b u i l d A L L _ B U I L D t h e n e v e r y t h i n g
# w i l l b e a t t e m p t e d b u t t e s t o n l y c o d e d o e s n o t b u i l d i n R e l e a s e m o d e .
#
# 5 . A n d r e l e a s e mode ( /m[:<N>] is also supported )
# m s b u i l d A L L _ B U I L D . v c x p r o j / p : C o n f i g u r a t i o n = R e l e a s e
# m s b u i l d r o c k s d b . s l n / p : C o n f i g u r a t i o n = R e l e a s e
#
cmake_minimum_required ( VERSION 2.6 )
@ -83,6 +88,7 @@ set(LIBS ${ROCKSDB_LIBS} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
add_subdirectory ( third-party/gtest-1.7.0/fused-src/gtest )
# M a i n l i b r a r y s o u r c e c o d e
set ( SOURCES
d b / b u i l d e r . c c
d b / c . c c
@ -100,7 +106,6 @@ set(SOURCES
d b / d b _ i m p l _ e x p e r i m e n t a l . c c
d b / d b _ i m p l _ r e a d o n l y . c c
d b / d b _ i t e r . c c
d b / d b _ t e s t _ u t i l . c c
d b / e v e n t _ h e l p e r s . c c
d b / e x p e r i m e n t a l . c c
d b / f i l e n a m e . c c
@ -252,6 +257,12 @@ set(SOURCES
u t i l i t i e s / w r i t e _ b a t c h _ w i t h _ i n d e x / w r i t e _ b a t c h _ w i t h _ i n d e x _ i n t e r n a l . c c
)
# F o r t e s t u t i l l i b r a r y t h a t i s b u i l d o n l y i n D E B U G m o d e
# a n d l i n k e d t o t e s t s . A d d t e s t o n l y c o d e t h a t i s n o t # i f d e f e d f o r R e l e a s e h e r e .
set ( TESTUTIL_SOURCE
d b / d b _ t e s t _ u t i l . c c
)
add_library ( rocksdblib ${ ARTIFACT_SUFFIX } ${ SOURCES } )
set_target_properties ( rocksdblib ${ ARTIFACT_SUFFIX } PROPERTIES COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/rocksdblib${ARTIFACT_SUFFIX}.pdb" )
add_dependencies ( rocksdblib ${ ARTIFACT_SUFFIX } GenerateBuildVersion )
@ -367,7 +378,7 @@ set(TESTS
u t i l i t i e s / w r i t e _ b a t c h _ w i t h _ i n d e x / w r i t e _ b a t c h _ w i t h _ i n d e x _ t e s t . c c
)
set ( EXES ${ APPS } ${ TESTS } )
set ( EXES ${ APPS } )
foreach ( sourcefile ${ EXES } )
string ( REPLACE ".cc" "" exename ${ sourcefile } )
@ -376,12 +387,42 @@ foreach(sourcefile ${EXES})
target_link_libraries ( ${ exename } ${ ARTIFACT_SUFFIX } ${ LIBS } )
endforeach ( sourcefile ${ EXES } )
# t e s t u t i l i t i e s a r e o n l y b u i l d i n d e b u g
set ( TESTUTILLIB testutillib ${ ARTIFACT_SUFFIX } )
add_library ( ${ TESTUTILLIB } STATIC ${ TESTUTIL_SOURCE } )
set_target_properties ( ${ TESTUTILLIB } PROPERTIES COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/testutillib${ARTIFACT_SUFFIX}.pdb" )
set_target_properties ( ${ TESTUTILLIB }
P R O P E R T I E S E X C L U D E _ F R O M _ D E F A U L T _ B U I L D _ R E L E A S E 1
E X C L U D E _ F R O M _ D E F A U L T _ B U I L D _ M I N R E L E A S E 1
E X C L U D E _ F R O M _ D E F A U L T _ B U I L D _ R E L W I T H D E B I N F O 1
)
# T e s t s a r e e x c l u d e d f r o m R e l e a s e b u i l d s
set ( TEST_EXES ${ TESTS } )
foreach ( sourcefile ${ TEST_EXES } )
string ( REPLACE ".cc" "" exename ${ sourcefile } )
string ( REGEX REPLACE "^((.+)/)+" "" exename ${ exename } )
add_executable ( ${ exename } ${ ARTIFACT_SUFFIX } ${ sourcefile } )
set_target_properties ( ${ exename } ${ ARTIFACT_SUFFIX }
P R O P E R T I E S E X C L U D E _ F R O M _ D E F A U L T _ B U I L D _ R E L E A S E 1
E X C L U D E _ F R O M _ D E F A U L T _ B U I L D _ M I N R E L E A S E 1
E X C L U D E _ F R O M _ D E F A U L T _ B U I L D _ R E L W I T H D E B I N F O 1
)
target_link_libraries ( ${ exename } ${ ARTIFACT_SUFFIX } ${ LIBS } testutillib ${ ARTIFACT_SUFFIX } )
endforeach ( sourcefile ${ TEST_EXES } )
# C e x e c u t a b l e s m u s t l i n k t o a s h a r e d o b j e c t
set ( C_EXES ${ C_TESTS } )
set ( C_TEST_ EXES ${ C_TESTS } )
foreach ( sourcefile ${ C_EXES } )
foreach ( sourcefile ${ C_TEST_ EXES } )
string ( REPLACE ".c" "" exename ${ sourcefile } )
string ( REGEX REPLACE "^((.+)/)+" "" exename ${ exename } )
add_executable ( ${ exename } ${ ARTIFACT_SUFFIX } ${ sourcefile } )
target_link_libraries ( ${ exename } ${ ARTIFACT_SUFFIX } rocksdb ${ ARTIFACT_SUFFIX } )
endforeach ( sourcefile ${ C_TESTS } )
set_target_properties ( ${ exename } ${ ARTIFACT_SUFFIX }
P R O P E R T I E S E X C L U D E _ F R O M _ D E F A U L T _ B U I L D _ R E L E A S E 1
E X C L U D E _ F R O M _ D E F A U L T _ B U I L D _ M I N R E L E A S E 1
E X C L U D E _ F R O M _ D E F A U L T _ B U I L D _ R E L W I T H D E B I N F O 1
)
target_link_libraries ( ${ exename } ${ ARTIFACT_SUFFIX } rocksdb ${ ARTIFACT_SUFFIX } testutillib ${ ARTIFACT_SUFFIX } )
endforeach ( sourcefile ${ C_TEST_EXES } )