From 910ebd91ccc53187885578a3d5f52198d761e683 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 23 Apr 2020 01:12:45 +0200 Subject: [PATCH] cmake: Link to stdc++fs on GNU compatible and Clang --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86d2b62d..6bdd8e3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,7 +495,17 @@ if(WIN32) ) list(APPEND PROJECT_PRIVATE_SOURCE "source/windll.cpp" - ) + ) +endif() +if((CMAKE_C_COMPILER_ID STREQUAL "GNU") + OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + OR (CMAKE_C_COMPILER_ID STREQUAL "Clang") + OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + list(APPEND PROJECT_LIBRARIES + "stdc++fs" + ) + endif() endif() ## OBS Studio - Frontend/Qt