summaryrefslogtreecommitdiff
path: root/runtimes
diff options
context:
space:
mode:
authorMichael Jones <michaelrj@google.com>2024-10-21 15:04:06 -0700
committerGitHub <noreply@github.com>2024-10-21 15:04:06 -0700
commit6c4267fb1779bc5550bb413f33250f9365acfbc6 (patch)
tree5f8f9457b52ca1c69e7f69a6bc813a500cda0ee6 /runtimes
parent9b7be3ebe5c15ff43cfb5232a572289a83f20294 (diff)
[libcxx][libc] Hand in Hand PoC with from_chars (#91651)
Implements std::from_chars for float and double. The implementation uses LLVM-libc to do the real parsing. Since this is the first time libc++ uses LLVM-libc there is a bit of additional infrastructure code. The patch is based on the [RFC] Project Hand In Hand (LLVM-libc/libc++ code sharing) https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701
Diffstat (limited to 'runtimes')
-rw-r--r--runtimes/cmake/Modules/FindLibcCommonUtils.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtimes/cmake/Modules/FindLibcCommonUtils.cmake b/runtimes/cmake/Modules/FindLibcCommonUtils.cmake
new file mode 100644
index 000000000000..763dc81d8bd7
--- /dev/null
+++ b/runtimes/cmake/Modules/FindLibcCommonUtils.cmake
@@ -0,0 +1,14 @@
+#===--------------------------------------------------------------------===//
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for details.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===--------------------------------------------------------------------===//
+
+add_library(llvm-libc-common-utilities INTERFACE)
+# TODO: Reorganize the libc shared section so that it can be included without
+# adding the root "libc" directory to the include path.
+target_include_directories(llvm-libc-common-utilities INTERFACE ${CMAKE_CURRENT_LIST_DIR}/../../../libc)
+target_compile_definitions(llvm-libc-common-utilities INTERFACE LIBC_NAMESPACE=__llvm_libc_common_utils)
+target_compile_features(llvm-libc-common-utilities INTERFACE cxx_std_17)