-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automatically link to libstdc++-fs when we detect gcc8
No need for a FAQ in this case
- Loading branch information
Showing
3 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# The std::filesystem functions are part of the C++17 standard, but GCC8 | ||
# does not store them in libstdc++ but in libstdc++-fs. This function | ||
# ensure that we link to this additional library when using GCC8 | ||
# from https://discourse.cmake.org/t/correct-way-to-link-std-filesystem-with-gcc-8/4121 | ||
function( set_required_build_settings_for_GCC8 ) | ||
# Always link with libstdc++fs.a when using GCC 8. | ||
# Note: This command makes sure that this option comes pretty late on the cmdline. | ||
link_libraries( "$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:-lstdc++fs>" ) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters