From a54c702eb3094a5e84aeac4fe70f3098e0b69f8e Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Thu, 17 Sep 2026 09:45:48 -0700 Subject: [PATCH] Link ${CMAKE_DL_LIBS}: dladdr is not in libc on manylinux Co-Authored-By: Claude Opus 5 (1M context) --- src/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 191ec80..c50ed3c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,7 +38,11 @@ target_include_directories(openscad_cpp_parser PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/grammar ${CMAKE_CURRENT_BINARY_DIR} ) -target_link_libraries(openscad_cpp_parser PUBLIC nlohmann_json::nlohmann_json) +# CMAKE_DL_LIBS is -ldl for api.cpp's dladdr() -- empty on macOS and +# Windows, where it lives in libSystem/kernel32. A local macOS build +# therefore links fine and manylinux (glibc < 2.34, dl still a separate +# library) does not: caught only by a wheel build. +target_link_libraries(openscad_cpp_parser PUBLIC nlohmann_json::nlohmann_json ${CMAKE_DL_LIBS}) # SHGetFolderPathW, for the real My Documents rather than an assumed # %USERPROFILE%\Documents -- see api.cpp userLibraryDir(). if(WIN32)