-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
hi
While building ZenDNN with a shared library and examples, I encountered an issue related to the examples build configuration. The examples build configuration only links the static library (zendnnl_archive) and doesn't handle the case of a shared library
Issue: current code hardcodes linking to static library only
Line: 87
ZenDNN/examples/CMakeLists.txt
Lines 85 to 87 in fc28bba
| target_link_libraries(examples | |
| PUBLIC OpenMP::OpenMP_CXX | |
| PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,zendnnl::zendnnl_archive>") |
Proposed fix:
By adding conditional logic to check for both library
if(TARGET zendnnl::zendnnl_archive)
target_link_libraries(examples
PUBLIC OpenMP::OpenMP_CXX
PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,zendnnl::zendnnl_archive>")
elseif(TARGET zendnnl::zendnnl)
target_link_libraries(examples
PUBLIC OpenMP::OpenMP_CXX
PRIVATE zendnnl::zendnnl)
else()
message(FATAL_ERROR "Neither zendnnl::zendnnl_archive nor zendnnl::zendnnl target found")
endif()Impact
Examples cannot be built when using shared library
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels