mdbx-cmake: fix stdc++fs linking for modern GCC/CLANG.

Change-Id: I3dc82d09594cb32a14f2ee6673badcf4f4e411eb
This commit is contained in:
Leonid Yuriev 2020-09-28 22:36:13 +03:00
parent 5374d06d92
commit 11b410dcfe

View File

@ -772,14 +772,14 @@ endmacro(setup_compile_flags)
if(CMAKE_CXX_COMPILER_LOADED)
# determine library for for std::filesystem
set(LIBCXX_FILESYSTEM "")
if(CMAKE_COMPILER_IS_GNUCXX)
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.3 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
set(LIBCXX_FILESYSTEM "stdc++fs")
endif()
elseif(CMAKE_COMPILER_IS_CLANG)
if(CMAKE_COMPILER_IS_CLANG)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set(LIBCXX_FILESYSTEM "c++experimental")
else()
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
set(LIBCXX_FILESYSTEM "stdc++fs")
endif()
elseif(CMAKE_COMPILER_IS_GNUCXX)
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.3 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
set(LIBCXX_FILESYSTEM "stdc++fs")
endif()
endif()