Commit 0adccd72 authored by François Grisez's avatar François Grisez

[Build] Fix race condition between linphonej and linphone-coreapi targets

parent 00d695d7
......@@ -156,6 +156,9 @@ if (ENABLE_STATIC)
)
target_include_directories(linphone-coreapi-static SYSTEM PRIVATE ${LINPHONE_INCLUDE_DIRS})
add_dependencies(linphone-coreapi-static liblinphone-git-version)
if (ENABLE_JAVA_WRAPPER)
add_dependencies(linphone-coreapi-static linphonej)
endif()
endif ()
if (ENABLE_SHARED)
......@@ -165,6 +168,9 @@ if (ENABLE_SHARED)
target_include_directories(linphone-coreapi SYSTEM PRIVATE ${LINPHONE_INCLUDE_DIRS})
target_compile_options(linphone-coreapi PRIVATE "-fPIC")
add_dependencies(linphone-coreapi liblinphone-git-version)
if (ENABLE_JAVA_WRAPPER)
add_dependencies(linphone-coreapi linphonej)
endif()
endif ()
......
......@@ -441,9 +441,6 @@ if(ENABLE_SHARED)
set_target_properties(linphone PROPERTIES PREFIX "lib")
elseif(ANDROID)
target_link_libraries(linphone PUBLIC "log" ${SUPPORT_LIBRARIES} ${CPUFEATURES_LIBRARIES})
if(ENABLE_JAVA_WRAPPER)
add_dependencies(linphone linphonej)
endif()
endif()
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
......
......@@ -34,7 +34,6 @@ add_custom_command(OUTPUT include/linphone++/linphone.hh src/linphone++.cc
enums_header.mustache
main_header.mustache
linphone-doc
"${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml/index.xml"
)
add_library(linphone++ SHARED
......
......@@ -28,7 +28,6 @@ add_custom_command(OUTPUT LinphoneWrapper.cs
genwrapper.py
wrapper_impl.mustache
linphone-doc
"${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml/index.xml"
)
add_custom_target(linphonecs ALL DEPENDS LinphoneWrapper.cs)
......
......@@ -20,10 +20,13 @@
#
############################################################################
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/src/linphone_jni.cc"
set(jni_sources "${CMAKE_CURRENT_BINARY_DIR}/src/linphone_jni.cc")
add_custom_command(OUTPUT "${jni_sources}"
COMMAND ${CMAKE_COMMAND} -E remove -f java/org/linphone/core/* src/*
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/metaname.py
${PROJECT_SOURCE_DIR}/tools/metadoc.py
${PROJECT_SOURCE_DIR}/tools/abstractapi.py
genwrapper.py
......@@ -33,13 +36,12 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/src/linphone_jni.cc"
java_interface.mustache
jni.mustache
linphone-doc
"${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml/index.xml"
COMMENT "Generating java wrapper"
)
add_custom_target(linphonej ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/src/linphone_jni.cc")
add_custom_target(linphonej ALL DEPENDS "${jni_sources}")
set(LINPHONE_JNI_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/src/linphone_jni.cc" PARENT_SCOPE)
set(LINPHONE_JNI_SOURCES "${jni_sources}" PARENT_SCOPE)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/java" DESTINATION "${CMAKE_INSTALL_DATADIR}/linphonej/")
install(DIRECTORY classes/ DESTINATION "${CMAKE_INSTALL_DATADIR}/linphonej/java/org/linphone/core/")
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