Skip to content

Commit dd9ccb2

Browse files
committed
cmake: disable --as-needed for binaries, otherwise ggml.so can't be discovered via RPATH
1 parent 91e3715 commit dd9ccb2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ if(VISP_ASAN)
4242
endif()
4343
endif()
4444

45-
# Windows/MSVC specific defaults
45+
# Platform specific defaults
4646

47+
# Windows
4748
if(MSVC)
4849
list(APPEND VISP_COMP_OPTIONS /utf-8)
4950
list(APPEND VISP_DEFINITIONS _CRT_SECURE_NO_WARNINGS)
@@ -52,6 +53,12 @@ if(MSVC)
5253
list(APPEND VISP_COMP_OPTIONS /Zi)
5354
list(APPEND VISP_LINK_OPTIONS /DEBUG)
5455
endif()
56+
# Linux
57+
elseif(UNIX AND NOT APPLE)
58+
if(VISP_CI OR VISP_DEV)
59+
# Disable omitting dependencies from ELF binaries so they can be found via RPATH
60+
list(APPEND VISP_LINK_OPTIONS -Wl,--no-as-needed)
61+
endif()
5562
endif()
5663

5764
# Configure warnings

src/cli/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ target_include_directories(vision-cli PRIVATE ..)
44
target_compile_definitions(vision-cli PRIVATE ${VISP_ASSERT} ${VISP_DEFINITIONS})
55
target_compile_options(vision-cli PRIVATE ${VISP_WARNINGS} ${VISP_COMP_OPTIONS})
66
target_link_options(vision-cli PRIVATE ${VISP_LINK_OPTIONS})
7-
target_link_libraries(vision-cli PRIVATE visioncpp ${VISP_FMT_LINK})
7+
target_link_libraries(vision-cli PRIVATE ggml visioncpp ${VISP_FMT_LINK})

0 commit comments

Comments
 (0)