Skip to content

Commit 7493b82

Browse files
committedOct 6, 2023
[x-compile] Fix cross-compiling for AArch64 with an LLVM / Clang
1 parent 823b32c commit 7493b82

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎build/cmake/lib/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
project(libzstd C ASM)
1111

12+
message(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR: '${CMAKE_SYSTEM_PROCESSOR}'")
1213
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
1314
option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON)
1415
option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" ON)
@@ -42,7 +43,10 @@ if (MSVC)
4243
file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c)
4344
add_compile_options(-DZSTD_DISABLE_ASM)
4445
else ()
45-
file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S)
46+
file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c)
47+
if(CMAKE_SYSTEM_PROCESSOR MATCHES AMD64)
48+
set(DecompressSources ${DecompressSources} ${LIBRARY_DIR}/decompress/huf_decompress_amd64.S)
49+
endif()
4650
endif ()
4751
file(GLOB DictBuilderSources ${LIBRARY_DIR}/dictBuilder/*.c)
4852
file(GLOB DeprecatedSources ${LIBRARY_DIR}/deprecated/*.c)

0 commit comments

Comments
 (0)