From 01e97331552fa2c41124eb08fd7c9bee4c0c7e22 Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Fri, 14 Jun 2013 20:25:23 +0400 Subject: [PATCH] fix for #3077 removing "-fvisibility=hidden" gcc option due to lack of `__attribute__ ((visibility("default")))` in jni_md.h/JNIEXPORT --- modules/java/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index 30aa9efe6..ad10aafc5 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -269,6 +269,10 @@ else(ANDROID) endif(ANDROID) # step 5: build native part + +# workarounding lack of `__attribute__ ((visibility("default")))` in jni_md.h/JNIEXPORT +string(REPLACE "-fvisibility=hidden" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + add_library(${the_module} SHARED ${handwrittren_h_sources} ${handwrittren_cpp_sources} ${generated_cpp_sources} ${copied_files} "${JAR_FILE}" "${JAR_FILE}.dephelper")