From eeaa1e875198abd21bde4a04c9938e65ea9e81ca Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Wed, 3 Apr 2013 20:02:13 +0400 Subject: [PATCH] Fix link of fat java wrapper on OS X --- modules/java/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index cf99226ee..a4d895a6b 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -281,7 +281,14 @@ if(BUILD_FAT_JAVA_LIB) if(__extradeps) list(REMOVE_ITEM __deps ${__extradeps}) endif() - target_link_libraries(${the_module} -Wl,-whole-archive ${__deps} -Wl,-no-whole-archive ${__extradeps} ${OPENCV_LINKER_LIBS}) + if(APPLE) + foreach(_dep ${__deps}) + target_link_libraries(${the_module} -Wl,-force_load "${_dep}") + endforeach() + else() + target_link_libraries(${the_module} -Wl,-whole-archive ${__deps} -Wl,-no-whole-archive) + endif() + target_link_libraries(${the_module} ${__extradeps} ${OPENCV_LINKER_LIBS}) else() target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS}) endif()