Commit 320aaf24 authored by Benjamin REIS's avatar Benjamin REIS
Browse files

enable shared on ios submodules to make frameworks instead of static lib

parent 88bb8d14
...@@ -70,11 +70,13 @@ list(APPEND LINPHONE_BUILDER_EP_VARS ...@@ -70,11 +70,13 @@ list(APPEND LINPHONE_BUILDER_EP_VARS
CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL
CMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH CMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH
CMAKE_C_COMPILER_LAUNCHER:PATH CMAKE_C_COMPILER_LAUNCHER:PATH
CMAKE_C_FLAGS:STRING
CMAKE_C_FLAGS_DEBUG:STRING CMAKE_C_FLAGS_DEBUG:STRING
CMAKE_C_FLAGS_MINSIZEREL:STRING CMAKE_C_FLAGS_MINSIZEREL:STRING
CMAKE_C_FLAGS_RELEASE:STRING CMAKE_C_FLAGS_RELEASE:STRING
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING CMAKE_C_FLAGS_RELWITHDEBINFO:STRING
CMAKE_CXX_COMPILER_LAUNCHER:PATH CMAKE_CXX_COMPILER_LAUNCHER:PATH
CMAKE_CXX_FLAGS:STRING
CMAKE_CXX_FLAGS_DEBUG:STRING CMAKE_CXX_FLAGS_DEBUG:STRING
CMAKE_CXX_FLAGS_MINSIZEREL:STRING CMAKE_CXX_FLAGS_MINSIZEREL:STRING
CMAKE_CXX_FLAGS_RELEASE:STRING CMAKE_CXX_FLAGS_RELEASE:STRING
......
...@@ -28,21 +28,43 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy_libraries.txt" "") ...@@ -28,21 +28,43 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy_libraries.txt" "")
foreach(LIB ${LINPHONE_BUILDER_DUMMY_LIBRARIES}) foreach(LIB ${LINPHONE_BUILDER_DUMMY_LIBRARIES})
string(REPLACE "-" "_" UNDERSCORE_LIB ${LIB}) string(REPLACE "-" "_" UNDERSCORE_LIB ${LIB})
string(REGEX REPLACE "^lib" "" NOPREFIX_LIB ${LIB}) string(REGEX REPLACE "^lib" "" NOPREFIX_LIB ${LIB})
set(_dest "lib") #if(ENABLE_STATIC)
if(${LIB} MATCHES "^libms") # set(_dest "lib")
set(_dest "lib/mediastreamer/plugins") # if(${LIB} MATCHES "^libms")
endif() # set(_dest "lib/mediastreamer/plugins")
if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${_dest}/${LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}") # endif()
message(STATUS "Generating dummy library ${LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}") # if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${_dest}/${LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/dummy.c.in" "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c" @ONLY) # message(STATUS "Generating dummy library ${LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}")
add_library(${NOPREFIX_LIB} STATIC "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c") # configure_file("${CMAKE_CURRENT_SOURCE_DIR}/dummy.c.in" "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c" @ONLY)
install(TARGETS ${NOPREFIX_LIB} # add_library(${NOPREFIX_LIB} STATIC "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c")
LIBRARY DESTINATION ${_dest} # install(TARGETS ${NOPREFIX_LIB}
ARCHIVE DESTINATION ${_dest} # LIBRARY DESTINATION ${_dest}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE # ARCHIVE DESTINATION ${_dest}
) # PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/dummy_libraries.txt" "${LIB}\n") # )
endif() # file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/dummy_libraries.txt" "${LIB}\n")
# endif()
#endif()
#if(ENABLE_SHARED)
set(UNDERSCORE_LIB "lib${UNDERSCORE_LIB}")
set(_dest "Frameworks")
if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${_dest}/${LIB}.framework")
message(STATUS "Generating dummy library ${LIB}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/dummy.c.in" "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c" @ONLY)
add_library(${NOPREFIX_LIB} STATIC "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c")
set_target_properties(${NOPREFIX_LIB} PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER com.belledonne-communications.${NOPREFIX_LIB}
)
install(TARGETS ${NOPREFIX_LIB}
LIBRARY DESTINATION ${_dest}
ARCHIVE DESTINATION ${_dest}
FRAMEWORK DESTINATION ${_dest}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/dummy_libraries.txt" "${LIB}\n")
endif()
#endif()
unset(_dest) unset(_dest)
endforeach() endforeach()
......
...@@ -27,7 +27,7 @@ include(configs/config-ios.cmake) ...@@ -27,7 +27,7 @@ include(configs/config-ios.cmake)
set(LINPHONE_BUILDER_CPPFLAGS "${LINPHONE_BUILDER_CPPFLAGS} -mcpu=cortex-a8") set(LINPHONE_BUILDER_CPPFLAGS "${LINPHONE_BUILDER_CPPFLAGS} -mcpu=cortex-a8")
#XCode7 allows bitcode #XCode7 allows bitcode
if (NOT ${XCODE_VERSION} VERSION_LESS 7) if (NOT ${XCODE_VERSION} VERSION_LESS 7)
set(LINPHONE_BUILDER_CPPFLAGS "${LINPHONE_BUILDER_CPPFLAGS} -fembed-bitcode") #set(LINPHONE_BUILDER_CPPFLAGS "${LINPHONE_BUILDER_CPPFLAGS} -fembed-bitcode")
endif() endif()
# speex # speex
......
...@@ -43,6 +43,8 @@ set(DEFAULT_VALUE_ENABLE_ZRTP ON) ...@@ -43,6 +43,8 @@ set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(DEFAULT_VALUE_ENABLE_LIME ON) set(DEFAULT_VALUE_ENABLE_LIME ON)
set(DEFAULT_VALUE_ENABLE_TOOLS OFF) set(DEFAULT_VALUE_ENABLE_TOOLS OFF)
set(ENABLE_NLS NO CACHE BOOL "" FORCE) set(ENABLE_NLS NO CACHE BOOL "" FORCE)
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=YES" "-DENABLE_SHARED=NO") set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=YES" "-DENABLE_SHARED=NO")
...@@ -75,6 +77,9 @@ include(builders/CMakeLists.txt) ...@@ -75,6 +77,9 @@ include(builders/CMakeLists.txt)
# ffmpeg # ffmpeg
lcb_builder_linking_type(ffmpeg "--enable-static" "--disable-shared" "--enable-pic") lcb_builder_linking_type(ffmpeg "--enable-static" "--disable-shared" "--enable-pic")
# bctoolbox
lcb_builder_linking_type(bctoolbox "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
# linphone # linphone
lcb_builder_cmake_options(linphone "-DENABLE_RELATIVE_PREFIX=YES") lcb_builder_cmake_options(linphone "-DENABLE_RELATIVE_PREFIX=YES")
lcb_builder_cmake_options(linphone "-DENABLE_CONSOLE_UI=NO") lcb_builder_cmake_options(linphone "-DENABLE_CONSOLE_UI=NO")
...@@ -85,6 +90,7 @@ lcb_builder_cmake_options(linphone "-DENABLE_UPNP=NO") ...@@ -85,6 +90,7 @@ lcb_builder_cmake_options(linphone "-DENABLE_UPNP=NO")
lcb_builder_cmake_options(linphone "-DENABLE_MSG_STORAGE=YES") lcb_builder_cmake_options(linphone "-DENABLE_MSG_STORAGE=YES")
lcb_builder_cmake_options(linphone "-DENABLE_DOC=NO") lcb_builder_cmake_options(linphone "-DENABLE_DOC=NO")
lcb_builder_cmake_options(linphone "-DENABLE_NLS=NO") lcb_builder_cmake_options(linphone "-DENABLE_NLS=NO")
lcb_builder_linking_type(linphone "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
# mbedtls # mbedtls
lcb_builder_linking_type(mbedtls "-DUSE_STATIC_MBEDTLS_LIBRARY=YES" "-DUSE_SHARED_MBEDTLS_LIBRARY=NO") lcb_builder_linking_type(mbedtls "-DUSE_STATIC_MBEDTLS_LIBRARY=YES" "-DUSE_SHARED_MBEDTLS_LIBRARY=NO")
...@@ -98,12 +104,21 @@ lcb_builder_cmake_options(ms2 "-DENABLE_GLX=NO") ...@@ -98,12 +104,21 @@ lcb_builder_cmake_options(ms2 "-DENABLE_GLX=NO")
lcb_builder_cmake_options(ms2 "-DENABLE_X11=NO") lcb_builder_cmake_options(ms2 "-DENABLE_X11=NO")
lcb_builder_cmake_options(ms2 "-DENABLE_XV=NO") lcb_builder_cmake_options(ms2 "-DENABLE_XV=NO")
lcb_builder_cmake_options(ms2 "-DENABLE_DOC=NO") lcb_builder_cmake_options(ms2 "-DENABLE_DOC=NO")
lcb_builder_linking_type(ms2 "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
## ms2 plugins
lcb_builder_linking_type(mswebrtc "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
lcb_builder_linking_type(msamr "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
lcb_builder_linking_type(mscodec2 "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
lcb_builder_linking_type(msopenh264 "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
lcb_builder_linking_type(mssilk "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
lcb_builder_linking_type(msx264 "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
# opus # opus
lcb_builder_cmake_options(opus "-DENABLE_FIXED_POINT=YES") lcb_builder_cmake_options(opus "-DENABLE_FIXED_POINT=YES")
# ortp # ortp
lcb_builder_cmake_options(ortp "-DENABLE_DOC=NO") lcb_builder_cmake_options(ortp "-DENABLE_DOC=NO")
lcb_builder_linking_type(ortp "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
# polarssl # polarssl
lcb_builder_linking_type(polarssl "-DUSE_SHARED_POLARSSL_LIBRARY=0") lcb_builder_linking_type(polarssl "-DUSE_SHARED_POLARSSL_LIBRARY=0")
......
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