Skip to content

Commit d8db9ae

Browse files
committed
split ARM detection into ARM32 and ARM64 (#512)
1 parent 3dc1a95 commit d8db9ae

12 files changed

Lines changed: 39 additions & 32 deletions

File tree

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,20 @@ if(HAVE_X86)
9999
endif()
100100

101101
check_c_source_compiles(
102-
"#if !defined(__arm__) && !defined(__aarch64__) \
103-
&& !defined(_M_ARM) && !defined(_M_ARM64)
104-
#error not ARM
102+
"#if !defined(__arm__) && !defined(_M_ARM)
103+
#error not 32-bit ARM
105104
#endif
106105
int main(){return 0;}"
107-
HAVE_ARM)
106+
HAVE_ARM32)
108107

109-
if(HAVE_ARM)
108+
check_c_source_compiles(
109+
"#if !defined(__aarch64__) && !defined(_M_ARM64)
110+
#error not 64-bit ARM
111+
#endif
112+
int main(){return 0;}"
113+
HAVE_ARM64)
114+
115+
if(HAVE_ARM32)
110116
enable_language(ASM)
111117
check_c_compiler_flag(-mfpu=neon HAVE_NEON)
112118
endif()

cmake/config.h.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
#cmakedefine HAVE_MALLOC_H 1
44
#cmakedefine HAVE_POSIX_MEMALIGN 1
55
#cmakedefine HAVE_SSE4_1 1
6-
#cmakedefine HAVE_ARM 1
6+
#cmakedefine HAVE_ARM32 1
7+
#cmakedefine HAVE_ARM64 1
78
#cmakedefine HAVE_NEON 1

libde265/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ if(HAVE_X86)
100100
endif()
101101
endif()
102102

103-
if(HAVE_ARM)
104-
add_subdirectory (arm)
103+
if(HAVE_ARM32)
104+
add_subdirectory (arm32)
105105
endif()
106106

107-
add_library(de265 ${libde265_sources} ${libde265_public_headers} ${ENCODER_OBJECTS} ${X86_OBJECTS} ${ARM_OBJECTS})
107+
add_library(de265 ${libde265_sources} ${libde265_public_headers} ${ENCODER_OBJECTS} ${X86_OBJECTS} ${ARM32_OBJECTS})
108108
target_include_directories(de265 PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
109109

110110
write_basic_package_version_file(libde265-config-version.cmake COMPATIBILITY ExactVersion)

libde265/arm/CMakeLists.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

libde265/arm32/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
add_library(arm32 OBJECT arm.cc arm.h)
2+
3+
if(HAVE_NEON)
4+
add_library(arm32_neon OBJECT
5+
cpudetect.S
6+
hevcdsp_qpel_neon.S
7+
)
8+
9+
target_compile_options(arm32_neon PRIVATE
10+
-mfpu=neon
11+
-DHAVE_NEON
12+
-DEXTERN_ASM=
13+
-DHAVE_AS_FUNC
14+
-DHAVE_SECTION_DATA_REL_RO
15+
)
16+
17+
set(ARM32_OBJECTS $<TARGET_OBJECTS:arm32> $<TARGET_OBJECTS:arm32_neon> PARENT_SCOPE)
18+
else()
19+
set(ARM32_OBJECTS $<TARGET_OBJECTS:arm32> PARENT_SCOPE)
20+
endif()
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)