Enable ASM language during CMake configure time only when needed

This commit is contained in:
Radek Zikmund
2025-10-02 14:40:11 +02:00
parent b8d6101fba
commit f94a01de74
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -7,7 +7,7 @@
# in the COPYING file in the root directory of this source tree).
# ################################################################
project(libzstd C ASM)
project(libzstd C) # ASM language is conditionally enabled where supported
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON)
@@ -40,6 +40,7 @@ if (MSVC)
add_compile_options(-DZSTD_DISABLE_ASM)
else ()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|AMD64.*|x86_64.*|X86_64.*" AND ${ZSTD_HAS_NOEXECSTACK})
enable_language(ASM)
set(DecompressSources ${DecompressSources} ${LIBRARY_DIR}/decompress/huf_decompress_amd64.S)
else()
add_compile_options(-DZSTD_DISABLE_ASM)