From ef10c23842780d55e36b5838987a9987ed73e804 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 28 Aug 2025 15:23:19 +0200 Subject: [PATCH] -lstdc++fs on gcc < 9 --- cmake/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 503a5cc9be..fd08532b0b 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1038,8 +1038,15 @@ endforeach() set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES}) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + message(STATUS "GCC < 9 detected, linking stdc++fs explicitly") + set(STDCPPFS stdc++fs) + endif() +endif() + add_library(IfcParse ${IFCPARSE_FILES}) -target_link_libraries(IfcParse ${ROCKSDB_LIBRARY} ${RPCRT_LIBRARIES}) +target_link_libraries(IfcParse ${ROCKSDB_LIBRARY} ${RPCRT_LIBRARIES} ${STDCPPFS}) set_target_properties(IfcParse PROPERTIES COMPILE_FLAGS -DIFC_PARSE_EXPORTS VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") if(WASM_BUILD)