Commit 714a472e authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed compilation of JNI layer of Java wrapper

parent e7ed894f
......@@ -335,6 +335,9 @@ endif()
add_subdirectory(include)
add_subdirectory(java)
if(ENABLE_JAVA_WRAPPER)
add_subdirectory(wrappers/java)
endif()
add_subdirectory(src)
add_subdirectory(coreapi)
add_subdirectory(share)
......@@ -356,9 +359,6 @@ endif()
if(ENABLE_CSHARP_WRAPPER)
add_subdirectory(wrappers/csharp)
endif()
if(ENABLE_JAVA_WRAPPER)
add_subdirectory(wrappers/java)
endif()
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
......
......@@ -112,9 +112,8 @@ set(LINPHONE_SOURCE_FILES_CXX
tester_utils.cpp
)
set(LINPHONE_INCLUDE_DIRS ${LINPHONE_INCLUDE_DIRS})
if(ANDROID)
list(APPEND LINPHONE_SOURCE_FILES_CXX linphonecore_jni.cc)
set_source_files_properties(linphonecore_jni.cc PROPERTIES COMPILE_DEFINITIONS "USE_JAVAH")
if(ENABLE_JAVA_WRAPPER)
list(APPEND LINPHONE_SOURCE_FILES_CXX ${LINPHONE_JNI_SOURCES})
endif()
set(LINPHONE_SOURCE_FILES_OBJC)
......@@ -255,7 +254,6 @@ if(ENABLE_SHARED)
set_target_properties(linphone PROPERTIES PREFIX "lib")
elseif(ANDROID)
target_link_libraries(linphone PUBLIC "log" ${SUPPORT_LIBRARIES} ${CPUFEATURES_LIBRARIES})
add_dependencies(linphone linphonecore-jni-header)
endif()
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
......
......@@ -20,9 +20,9 @@
#
############################################################################
add_custom_command(OUTPUT linphone_jni.cc
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/genwrapper.py" "${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml"
DEPENDS ${PROJECT_SOURCE_DIR}/tools/genapixml.py
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/src/linphone_jni.cc"
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/genwrapper.py" "${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml" "-o" "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS ${PROJECT_SOURCE_DIR}/tools/genapixml.py ${LINPHONE_HEADER_FILES}
${PROJECT_SOURCE_DIR}/tools/metadoc.py
${PROJECT_SOURCE_DIR}/tools/abstractapi.py
genwrapper.py
......@@ -33,10 +33,9 @@ add_custom_command(OUTPUT linphone_jni.cc
jni.mustache
linphone-doc
"${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml/index.xml"
COMMENT "Generating java wrapper"
)
add_custom_target(linphonej ALL DEPENDS linphone_jni.cc)
add_custom_target(linphonej ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/src/linphone_jni.cc")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/linphone_jni.cc
DESTINATION ${CMAKE_INSTALL_DATADIR}/linphonej
)
set(LINPHONE_JNI_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/src/linphone_jni.cc" PARENT_SCOPE)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment