[Build] Disable AVX for snappy

This keeps it from forcing AVX2 (which can in turn bring in BMI2)
which will break Sandy/Ivy Bridge CPUs
This commit is contained in:
Herman S.
2025-10-31 23:46:19 +09:00
parent 4fdb9954ec
commit bf547da02e
+3 -1
View File
@@ -15,9 +15,11 @@ project("snappy")
"snappy/snappy.h",
})
-- Disable AVX requirement to prevent BMI2 instructions from being baked in at compile time
-- This allows Snappy to work on CPUs without BMI2 support (e.g., Sandy Bridge, Ivy Bridge)
local snappy_dir = path.getabsolute("snappy")
if not os.isfile(path.join(snappy_dir, "snappy-stubs-public.h")) then
prebuildcommands({
"cmake -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF -DSNAPPY_REQUIRE_AVX=ON "..snappy_dir.." -B"..snappy_dir
"cmake -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF "..snappy_dir.." -B"..snappy_dir
})
end