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()