Skip to content

Commit 2ab4e9e

Browse files
mmassingdpasukhi
authored andcommitted
0033319: Coding - Static linking fails with unresolved symbols due to linking order and missing transitive dependencies
The absence of target_link_libraries calls for static libraries caused CMake to fail in modeling the link dependencies correctly. This fix ensures that CMake correctly exports the dependencies in OpenCASCADEConfig.cmake and resolves downstream linking errors for projects that link against static OpenCASCADE libraries.
1 parent d83d72a commit 2ab4e9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adm/cmake/occt_toolkit.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
479479
if(IS_VTK_9XX)
480480
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
481481
endif()
482-
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
483482
endif()
483+
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
484484

485485
if (USE_QT)
486486
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})

0 commit comments

Comments
 (0)