pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/57938: cad/occt OpenCASCADEFoundationClassesTargets.cmake sets -ldl
>Number: 57938
>Category: pkg
>Synopsis: cad/occt OpenCASCADEFoundationClassesTargets.cmake sets -ldl
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Feb 15 21:20:00 +0000 2024
>Originator: Manuel Bouyer
>Release: NetBSD 10.0_RC2/pkgsrc 2023Q4
>Organization:
>Environment:
System: NetBSD armandeche.soc.lip6.fr 10.0_RC2 NetBSD 10.0_RC2 (GENERIC_CAN) #12: Wed Jan 10 10:47:49 CET 2024 bouyer%armandeche.soc.lip6.fr@localhost:/local/armandeche1/tmp/build/amd64/obj/local/armandeche2/netbsd-10/src/sys/arch/amd64/compile/GENERIC_CAN amd64
Architecture: x86_64
Machine: amd64
>Description:
cad/occt installs cmake files to be used by other cmake-using package.
lib/cmake/opencascade/OpenCASCADEFoundationClassesTargets.cmake
unconditionally sets dl in INTERFACE_LINK_LIBRARIES for the TKernel
target. This cause softwares including this file to link with the
TKernel library to try to link with -ldl, which doesn't exists on
NetBSD.
>How-To-Repeat:
In a cmakefile:
set(OpenCASCADE_DIR "${CMAKE_PREFIX_PATH}/lib/cmake/occt")
find_package(OpenCASCADE REQUIRED)
target_link_libraries(foo TKernel)
run cmake and see -ldl showing up in link.txt for foo.
>Fix:
remplacing
INTERFACE_LINK_LIBRARIES "pthread;rt;stdc++;dl"
with
INTERFACE_LINK_LIBRARIES "pthread;rt;stdc++;${CMAKE_DL_LIBS}"
works for me but I don't know if it would DTRT on linux.
An alternative would be to use
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
to include dl in the INTERFACE_LINK_LIBRARIES list
Home |
Main Index |
Thread Index |
Old Index