Skip to content

Commit 1545230

Browse files
aminyaalandefreitas
authored andcommitted
fix: pass filesystem's required flags for osx failures
1 parent 289f757 commit 1545230

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/FindFilesystem.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ set(CMAKE_REQUIRED_QUIET ${Filesystem_FIND_QUIETLY})
128128
# All of our tests required C++17 or later
129129
if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 17)
130130
set(CMAKE_CXX_STANDARD 17)
131+
if (NOT DEFINED CMAKE_REQUIRED_FLAGS)
132+
set(CMAKE_REQUIRED_FLAGS "-std=c++17")
133+
endif()
131134
endif()
132135

133136
# Normalize and check the component list we were given
@@ -154,7 +157,7 @@ if(NOT "Experimental" IN_LIST want_components)
154157
endif()
155158

156159
if(find_final)
157-
check_include_file_cxx("filesystem" _CXX_FILESYSTEM_HAVE_HEADER)
160+
check_include_file_cxx("filesystem" _CXX_FILESYSTEM_HAVE_HEADER CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
158161
mark_as_advanced(_CXX_FILESYSTEM_HAVE_HEADER)
159162
if(_CXX_FILESYSTEM_HAVE_HEADER)
160163
# We found the non-experimental header. Don't bother looking for the

0 commit comments

Comments
 (0)