vcpkg/ports/pdal/fix-gcc8-compatibility.patch
Lily Wang c581ba650b
[pdal] Fix gcc-8 compatibility (#27163)
* [pdal] Fix gcc8 compatibility

* x-add-version
2022-10-18 18:20:40 -07:00

16 lines
547 B
Diff

diff --git a/pdal/util/CMakeLists.txt b/pdal/util/CMakeLists.txt
index 5b48ba8..e031e2b 100644
--- a/pdal/util/CMakeLists.txt
+++ b/pdal/util/CMakeLists.txt
@@ -46,3 +46,10 @@ set_target_properties(${PDAL_UTIL_LIB_NAME} PROPERTIES
CLEAN_DIRECT_OUTPUT 1)
set_property(GLOBAL PROPERTY _UTIL_INCLUDED TRUE)
+
+# Compatibility for GCC8: std::filesystem requires linking with libstdc++fs
+target_link_libraries(
+ ${PDAL_UTIL_LIB_NAME}
+ PRIVATE
+ "$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:-lstdc++fs>"
+)