diff --git a/src/ice_transport.cpp b/src/ice_transport.cpp
index 16e9fb7fe52db88966e3f58a20938e718e93a357..e69a4efeb6b36d3d196f01c7835590039a33ab6c 100644
--- a/src/ice_transport.cpp
+++ b/src/ice_transport.cpp
@@ -23,6 +23,9 @@
 #include "transport/peer_channel.h"
 #include "tracepoint/tracepoint.h"
 
+#if __has_include(<fmt/std.h>)
+#include <fmt/std.h>
+#endif
 #include <opendht/logger.h>
 #include <opendht/utils.h>