From 57934e12344aaa0892af22f0fd74835c5a0e9d20 Mon Sep 17 00:00:00 2001
From: Daniel Hornung <d.hornung@indiscale.com>
Date: Mon, 3 Jan 2022 17:27:58 +0100
Subject: [PATCH] FIX: Added linker options for legacy compiler.

---
 CMakeLists.txt | 2 ++
 doc/legacy.rst | 6 ++++++
 2 files changed, 8 insertions(+)
 create mode 100644 doc/legacy.rst

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91cdefa..402aaf8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -168,6 +168,7 @@ else()
 endif()
 target_link_libraries(caosdb
     ${CONAN_LIBS}
+    stdc++fs
 )
 target_include_directories(caosdb PUBLIC
     $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
@@ -182,6 +183,7 @@ add_library(ccaosdb SHARED src/ccaosdb.cpp)
 target_link_libraries(ccaosdb
     ${CONAN_LIBS}
     ${LIBCAOSDB}
+    stdc++fs
 )
 target_include_directories(ccaosdb PUBLIC
     $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
diff --git a/doc/legacy.rst b/doc/legacy.rst
new file mode 100644
index 0000000..485397e
--- /dev/null
+++ b/doc/legacy.rst
@@ -0,0 +1,6 @@
+Legacy code
+===========
+
+- Older GCC compilers (before gcc-9) need explicit linking against libstdc++fs.a.  The related
+  specifications can be removed from the CMakeLists.txt files once no such compilers are expected in
+  the wild anymore.
-- 
GitLab