]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[meson] Explicitly disable assembly for non clang/gcc copmilers 2972/head
authorNick Terrell <terrelln@fb.com>
Wed, 5 Jan 2022 00:05:59 +0000 (16:05 -0800)
committerNick Terrell <terrelln@fb.com>
Wed, 5 Jan 2022 00:05:59 +0000 (16:05 -0800)
After merging #2951 I realized that we will want to explicitly disable
assembly when we aren't including the assembly source file. Otherwise,
if some non clang/gcc compiler does support assembly, it would fail to
build.

build/meson/lib/meson.build

index 2a8c55fbf5294020584caa9a6d107fc547aae45e..6b09337810183c216079419e5bbafbd88574aff5 100644 (file)
@@ -47,8 +47,11 @@ libzstd_sources = [join_paths(zstd_rootdir, 'lib/common/entropy_common.c'),
 
 # really we need anything that defines __GNUC__ as that is what ZSTD_ASM_SUPPORTED is gated on
 # but these are the two compilers that are supported in tree and actually handle this correctly
+# Otherwise, explicitly disable assmebly.
 if [compiler_gcc, compiler_clang].contains(cc_id)
   libzstd_sources += join_paths(zstd_rootdir, 'lib/decompress/huf_decompress_amd64.S')
+else
+  add_project_arguments('-DZSTD_DISABLE_ASM', language: 'c')
 endif
 
 # Explicit define legacy support