diff --git a/src/openrct2/CMakeLists.txt b/src/openrct2/CMakeLists.txt index 97674911c0..2775d542d7 100644 --- a/src/openrct2/CMakeLists.txt +++ b/src/openrct2/CMakeLists.txt @@ -17,6 +17,11 @@ add_library(${PROJECT_NAME} ${OPENRCT2_CORE_SOURCES} ${OPENRCT2_CORE_MM_SOURCES} set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") SET_CHECK_CXX_FLAGS(${PROJECT_NAME}) +# GCC likes us to pass the -lstdc++fs flag to link C++17 filesystem implementation. +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT MINGW) + target_link_libraries(${PROJECT_NAME} stdc++fs) +endif() + if (NOT DISABLE_NETWORK OR NOT DISABLE_HTTP) if (APPLE) # Needed for linking with non-broken OpenSSL on Apple platforms