From 6fca79ed6d966a01bd2ccc34702ab6536bbfe291 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 25 Nov 2019 23:04:10 +0100 Subject: [PATCH] Add flag for MSVC --- cmake/Modules/FindFILESYSTEM.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/Modules/FindFILESYSTEM.cmake b/cmake/Modules/FindFILESYSTEM.cmake index a670d0fde..6eb6deeec 100644 --- a/cmake/Modules/FindFILESYSTEM.cmake +++ b/cmake/Modules/FindFILESYSTEM.cmake @@ -140,6 +140,9 @@ endif() if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11")) set(CMAKE_REQUIRED_FLAGS "-std=c++17") endif() +if(MSVC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "18")) + set(CMAKE_REQUIRED_FLAGS "/std:c++17") +endif() # Normalize and check the component list we were given set(want_components ${FILESYSTEM_FIND_COMPONENTS})