[libc-commits] [libc] [libc] Use global preprocessor definitions for libc tuning (PR #71938)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Fri Nov 10 05:22:19 PST 2023


https://github.com/gchatelet created https://github.com/llvm/llvm-project/pull/71938

None

>From 5901c3df1d1d8eb1c9605b2165b6017a7d9e81b7 Mon Sep 17 00:00:00 2001
From: Guillaume Chatelet <gchatelet at google.com>
Date: Fri, 10 Nov 2023 13:21:13 +0000
Subject: [PATCH] [libc] use global preprocessor definitions for libc tuning

---
 libc/src/string/CMakeLists.txt | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt
index 6daaf1998ea7bc2..dd1bdffa9d0a37f 100644
--- a/libc/src/string/CMakeLists.txt
+++ b/libc/src/string/CMakeLists.txt
@@ -1,13 +1,10 @@
 add_subdirectory(memory_utils)
 
 if(LIBC_CONF_STRING_UNSAFE_WIDE_READ)
-  list(APPEND string_config_options "-DLIBC_COPT_STRING_UNSAFE_WIDE_READ")
+  add_compile_definitions("-DLIBC_COPT_STRING_UNSAFE_WIDE_READ")
 endif()
 if(LIBC_CONF_MEMSET_X86_USE_SOFTWARE_PREFETCHING)
-  list(APPEND string_config_options "-DLIBC_COPT_MEMSET_X86_USE_SOFTWARE_PREFETCHING")
-endif()
-if(string_config_options)
-  list(PREPEND string_config_options "COMPILE_OPTIONS")
+  add_compile_definitions("-DLIBC_COPT_MEMSET_X86_USE_SOFTWARE_PREFETCHING")
 endif()
 
 add_header_library(
@@ -20,7 +17,6 @@ add_header_library(
     libc.include.stdlib
     libc.src.__support.common
     libc.src.__support.CPP.bitset
-  ${string_config_options}
 )
 
 add_header_library(



More information about the libc-commits mailing list