From 9a03f045963143e7a8a776503048fcd985190edf Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 17 Jun 2026 18:07:01 +1000 Subject: [PATCH] CMake: don't export turbojpeg symbols If an application links to both libvncserver and libjpeg-turbo (either directly or indirectly through another library), it can cause the application to unexpectedly call the libvncserver implementation instead of the libjpeg-turbo implementation. Avoid this by not exporting the turbojpeg symbols. Fixes https://github.com/LibVNC/libvncserver/issues/729 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9709c809..75ad31f19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -389,6 +389,10 @@ set(LIBVNCCLIENT_SOURCES ${CRYPTO_SOURCES} ) +if(UNIX) + set_source_files_properties(${COMMON_DIR}/turbojpeg.c PROPERTIES COMPILE_OPTIONS "-fvisibility=hidden") +endif() + if(JPEG_FOUND) set(LIBVNCCLIENT_SOURCES ${LIBVNCCLIENT_SOURCES}