From f32fb6375654c7c9efcc247d38b43ba10e5f7118 Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Sat, 23 Oct 2021 11:27:56 +0200 Subject: [PATCH] When using GCC 8, explicitely link stdc++fs --- cmake/SfizzDeps.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/SfizzDeps.cmake b/cmake/SfizzDeps.cmake index ea277a40..85c9dbae 100644 --- a/cmake/SfizzDeps.cmake +++ b/cmake/SfizzDeps.cmake @@ -246,6 +246,12 @@ else() file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/fs_std_impl.cpp" "#include ") add_library(sfizz_filesystem_impl STATIC "${CMAKE_CURRENT_BINARY_DIR}/fs_std_impl.cpp") target_include_directories(sfizz_filesystem_impl PUBLIC "external/filesystem/include") + # Add the needed linker option for GCC 8 + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" + AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0 + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + target_link_libraries(sfizz_filesystem_impl PUBLIC stdc++fs) + endif() # add_library(sfizz_filesystem INTERFACE) target_compile_definitions(sfizz_filesystem INTERFACE "GHC_FILESYSTEM_FWD")