[libcxx-commits] [PATCH] D84759: [libunwind] Provide a way to set '_LIBUNWIND_IS_BAREMETAL' through cmake.

Hafiz Abid Qadeer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 28 08:00:49 PDT 2020


abidh created this revision.
abidh added reviewers: phosek, compnerd, mstorsjo.
Herald added subscribers: libcxx-commits, llvm-commits, mgorny.
Herald added projects: LLVM, libunwind.
Herald added a reviewer: libunwind.
abidh requested review of this revision.

Libunwind uses _LIBUNWIND_IS_BAREMETAL in a lot of places but there is no cmake variable to set it. This patch adds such a variable. It is quite like what LIBCXXABI_BAREMETAL does in libcxxabi.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84759

Files:
  libunwind/CMakeLists.txt


Index: libunwind/CMakeLists.txt
===================================================================
--- libunwind/CMakeLists.txt
+++ libunwind/CMakeLists.txt
@@ -137,6 +137,7 @@
 option(LIBUNWIND_WEAK_PTHREAD_LIB "Use weak references to refer to pthread functions." OFF)
 option(LIBUNWIND_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
 option(LIBUNWIND_INCLUDE_DOCS "Build the libunwind documentation." ${LLVM_INCLUDE_DOCS})
+option(LIBUNWIND_IS_BAREMETAL "Build libunwind for baremetal targets." OFF)
 
 set(LIBUNWIND_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
     "Define suffix of library directory name (32/64)")
@@ -361,6 +362,10 @@
   add_compile_flags(-D__ARM_WMMX)
 endif()
 
+if (LIBUNWIND_IS_BAREMETAL)
+  add_compile_flags(-D_LIBUNWIND_IS_BAREMETAL)
+endif()
+
 # This is the _ONLY_ place where add_definitions is called.
 if (MSVC)
   add_definitions(-D_CRT_SECURE_NO_WARNINGS)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84759.281230.patch
Type: text/x-patch
Size: 910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200728/80a02962/attachment-0001.bin>


More information about the libcxx-commits mailing list