diff --git a/interpreter/CppInterOp/lib/CppInterOp/CMakeLists.txt b/interpreter/CppInterOp/lib/CppInterOp/CMakeLists.txt index abdb6d3f9a026..20e17d20052c4 100644 --- a/interpreter/CppInterOp/lib/CppInterOp/CMakeLists.txt +++ b/interpreter/CppInterOp/lib/CppInterOp/CMakeLists.txt @@ -54,8 +54,8 @@ if(NOT WIN32 AND NOT EMSCRIPTEN) list(APPEND link_libs dl) endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) - list(APPEND link_libs stdc++fs) +if(ROOT_NEED_STDCXXFS) + list(APPEND link_libs stdc++fs) endif() # Get rid of libLLVM-X.so which is appended to the list of static libraries.