mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-29 08:58:48 +08:00
mdbx-cmake: add linking with stdc++fs
for LCC < 1.26
This commit is contained in:
parent
7b95720f59
commit
f054ceeab8
@ -612,8 +612,8 @@ macro(libmdbx_setup_libs TARGET MODE)
|
|||||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
|
||||||
target_link_libraries(${TARGET} ${MODE} log)
|
target_link_libraries(${TARGET} ${MODE} log)
|
||||||
endif()
|
endif()
|
||||||
if(MDBX_CXX_STANDARD GREATER_EQUAL 17 AND LIBCXX_FILESYSTEM AND MDBX_BUILD_CXX)
|
if(LIBCXX_FILESYSTEM AND MDBX_BUILD_CXX)
|
||||||
target_link_libraries(${TARGET} ${MODE} ${LIBCXX_FILESYSTEM})
|
target_link_libraries(${TARGET} PUBLIC ${LIBCXX_FILESYSTEM})
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
@ -823,9 +823,13 @@ macro(setup_compile_flags)
|
|||||||
endmacro(setup_compile_flags)
|
endmacro(setup_compile_flags)
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_LOADED)
|
if(CMAKE_CXX_COMPILER_LOADED)
|
||||||
# determine library for for std::filesystem
|
# determine library for std::filesystem
|
||||||
set(LIBCXX_FILESYSTEM "")
|
set(LIBCXX_FILESYSTEM "")
|
||||||
if(CMAKE_COMPILER_IS_CLANG)
|
if(CMAKE_COMPILER_IS_ELBRUSCXX)
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1.26.0)
|
||||||
|
set(LIBCXX_FILESYSTEM "stdc++fs")
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_COMPILER_IS_CLANG)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||||
set(LIBCXX_FILESYSTEM "c++experimental")
|
set(LIBCXX_FILESYSTEM "c++experimental")
|
||||||
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
|
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
|
||||||
|
@ -45,6 +45,10 @@ set_target_properties(mdbx_test PROPERTIES
|
|||||||
INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>)
|
INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>)
|
||||||
target_setup_options(mdbx_test)
|
target_setup_options(mdbx_test)
|
||||||
|
|
||||||
|
if(NOT MDBX_BUILD_CXX AND LIBCXX_FILESYSTEM)
|
||||||
|
target_link_libraries(mdbx_test ${LIBCXX_FILESYSTEM})
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(mdbx_test ${TOOL_MDBX_LIB} ${LIB_MATH} ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(mdbx_test ${TOOL_MDBX_LIB} ${LIB_MATH} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||||
target_link_libraries(mdbx_test winmm.lib)
|
target_link_libraries(mdbx_test winmm.lib)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user