]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Enable ASM language during CMake configure time only when needed 4504/head
authorRadek Zikmund <r.zikmund.rz@gmail.com>
Thu, 2 Oct 2025 12:40:11 +0000 (14:40 +0200)
committerRadek Zikmund <r.zikmund.rz@gmail.com>
Thu, 2 Oct 2025 12:40:11 +0000 (14:40 +0200)
build/cmake/CMakeLists.txt
build/cmake/lib/CMakeLists.txt

index 753cf4a9e481550de2b30bfd41083ffaf4bc09df..7cb0b684378a950bf644b98278ea929083c2315f 100644 (file)
@@ -29,7 +29,7 @@ include(ZstdVersion)
 #-----------------------------------------------------------------------------
 project(zstd
     VERSION "${ZSTD_FULL_VERSION}"
-    LANGUAGES C ASM  # Main library is in C and ASM
+    LANGUAGES C   # Main library is in C and ASM, ASM is enabled conditionally
     HOMEPAGE_URL "${zstd_HOMEPAGE_URL}"
     DESCRIPTION "${zstd_DESCRIPTION}"
 )
index a6b894c4db957de9b0c4b1a86582b312a90606f6..0cd02d6230cabd22d5cb35ea17464c2e39a84758 100644 (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)