Skip to content

Commit 2e34ce6

Browse files
committed
fable: Fix segfault in GCC 8
1 parent 43b4f34 commit 2e34ce6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

fable/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ target_link_libraries(fable
5252
PUBLIC
5353
fmt::fmt
5454
nlohmann_json::nlohmann_json
55+
stdc++fs
5556
)
5657

5758
option(FABLE_ALLOW_COMMENTS "Allow comments when parsing JSON?" ON)

fable/conanfile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ def package_info(self):
9393
self.cpp_info.set_property("cmake_file_name", "fable")
9494
self.cpp_info.set_property("cmake_target_name", "fable::fable")
9595
self.cpp_info.set_property("pkg_config_name", "fable")
96+
97+
# Linking to libstdc++fs is required on GCC < 9.
98+
# (GCC compilers with version < 7 have no std::filesystem support.)
99+
# No consideration has been made yet for other compilers,
100+
# please add them here as necessary.
101+
if self.settings.get_safe("compiler") == "gcc" and self.settings.get_safe("compiler.version") in ["7", "8"]:
102+
self.cpp_info.system_libs = ["stdc++fs"]
103+
96104
if not self.in_local_cache:
97105
self.cpp_info.libs = ["fable"]
98106
self.cpp_info.includedirs.append(os.path.join(self.build_folder, "include"))

0 commit comments

Comments
 (0)