Skip to content

Commit 0392bff

Browse files
committed
fix(compat.opencv): pin macOS deployment target 14.0 — kill __hash_memory skew
--no-default-config alone wasn't enough: at the SDK's default target (15.0) Apple libc++'s availability-guarded headers still emit the out-of-line std::__1::__hash_memory (added at 14.4), but the runtime libc++ linked at the consumer's min (14.0) lacks it. Pinning CMAKE_OSX_DEPLOYMENT_TARGET=14.0 (< 14.4) makes the guard select the inline hash path -> no external symbol; also silences the object-version-newer-than-target link warnings.
1 parent f3a1485 commit 0392bff

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pkgs/c/compat.opencv.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,15 @@ local function _install_impl()
332332
"-DWITH_OPENJPEG=OFF -DWITH_JASPER=OFF -DWITH_OPENEXR=OFF -DWITH_GDAL=OFF",
333333
"-DWITH_GDCM=OFF -DBUILD_opencv_world=OFF",
334334
"-DOPENCV_GENERATE_PKGCONFIG=OFF -DINSTALL_CREATE_DISTRIB=OFF",
335+
-- macOS: pin the deployment target to the consumer's (14.0). Apple's libc++
336+
-- added the out-of-line std::__1::__hash_memory at macOS 14.4; building at
337+
-- the SDK's default (15.0) makes its availability-guarded headers EMIT it,
338+
-- but the runtime libc++ linked at the consumer's min (14.0) lacks it ->
339+
-- undefined symbol. Targeting 14.0 (< 14.4) makes the guard pick the INLINE
340+
-- hash path, so no external symbol is emitted; also silences the "object
341+
-- version 15.0 newer than target minimum 14.0" link warnings. Empty on
342+
-- Linux (this var expands to nothing there).
343+
isMac and "-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0" or "",
335344
}, " ")
336345

337346
os.exec(string.format("bash -c %s", sh_quote(string.format(

0 commit comments

Comments
 (0)