Use custom memcpy only for AArch64

This commit is contained in:
Alexey Milovidov 2021-03-13 22:39:10 +03:00
parent a446612e8a
commit 37cc2fe977
2 changed files with 11 additions and 6 deletions

View File

@ -1,5 +1,8 @@
if (GLIBC_COMPATIBILITY)
add_subdirectory(memcpy)
if(TARGET memcpy)
set(MEMCPY_LIBRARY memcpy)
endif()
enable_language(ASM)
include(CheckIncludeFile)
@ -44,10 +47,10 @@ if (GLIBC_COMPATIBILITY)
target_compile_options(glibc-compatibility PRIVATE -fPIC)
endif ()
target_link_libraries(global-libs INTERFACE glibc-compatibility memcpy)
target_link_libraries(global-libs INTERFACE glibc-compatibility ${MEMCPY_LIBRARY})
install(
TARGETS glibc-compatibility memcpy
TARGETS glibc-compatibility ${MEMCPY_LIBRARY}
EXPORT global
ARCHIVE DESTINATION lib
)

View File

@ -1,6 +1,8 @@
add_library(memcpy STATIC memcpy.cpp)
if (ARCH_AMD64)
add_library(memcpy STATIC memcpy.cpp)
# We allow to include memcpy.h from user code for better inlining.
target_include_directories(memcpy PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
# We allow to include memcpy.h from user code for better inlining.
target_include_directories(memcpy PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_compile_options(memcpy PRIVATE -fno-builtin-memcpy)
target_compile_options(memcpy PRIVATE -fno-builtin-memcpy)
endif ()