Skip to content

Commit 2412ad0

Browse files
committed
tests: avoid warning about unknown compiler for compilers missing C++17
1 parent 3797097 commit 2412ad0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ if(Boost_FOUND)
256256
endif()
257257

258258
# Check if we need to add -lstdc++fs or -lc++fs or nothing
259-
if(MSVC)
259+
if(DEFINED CMAKE_CXX_STANDARD AND CMAKE_CXX_STANDARD LESS 17)
260+
set(STD_FS_NO_LIB_NEEDED TRUE)
261+
elseif(MSVC)
260262
set(STD_FS_NO_LIB_NEEDED TRUE)
261263
else()
262264
file(
@@ -286,7 +288,7 @@ elseif(${STD_FS_NEEDS_CXXFS})
286288
elseif(${STD_FS_NO_LIB_NEEDED})
287289
set(STD_FS_LIB "")
288290
else()
289-
message(WARNING "Unknown compiler - not passing -lstdc++fs")
291+
message(WARNING "Unknown C++17 compiler - not passing -lstdc++fs")
290292
set(STD_FS_LIB "")
291293
endif()
292294

0 commit comments

Comments
 (0)