@ -53,6 +53,14 @@ int main() { return 0; }
" H A V E _ C L A N G _ T H R E A D _ S A F E T Y )
set ( CMAKE_REQUIRED_FLAGS ${ OLD_CMAKE_REQUIRED_FLAGS } )
# T e s t w h e t h e r C + + 1 7 _ _ h a s _ i n c l u d e i s a v a i l a b l e .
check_cxx_source_compiles ( "
# i f defined ( __has_include ) & & __has_include ( <string> )
# i n c l u d e < s t r i n g >
# e n d i f
i n t main ( ) { s t d : : s t r i n g s t r ; r e t u r n 0 ; }
" H A V E _ C X X 1 7 _ H A S _ I N C L U D E )
set ( LEVELDB_PUBLIC_INCLUDE_DIR "include/leveldb" )
set ( LEVELDB_PORT_CONFIG_DIR "include/port" )
@ -85,6 +93,12 @@ target_sources(leveldb_port_posix
$ < 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 )
@ -199,6 +213,13 @@ target_compile_definitions(leveldb
# U s e d b y p o r t / p o r t . h .
L E V E L D B _ P L A T F O R M _ P O S I X = 1
)
if ( NOT HAVE_CXX17_HAS_INCLUDE )
target_compile_definitions ( leveldb
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 )
target_compile_definitions ( leveldb
P U B L I C
@ -263,6 +284,12 @@ if(LEVELDB_BUILD_TESTS)
P R I V A T E
L E V E L D B _ P L A T F O R M _ P O S I X = 1
)
if ( NOT HAVE_CXX17_HAS_INCLUDE )
target_compile_definitions ( "${test_target_name}"
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 )
add_test ( NAME "${test_target_name}" COMMAND "${test_target_name}" )
endfunction ( leveldb_test )
@ -336,6 +363,12 @@ if(LEVELDB_BUILD_BENCHMARKS)
P R I V A T E
L E V E L D B _ P L A T F O R M _ P O S I X = 1
)
if ( NOT HAVE_CXX17_HAS_INCLUDE )
target_compile_definitions ( "${bench_target_name}"
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 )
endfunction ( leveldb_benchmark )
if ( NOT BUILD_SHARED_LIBS )