@ -79,33 +79,10 @@ if(BUILD_SHARED_LIBS)
add_compile_options ( -fvisibility=hidden )
endif ( BUILD_SHARED_LIBS )
# P O S I X c o d e i s s p e c i f i e d s e p a r a t e l y s o w e c a n l e a v e i t o u t i n t h e f u t u r e .
add_library ( leveldb_port_posix OBJECT "" )
target_sources ( leveldb_port_posix
P R I V A T E
" $ { P R O J E C T _ S O U R C E _ D I R } / p o r t / p o r t _ p o s i x . c c "
P U B L I C
# T h e h e a d e r s b e l o w a r e d e p e n d e n c i e s f o r l e v e l d b , b u t a r e n ' t n e e d e d b y u s e r s
# t h a t l i n k t o t h e i n s t a l l e d v e r s i o n o f l e v e l d b a n d r e l y o n i t s p u b l i c A P I .
$ < B U I L D _ I N T E R F A C E : $ { P R O J E C T _ B I N A R Y _ D I R } / $ { L E V E L D B _ P O R T _ C O N F I G _ D I R } / p o r t _ c o n f i g . h >
$ < B U I L D _ I N T E R F A C E : $ { P R O J E C T _ S O U R C E _ D I R } / p o r t / a t o m i c _ p o i n t e r . h >
$ < B U I L D _ I N T E R F A C E : $ { P R O J E C T _ S O U R C E _ D I R } / p o r t / p o r t _ p o s i x . h >
$ < B U I L D _ I N T E R F A C E : $ { P R O J E C T _ S O U R C E _ D I R } / p o r t / p o r t . h >
)
if ( NOT HAVE_CXX17_HAS_INCLUDE )
target_compile_definitions ( leveldb_port_posix
P R I V A T E
L E V E L D B _ H A S _ P O R T _ C O N F I G _ H = 1
)
endif ( NOT HAVE_CXX17_HAS_INCLUDE )
if ( BUILD_SHARED_LIBS )
set_property ( TARGET leveldb_port_posix PROPERTY POSITION_INDEPENDENT_CODE ON )
endif ( BUILD_SHARED_LIBS )
add_library ( leveldb "" )
target_sources ( leveldb
P R I V A T E
" $ { P R O J E C T _ B I N A R Y _ D I R } / $ { L E V E L D B _ P O R T _ C O N F I G _ D I R } / p o r t _ c o n f i g . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / d b / b u i l d e r . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / d b / b u i l d e r . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / d b / c . c c "
@ -136,6 +113,8 @@ target_sources(leveldb
" $ { P R O J E C T _ S O U R C E _ D I R } / d b / v e r s i o n _ s e t . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / d b / w r i t e _ b a t c h _ i n t e r n a l . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / d b / w r i t e _ b a t c h . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / p o r t / a t o m i c _ p o i n t e r . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / p o r t / p o r t _ s t d c x x . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / p o r t / p o r t . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / p o r t / t h r e a d _ a n n o t a t i o n s . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / t a b l e / b l o c k _ b u i l d e r . c c "
@ -163,7 +142,6 @@ target_sources(leveldb
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / c o m p a r a t o r . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / c r c 3 2 c . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / c r c 3 2 c . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / e n v _ p o s i x . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / e n v . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / f i l t e r _ p o l i c y . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / h a s h . c c "
@ -172,10 +150,8 @@ target_sources(leveldb
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / l o g g i n g . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / m u t e x l o c k . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / o p t i o n s . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / p o s i x _ l o g g e r . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / r a n d o m . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / s t a t u s . c c "
$ < T A R G E T _ O B J E C T S : l e v e l d b _ p o r t _ p o s i x >
# O n l y C M a k e 3 . 3 + s u p p o r t s P U B L I C s o u r c e s i n t a r g e t s e x p o r t e d b y " i n s t a l l " .
$ < $ < V E R S I O N _ G R E A T E R : C M A K E _ V E R S I O N , 3 . 2 > : P U B L I C >
@ -195,12 +171,21 @@ target_sources(leveldb
" $ { L E V E L D B _ P U B L I C _ I N C L U D E _ D I R } / t a b l e . h "
" $ { L E V E L D B _ P U B L I C _ I N C L U D E _ D I R } / w r i t e _ b a t c h . h "
)
# P O S I X c o d e i s s p e c i f i e d s e p a r a t e l y s o w e c a n l e a v e i t o u t i n t h e f u t u r e .
target_sources ( leveldb
P R I V A T E
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / e n v _ p o s i x . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / u t i l / p o s i x _ l o g g e r . h "
)
# M e m E n v i s n o t p a r t o f t h e i n t e r f a c e a n d c o u l d b e p u l l e d t o a s e p a r a t e l i b r a r y .
target_sources ( leveldb
P R I V A T E
" $ { P R O J E C T _ S O U R C E _ D I R } / h e l p e r s / m e m e n v / m e m e n v . c c "
" $ { P R O J E C T _ S O U R C E _ D I R } / h e l p e r s / m e m e n v / m e m e n v . h "
)
target_include_directories ( leveldb
P U B L I C
$ < B U I L D _ I N T E R F A C E : $ { P R O J E C T _ S O U R C E _ D I R } / i n c l u d e >
@ -234,11 +219,6 @@ if(HAVE_CLANG_THREAD_SAFETY)
- W e r r o r - W t h r e a d - s a f e t y )
endif ( HAVE_CLANG_THREAD_SAFETY )
# TODO ( costan ) : T h i s i s o n l y n e e d e d f o r p o r t _ p o s i x .
set ( THREADS_PREFER_PTHREAD_FLAG ON )
find_package ( Threads REQUIRED )
target_link_libraries ( leveldb Threads::Threads )
if ( HAVE_CRC32C )
target_link_libraries ( leveldb crc32c )
endif ( HAVE_CRC32C )
@ -249,6 +229,10 @@ if(HAVE_TCMALLOC)
target_link_libraries ( leveldb tcmalloc )
endif ( HAVE_TCMALLOC )
# N e e d e d b y p o r t _ s t d c x x . h
find_package ( Threads REQUIRED )
target_link_libraries ( leveldb Threads::Threads )
add_executable ( leveldbutil
" $ { P R O J E C T _ S O U R C E _ D I R } / d b / l e v e l d b u t i l . c c "
)
@ -271,14 +255,6 @@ if(LEVELDB_BUILD_TESTS)
" $ { t e s t _ f i l e } "
)
if ( BUILD_SHARED_LIBS )
# P o r t f u n c t i o n s a r e n ' t e x p o s e d i n t h e s h a r e d l i b r a r y b u i l d .
target_sources ( "${test_target_name}"
P R I V A T E
$ < T A R G E T _ O B J E C T S : l e v e l d b _ p o r t _ p o s i x >
)
endif ( BUILD_SHARED_LIBS )
target_link_libraries ( "${test_target_name}" leveldb )
target_compile_definitions ( "${test_target_name}"
P R I V A T E
@ -351,14 +327,6 @@ if(LEVELDB_BUILD_BENCHMARKS)
" $ { b e n c h _ f i l e } "
)
if ( BUILD_SHARED_LIBS )
# P o r t f u n c t i o n s a r e n ' t e x p o s e d i n t h e s h a r e d l i b r a r y b u i l d .
target_sources ( "${bench_target_name}"
P R I V A T E
$ < T A R G E T _ O B J E C T S : l e v e l d b _ p o r t _ p o s i x >
)
endif ( BUILD_SHARED_LIBS )
target_link_libraries ( "${bench_target_name}" leveldb )
target_compile_definitions ( "${bench_target_name}"
P R I V A T E