Skip to content

Commit 6768332

Browse files
hcho3razdoburdin
authored andcommitted
Fix build for GCC 8.x (dmlc#9670)
1 parent 09b1e71 commit 6768332

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
@@ -237,6 +237,11 @@ endif (RABIT_BUILD_MPI)
237237
add_subdirectory(${xgboost_SOURCE_DIR}/src)
238238
target_link_libraries(objxgboost PUBLIC dmlc)
239239

240+
# Link -lstdc++fs for GCC 8.x
241+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
242+
target_link_libraries(objxgboost PUBLIC stdc++fs)
243+
endif()
244+
240245
# Exports some R specific definitions and objects
241246
if (R_LIB)
242247
add_subdirectory(${xgboost_SOURCE_DIR}/R-package)

0 commit comments

Comments
 (0)