@ -1,4 +1,4 @@
cmake_minimum_required ( VERSION 2.6 )
cmake_minimum_required ( VERSION 3.4 )
set ( JNI_NATIVE_SOURCES
set ( JNI_NATIVE_SOURCES
r o c k s j n i / b a c k u p a b l e j n i . c c
r o c k s j n i / b a c k u p a b l e j n i . c c
@ -46,7 +46,7 @@ set(JNI_NATIVE_SOURCES
set ( NATIVE_JAVA_CLASSES
set ( NATIVE_JAVA_CLASSES
o r g . r o c k s d b . A b s t r a c t C o m p a c t i o n F i l t e r
o r g . r o c k s d b . A b s t r a c t C o m p a c t i o n F i l t e r
o r g . r o c k s d b . A b s t r a c t C o m p a r a t o r
o r g . r o c k s d b . A b s t r a c t C o m p a c t i o n F i l t e r F a c t o r y
o r g . r o c k s d b . A b s t r a c t I m m u t a b l e N a t i v e R e f e r e n c e
o r g . r o c k s d b . A b s t r a c t I m m u t a b l e N a t i v e R e f e r e n c e
o r g . r o c k s d b . A b s t r a c t N a t i v e R e f e r e n c e
o r g . r o c k s d b . A b s t r a c t N a t i v e R e f e r e n c e
o r g . r o c k s d b . A b s t r a c t R o c k s I t e r a t o r
o r g . r o c k s d b . A b s t r a c t R o c k s I t e r a t o r
@ -74,7 +74,6 @@ set(NATIVE_JAVA_CLASSES
o r g . r o c k s d b . D i r e c t S l i c e
o r g . r o c k s d b . D i r e c t S l i c e
o r g . r o c k s d b . E n v
o r g . r o c k s d b . E n v
o r g . r o c k s d b . E n v O p t i o n s
o r g . r o c k s d b . E n v O p t i o n s
o r g . r o c k s d b . E x t e r n a l S s t F i l e I n f o
o r g . r o c k s d b . F i l t e r
o r g . r o c k s d b . F i l t e r
o r g . r o c k s d b . F l u s h O p t i o n s
o r g . r o c k s d b . F l u s h O p t i o n s
o r g . r o c k s d b . H a s h L i n k e d L i s t M e m T a b l e C o n f i g
o r g . r o c k s d b . H a s h L i n k e d L i s t M e m T a b l e C o n f i g
@ -92,6 +91,7 @@ set(NATIVE_JAVA_CLASSES
o r g . r o c k s d b . R e a d O p t i o n s
o r g . r o c k s d b . R e a d O p t i o n s
o r g . r o c k s d b . R e m o v e E m p t y V a l u e C o m p a c t i o n F i l t e r
o r g . r o c k s d b . R e m o v e E m p t y V a l u e C o m p a c t i o n F i l t e r
o r g . r o c k s d b . R e s t o r e O p t i o n s
o r g . r o c k s d b . R e s t o r e O p t i o n s
o r g . r o c k s d b . R o c k s C a l l b a c k O b j e c t
o r g . r o c k s d b . R o c k s D B
o r g . r o c k s d b . R o c k s D B
o r g . r o c k s d b . R o c k s D B E x c e p t i o n T e s t
o r g . r o c k s d b . R o c k s D B E x c e p t i o n T e s t
o r g . r o c k s d b . R o c k s E n v
o r g . r o c k s d b . R o c k s E n v
@ -120,8 +120,11 @@ set(NATIVE_JAVA_CLASSES
o r g . r o c k s d b . W r i t e O p t i o n s
o r g . r o c k s d b . W r i t e O p t i o n s
)
)
include_directories ( $ENV{ JAVA_HOME } /include )
include ( FindJava )
include_directories ( $ENV{ JAVA_HOME } /include/win32 )
include ( UseJava )
include ( FindJNI )
include_directories ( ${ JNI_INCLUDE_DIRS } )
include_directories ( ${ PROJECT_SOURCE_DIR } /java )
include_directories ( ${ PROJECT_SOURCE_DIR } /java )
set ( JAVA_TEST_LIBDIR ${ PROJECT_SOURCE_DIR } /java/test-libs )
set ( JAVA_TEST_LIBDIR ${ PROJECT_SOURCE_DIR } /java/test-libs )
@ -131,7 +134,118 @@ set(JAVA_HAMCR_JAR ${JAVA_TEST_LIBDIR}/hamcrest-core-1.3.jar)
set ( JAVA_MOCKITO_JAR ${ JAVA_TEST_LIBDIR } /mockito-all-1.10.19.jar )
set ( JAVA_MOCKITO_JAR ${ JAVA_TEST_LIBDIR } /mockito-all-1.10.19.jar )
set ( JAVA_CGLIB_JAR ${ JAVA_TEST_LIBDIR } /cglib-2.2.2.jar )
set ( JAVA_CGLIB_JAR ${ JAVA_TEST_LIBDIR } /cglib-2.2.2.jar )
set ( JAVA_ASSERTJ_JAR ${ JAVA_TEST_LIBDIR } /assertj-core-1.7.1.jar )
set ( JAVA_ASSERTJ_JAR ${ JAVA_TEST_LIBDIR } /assertj-core-1.7.1.jar )
set ( JAVA_TESTCLASSPATH "${JAVA_JUNIT_JAR}\;${JAVA_HAMCR_JAR}\;${JAVA_MOCKITO_JAR}\;${JAVA_CGLIB_JAR}\;${JAVA_ASSERTJ_JAR}" )
set ( JAVA_TESTCLASSPATH ${ JAVA_JUNIT_JAR } ${ JAVA_HAMCR_JAR } ${ JAVA_MOCKITO_JAR } ${ JAVA_CGLIB_JAR } ${ JAVA_ASSERTJ_JAR } )
add_jar (
r o c k s d b j n i _ c l a s s e s
S O U R C E S
s r c / m a i n / j a v a / o r g / r o c k s d b / A b s t r a c t C o m p a c t i o n F i l t e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A b s t r a c t C o m p a c t i o n F i l t e r F a c t o r y . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A b s t r a c t C o m p a r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A b s t r a c t I m m u t a b l e N a t i v e R e f e r e n c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A b s t r a c t N a t i v e R e f e r e n c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A b s t r a c t R o c k s I t e r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A b s t r a c t S l i c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A b s t r a c t W r i t e B a t c h . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A c c e s s H i n t . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A d v a n c e d C o l u m n F a m i l y O p t i o n s I n t e r f a c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / A d v a n c e d M u t a b l e C o l u m n F a m i l y O p t i o n s I n t e r f a c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / B a c k u p a b l e D B O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / B a c k u p E n g i n e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / B a c k u p I n f o . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / B l o c k B a s e d T a b l e C o n f i g . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / B l o o m F i l t e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / B u i l t i n C o m p a r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C a c h e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C a s s a n d r a C o m p a c t i o n F i l t e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C a s s a n d r a V a l u e M e r g e O p e r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C h e c k p o i n t . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C h e c k s u m T y p e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C l o c k C a c h e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o l u m n F a m i l y D e s c r i p t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o l u m n F a m i l y H a n d l e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o l u m n F a m i l y O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o l u m n F a m i l y O p t i o n s I n t e r f a c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o m p a c t i o n O p t i o n s F I F O . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o m p a c t i o n O p t i o n s U n i v e r s a l . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o m p a c t i o n P r i o r i t y . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o m p a c t i o n S t o p S t y l e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o m p a c t i o n S t y l e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o m p a r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o m p a r a t o r O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o m p r e s s i o n O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / C o m p r e s s i o n T y p e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / D B O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / D B O p t i o n s I n t e r f a c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / D b P a t h . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / D i r e c t C o m p a r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / D i r e c t S l i c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / E n c o d i n g T y p e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / E n v . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / E n v O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / E x p e r i m e n t a l . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / F i l t e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / F l u s h O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / H a s h L i n k e d L i s t M e m T a b l e C o n f i g . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / H a s h S k i p L i s t M e m T a b l e C o n f i g . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / H i s t o g r a m D a t a . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / H i s t o g r a m T y p e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / I n d e x T y p e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / I n f o L o g L e v e l . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / I n g e s t E x t e r n a l F i l e O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / L o g g e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / L R U C a c h e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / M e m T a b l e C o n f i g . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / M e r g e O p e r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / M u t a b l e C o l u m n F a m i l y O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / M u t a b l e C o l u m n F a m i l y O p t i o n s I n t e r f a c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / N a t i v e L i b r a r y L o a d e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / O p t i o n s U t i l . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / P l a i n T a b l e C o n f i g . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R a t e L i m i t e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R e a d O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R e a d T i e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R e m o v e E m p t y V a l u e C o m p a c t i o n F i l t e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R e s t o r e O p t i o n s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R o c k s C a l l b a c k O b j e c t . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R o c k s D B . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R o c k s D B E x c e p t i o n . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R o c k s E n v . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R o c k s I t e r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R o c k s I t e r a t o r I n t e r f a c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R o c k s M e m E n v . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R o c k s M u t a b l e O b j e c t . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / R o c k s O b j e c t . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / S k i p L i s t M e m T a b l e C o n f i g . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / S l i c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / S n a p s h o t . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / S s t F i l e W r i t e r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / S t a t i s t i c s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / S t a t s L e v e l . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / S t a t u s . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / S t r i n g A p p e n d O p e r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / T a b l e F o r m a t C o n f i g . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / T i c k e r T y p e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / T r a n s a c t i o n L o g I t e r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / T t l D B . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / u t i l / E n v i r o n m e n t . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / V e c t o r M e m T a b l e C o n f i g . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / W A L R e c o v e r y M o d e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / W B W I R o c k s I t e r a t o r . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / W r i t e B a t c h . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / W r i t e B a t c h I n t e r f a c e . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / W r i t e B a t c h W i t h I n d e x . j a v a
s r c / m a i n / j a v a / o r g / r o c k s d b / W r i t e O p t i o n s . j a v a
s r c / t e s t / j a v a / o r g / r o c k s d b / B a c k u p E n g i n e T e s t . j a v a
s r c / t e s t / j a v a / o r g / r o c k s d b / I n g e s t E x t e r n a l F i l e O p t i o n s T e s t . j a v a
s r c / t e s t / j a v a / o r g / r o c k s d b / P l a t f o r m R a n d o m H e l p e r . j a v a
s r c / t e s t / j a v a / o r g / r o c k s d b / R o c k s D B E x c e p t i o n T e s t . j a v a
s r c / t e s t / j a v a / o r g / r o c k s d b / R o c k s M e m o r y R e s o u r c e . j a v a
s r c / t e s t / j a v a / o r g / r o c k s d b / S n a p s h o t T e s t . j a v a
s r c / t e s t / j a v a / o r g / r o c k s d b / W r i t e B a t c h T e s t . j a v a
I N C L U D E _ J A R S $ { J A V A _ T E S T C L A S S P A T H }
)
if ( NOT EXISTS ${ PROJECT_SOURCE_DIR } /java/classes )
if ( NOT EXISTS ${ PROJECT_SOURCE_DIR } /java/classes )
file ( MAKE_DIRECTORY ${ PROJECT_SOURCE_DIR } /java/classes )
file ( MAKE_DIRECTORY ${ PROJECT_SOURCE_DIR } /java/classes )
@ -195,16 +309,35 @@ if(NOT EXISTS ${JAVA_ASSERTJ_JAR})
file ( RENAME ${ JAVA_TMP_JAR } ${ JAVA_ASSERTJ_JAR } )
file ( RENAME ${ JAVA_TMP_JAR } ${ JAVA_ASSERTJ_JAR } )
endif ( )
endif ( )
if ( WIN32 )
set ( JNI_OUTPUT_DIR ${ PROJECT_SOURCE_DIR } /java/include )
set ( JAVAC cmd /c javac )
set ( JAVAH cmd /c javah )
file ( MAKE_DIRECTORY ${ JNI_OUTPUT_DIR } )
else ( )
create_javah (
set ( JAVAC javac )
T A R G E T r o c k s d b j n i _ h e a d e r s
set ( JAVAH javah )
C L A S S E S $ { N A T I V E _ J A V A _ C L A S S E S }
C L A S S P A T H r o c k s d b j n i _ c l a s s e s $ { J A V A _ T E S T C L A S S P A T H }
O U T P U T _ D I R $ { J N I _ O U T P U T _ D I R }
)
if ( NOT MSVC )
set_property ( TARGET ${ ROCKSDB_STATIC_LIB } PROPERTY POSITION_INDEPENDENT_CODE ON )
endif ( )
endif ( )
execute_process ( COMMAND ${ JAVAC } ${ JAVAC_ARGS } -cp ${ JAVA_TESTCLASSPATH } -d ${ PROJECT_SOURCE_DIR } /java/classes ${ PROJECT_SOURCE_DIR } /java/src/main/java/org/rocksdb/util/*.java ${ PROJECT_SOURCE_DIR } /java/src/main/java/org/rocksdb/*.java ${ PROJECT_SOURCE_DIR } /java/src/test/java/org/rocksdb/*.java )
set ( ROCKSDBJNI_STATIC_LIB rocksdbjni ${ ARTIFACT_SUFFIX } )
execute_process ( COMMAND ${ JAVAH } -cp ${ PROJECT_SOURCE_DIR } /java/classes -d ${ PROJECT_SOURCE_DIR } /java/include -jni ${ NATIVE_JAVA_CLASSES } )
add_library ( ${ ROCKSDBJNI_STATIC_LIB } ${ JNI_NATIVE_SOURCES } )
add_library ( rocksdbjni ${ ARTIFACT_SUFFIX } SHARED ${ JNI_NATIVE_SOURCES } )
add_dependencies ( ${ ROCKSDBJNI_STATIC_LIB } rocksdbjni_headers )
set_target_properties ( rocksdbjni ${ ARTIFACT_SUFFIX } PROPERTIES COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/rocksdbjni${ARTIFACT_SUFFIX}.pdb" )
target_link_libraries ( ${ ROCKSDBJNI_STATIC_LIB } ${ ROCKSDB_STATIC_LIB } ${ LIBS } )
target_link_libraries ( rocksdbjni ${ ARTIFACT_SUFFIX } rocksdb ${ ARTIFACT_SUFFIX } ${ LIBS } )
if ( NOT MINGW )
set ( ROCKSDBJNI_SHARED_LIB rocksdbjni-shared ${ ARTIFACT_SUFFIX } )
add_library ( ${ ROCKSDBJNI_SHARED_LIB } SHARED ${ JNI_NATIVE_SOURCES } )
add_dependencies ( ${ ROCKSDBJNI_SHARED_LIB } rocksdbjni_headers )
target_link_libraries ( ${ ROCKSDBJNI_SHARED_LIB } ${ ROCKSDB_STATIC_LIB } ${ LIBS } )
set_target_properties (
$ { R O C K S D B J N I _ S H A R E D _ L I B }
P R O P E R T I E S
C O M P I L E _ P D B _ O U T P U T _ D I R E C T O R Y $ { C M A K E _ C F G _ I N T D I R }
C O M P I L E _ P D B _ N A M E $ { R O C K S D B J N I _ S T A T I C _ L I B } . p d b
)
endif ( )