From 11b410dcfe91ff083e9856629eb03017a9015d79 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 28 Sep 2020 22:36:13 +0300 Subject: [PATCH] mdbx-cmake: fix `stdc++fs` linking for modern GCC/CLANG. Change-Id: I3dc82d09594cb32a14f2ee6673badcf4f4e411eb --- cmake/compiler.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index 3b561d3d..ab72b897 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -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()