Skip to content

Commit 6ab6577

Browse files
authored
Fix build for GCC 8.x (dmlc#9670)
1 parent 8c57558 commit 6ab6577

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ endif (RABIT_BUILD_MPI)
233233
add_subdirectory(${xgboost_SOURCE_DIR}/src)
234234
target_link_libraries(objxgboost PUBLIC dmlc)
235235

236+
# Link -lstdc++fs for GCC 8.x
237+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
238+
target_link_libraries(objxgboost PUBLIC stdc++fs)
239+
endif()
240+
236241
# Exports some R specific definitions and objects
237242
if (R_LIB)
238243
add_subdirectory(${xgboost_SOURCE_DIR}/R-package)

0 commit comments

Comments
 (0)