Skip to content

Commit

Permalink
#5375: GCC9 doesn't require linking against libstdc++fs anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Oct 31, 2020
1 parent bc2610c commit 8a8f99c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,17 @@ then
FILESYSTEM_LIBS="$(BOOST_FILESYSTEM_LIBS) $(BOOST_SYSTEM_LIBS)"
else
AC_MSG_NOTICE([Will use std::filesystem instead of boost.filesystem])
FILESYSTEM_LIBS="-lstdc++fs"

# GCC9 removed the need to link against libstdc++fs, so check if this library is required
AC_LINK_IFELSE([
AC_LANG_SOURCE(
[[
#include <filesystem>
int main() { std::filesystem::path p; return 0; }
]]
)],
[FILESYSTEM_LIBS=""],
[FILESYSTEM_LIBS="-lstdc++fs"])
fi

AC_SUBST([FILESYSTEM_LIBS])
Expand Down

0 comments on commit 8a8f99c

Please sign in to comment.