Skip to content

Commit

Permalink
[Cmake]Fix undefined symbol for std::filesystem under GCC8 + Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelius84 authored and jzhang533 committed Jul 23, 2024
1 parent 7054fa1 commit 6d921f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ PROJECT(paddle2onnx C CXX)
set(CMAKE_CXX_STANDARD 17)
# Build the libraries with -fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Always link with libstdc++fs.a when using GCC 8. See https://discourse.cmake.org/t/correct-way-to-link-std-filesystem-with-gcc-8/4121/5 for detail.
link_libraries( "$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:-lstdc++fs>" )

option(WITH_STATIC "Compile Paddle2ONNX with STATIC" OFF)
option(PADDLE2ONNX_DEBUG "If open the debug log while converting model" OFF)
Expand Down

0 comments on commit 6d921f6

Please sign in to comment.