[PATCH] D87920: [Support] Fix build for Haiku
Serge Pavlov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 27 19:53:28 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5c1cea6f4063: [Support] Fix build for Haiku (authored by sepavloff).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87920/new/
https://reviews.llvm.org/D87920
Files:
llvm/lib/Support/CMakeLists.txt
llvm/lib/Support/Unix/Program.inc
Index: llvm/lib/Support/Unix/Program.inc
===================================================================
--- llvm/lib/Support/Unix/Program.inc
+++ llvm/lib/Support/Unix/Program.inc
@@ -452,8 +452,12 @@
if (ProcStat) {
std::chrono::microseconds UserT = toDuration(Info.ru_utime);
std::chrono::microseconds KernelT = toDuration(Info.ru_stime);
+#ifndef __HAIKU__
uint64_t PeakMemory = static_cast<uint64_t>(Info.ru_maxrss);
*ProcStat = ProcessStatistics{UserT + KernelT, UserT, PeakMemory};
+#else
+ *ProcStat = ProcessStatistics{UserT + KernelT, UserT, 0};
+#endif
}
// Return the proper exit status. Detect error conditions
Index: llvm/lib/Support/CMakeLists.txt
===================================================================
--- llvm/lib/Support/CMakeLists.txt
+++ llvm/lib/Support/CMakeLists.txt
@@ -36,6 +36,10 @@
if( FUCHSIA )
set(system_libs ${system_libs} zircon)
endif()
+ if ( HAIKU )
+ add_definitions(-D_BSD_SOURCE)
+ set(system_libs ${system_libs} bsd)
+ endif()
endif( MSVC OR MINGW )
# Delay load shell32.dll if possible to speed up process startup.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87920.319743.patch
Type: text/x-patch
Size: 1129 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210128/93e01258/attachment.bin>
More information about the llvm-commits
mailing list