cmake:bugfix enable ARCH_STRING_FUNCTION CMake build fail

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19 2024-05-20 18:22:31 +08:00 committed by Xiang Xiao
parent 7502c9c334
commit 819685fbec
4 changed files with 59 additions and 17 deletions

View file

@ -18,8 +18,6 @@
# #
# ############################################################################## # ##############################################################################
set(SRCS arch_elf.c)
if(CONFIG_ARCH_TOOLCHAIN_GNU) if(CONFIG_ARCH_TOOLCHAIN_GNU)
set(ARCH_TOOLCHAIN_DIR gnu) set(ARCH_TOOLCHAIN_DIR gnu)
endif() endif()
@ -48,4 +46,8 @@ if(CONFIG_ARMV7A_STRLEN)
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strlen.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strlen.S)
endif() endif()
if(CONFIG_LIBC_ARCH_ELF)
list(APPEND SRCS arch_elf.c)
endif()
target_sources(c PRIVATE ${SRCS}) target_sources(c PRIVATE ${SRCS})

View file

@ -20,28 +20,36 @@
set(SRCS) set(SRCS)
if(CONFIG_ARCH_TOOLCHAIN_GNU)
set(ARCH_TOOLCHAIN_DIR gnu)
endif()
if(CONFIG_ARMV7M_MEMCHR)
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memchr.S)
endif()
if(CONFIG_ARMV7M_MEMCPY) if(CONFIG_ARMV7M_MEMCPY)
list(APPEND SRCS gnu/arch_memcpy.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memcpy.S)
endif() endif()
if(CONFIG_ARMV7M_MEMSET) if(CONFIG_ARMV7M_MEMSET)
list(APPEND SRCS arch_memset.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memset.S)
endif() endif()
if(CONFIG_ARMV7M_MEMMOVE) if(CONFIG_ARMV7M_MEMMOVE)
list(APPEND SRCS arch_memmove.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memmove.S)
endif() endif()
if(CONFIG_ARMV7M_STRCMP) if(CONFIG_ARMV7M_STRCMP)
list(APPEND SRCS arch_strcmp.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strcmp.S)
endif() endif()
if(CONFIG_ARMV7M_STRCPY) if(CONFIG_ARMV7M_STRCPY)
list(APPEND SRCS arch_strcpy.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strcpy.S)
endif() endif()
if(CONFIG_ARMV7M_STRLEN) if(CONFIG_ARMV7M_STRLEN)
list(APPEND SRCS arch_strlen.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strlen.S)
endif() endif()
if(CONFIG_LIBC_ARCH_ELF) if(CONFIG_LIBC_ARCH_ELF)

View file

@ -18,10 +18,38 @@
# #
# ############################################################################## # ##############################################################################
set(SRCS)
if(CONFIG_ARCH_TOOLCHAIN_GNU)
set(ARCH_TOOLCHAIN_DIR gnu)
endif()
if(CONFIG_ARMV7R_MEMCHR)
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memchr.S)
endif()
if(CONFIG_ARMV7R_MEMCPY) if(CONFIG_ARMV7R_MEMCPY)
target_sources(c PRIVATE gnu/arch_memcpy.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memcpy.S)
endif()
if(CONFIG_ARMV7R_MEMSET)
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memset.S)
endif()
if(CONFIG_ARMV7R_MEMMOVE)
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memmove.S)
endif()
if(CONFIG_ARMV7R_STRCMP)
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strcmp.S)
endif()
if(CONFIG_ARMV7R_STRLEN)
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strlen.S)
endif() endif()
if(CONFIG_LIBC_ARCH_ELF) if(CONFIG_LIBC_ARCH_ELF)
target_sources(c PRIVATE arch_elf.c) list(APPEND SRCS arch_elf.c)
endif() endif()
target_sources(c PRIVATE ${SRCS})

View file

@ -20,36 +20,40 @@
set(SRCS) set(SRCS)
if(CONFIG_ARCH_TOOLCHAIN_GNU)
set(ARCH_TOOLCHAIN_DIR gnu)
endif()
if(CONFIG_LIBC_ARCH_ELF) if(CONFIG_LIBC_ARCH_ELF)
list(APPEND SRCS arch_elf.c) list(APPEND SRCS arch_elf.c)
endif() endif()
if(CONFIG_ARMV8M_MEMCHR) if(CONFIG_ARMV8M_MEMCHR)
list(APPEND SRCS arch_memchr.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memchr.S)
endif() endif()
if(CONFIG_ARMV8M_MEMCPY) if(CONFIG_ARMV8M_MEMCPY)
list(APPEND SRCS arch_memcpy.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memcpy.S)
endif() endif()
if(CONFIG_ARMV8M_MEMSET) if(CONFIG_ARMV8M_MEMSET)
list(APPEND SRCS arch_memset.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memset.S)
endif() endif()
if(CONFIG_ARMV8M_MEMMOVE) if(CONFIG_ARMV8M_MEMMOVE)
list(APPEND SRCS arch_memmove.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memmove.S)
endif() endif()
if(CONFIG_ARMV8M_STRCMP) if(CONFIG_ARMV8M_STRCMP)
list(APPEND SRCS arch_strcmp.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strcmp.S)
endif() endif()
if(CONFIG_ARMV8M_STRCPY) if(CONFIG_ARMV8M_STRCPY)
list(APPEND SRCS arch_strcpy.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strcpy.S)
endif() endif()
if(CONFIG_ARMV8M_STRLEN) if(CONFIG_ARMV8M_STRLEN)
list(APPEND SRCS arch_strlen.S) list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strlen.S)
endif() endif()
target_sources(c PRIVATE ${SRCS}) target_sources(c PRIVATE ${SRCS})