Skip to content

Commit f94a01d

Browse files
committed
Enable ASM language during CMake configure time only when needed
1 parent b8d6101 commit f94a01d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build/cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include(ZstdVersion)
2929
#-----------------------------------------------------------------------------
3030
project(zstd
3131
VERSION "${ZSTD_FULL_VERSION}"
32-
LANGUAGES C ASM # Main library is in C and ASM
32+
LANGUAGES C # Main library is in C and ASM, ASM is enabled conditionally
3333
HOMEPAGE_URL "${zstd_HOMEPAGE_URL}"
3434
DESCRIPTION "${zstd_DESCRIPTION}"
3535
)

build/cmake/lib/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# in the COPYING file in the root directory of this source tree).
88
# ################################################################
99

10-
project(libzstd C ASM)
10+
project(libzstd C) # ASM language is conditionally enabled where supported
1111

1212
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
1313
option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON)
@@ -40,6 +40,7 @@ if (MSVC)
4040
add_compile_options(-DZSTD_DISABLE_ASM)
4141
else ()
4242
if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|AMD64.*|x86_64.*|X86_64.*" AND ${ZSTD_HAS_NOEXECSTACK})
43+
enable_language(ASM)
4344
set(DecompressSources ${DecompressSources} ${LIBRARY_DIR}/decompress/huf_decompress_amd64.S)
4445
else()
4546
add_compile_options(-DZSTD_DISABLE_ASM)

0 commit comments

Comments
 (0)