mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
Add code signing and fix rpath
Copy lib
This commit is contained in:
parent
1a14c4f1b6
commit
52cc458a9e
5 changed files with 44 additions and 5 deletions
|
|
@ -77,10 +77,29 @@ job-debian9-makefile-clang:
|
|||
- $NIGHTLY_MASTER
|
||||
- $DEPLOY_PLUGINS
|
||||
variables:
|
||||
CMAKE_OPTIONS: -DLINPHONE_BUILDER_SIGNING_IDENTITY=$GPG_SIGNING_KEYID -DLINPHONE_BUILDER_SIGNING_PASSPHRASE=$GPG_SIGNING_PASS
|
||||
CMAKE_GENERATOR: Unix Makefiles
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
ADDITIONAL_BUILD_OPTIONS: -j$MAKEFILE_JOBS
|
||||
script:
|
||||
- echo "$GPG_SIGNING_PUB" > file.key && sed -i 's/\r /\n/g' file.key && chmod 600 file.key
|
||||
- gpg --import file.key
|
||||
- rm -f file.key
|
||||
- echo "$GPG_SIGNING_KEY" > file.key && sed -i 's/\r /\n/g' file.key && chmod 600 file.key
|
||||
- base64 -w 0 file.key | base64 -d | gpg --import --no-tty --batch --yes
|
||||
- rm -f file.key
|
||||
- cmake --version
|
||||
- export CC=$CC
|
||||
- export CXX=$CXX
|
||||
- mkdir -p build/OUTPUT
|
||||
- echo $CI_BUILD_TYPE
|
||||
- echo $CMAKE_GENERATOR
|
||||
- echo $DEFAULT_LINUX_CMAKE_OPTIONS
|
||||
- echo $CMAKE_SANITIZER_OPTIONS
|
||||
- cd build
|
||||
- cmake .. -G "$CMAKE_GENERATOR" -DCMAKE_VERBOSE_MAKEFILE=ON -DLINPHONESDK_PLATFORM=Desktop -DCMAKE_BUILD_TYPE=$CI_BUILD_TYPE $DEFAULT_LINUX_CMAKE_OPTIONS $CMAKE_OPTIONS $SCHEDULE_CMAKE_OPTIONS $CMAKE_SANITIZER_OPTIONS
|
||||
- cmake --build . --target install --config $CI_BUILD_TYPE $LBC_NODEBUG_OPTIONS
|
||||
extends: .job-linux-desktop
|
||||
|
||||
#################################################
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
stage: build
|
||||
tags: [ "windows" ]
|
||||
variables:
|
||||
CMAKE_OPTIONS: -DENABLE_LIME_X3DH=NO -DENABLE_UNIT_TESTS=ON
|
||||
CMAKE_OPTIONS: -DENABLE_LIME_X3DH=NO -DENABLE_UNIT_TESTS=ON -DLINPHONE_WINDOWS_SIGNING_DIR=$WINDOWS_SIGNING_DIRECTORY
|
||||
script:
|
||||
- *build_all_windows_script
|
||||
artifacts:
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR N
|
|||
BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app"
|
||||
DEPENDS ${APP_DEPENDS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time."
|
||||
LIST_SEPARATOR | # Use the alternate list separator
|
||||
CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
|
||||
# ${APP_OPTIONS}
|
||||
|
|
@ -226,6 +227,7 @@ if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR N
|
|||
BINARY_DIR "${CMAKE_BINARY_DIR}/plugins-app"
|
||||
DEPENDS linphone-qt
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time."
|
||||
LIST_SEPARATOR | # Use the alternate list separator
|
||||
CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -514,7 +514,11 @@ add_dependencies(${TARGET_NAME} ${APP_LIBRARY} ${APP_PLUGIN})
|
|||
# ------------------------------------------------------------------------------
|
||||
set(TOOLS_DIR "${CMAKE_BINARY_DIR}/programs")
|
||||
set(LINPHONE_BUILDER_SIGNING_IDENTITY ${LINPHONE_BUILDER_SIGNING_IDENTITY})
|
||||
|
||||
add_custom_command(TARGET ${TARGET_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/include/" "${CMAKE_INSTALL_PREFIX}/include/")
|
||||
add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_INSTALL_PREFIX}/lib/")
|
||||
add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_PLUGIN}> "${CMAKE_INSTALL_PREFIX}/lib/")
|
||||
add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_LINKER_FILE:${APP_PLUGIN}> "${CMAKE_INSTALL_PREFIX}/lib/")
|
||||
#add_custom_command(TARGET ${TARGET_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/include/LinphoneApp/*" "${CMAKE_INSTALL_PREFIX}/include/LinphoneApp/")
|
||||
#configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/*" "${CMAKE_INSTALL_PREFIX}/include/LinphoneApp/" COPYONLY)
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include" DESTINATION ".")
|
||||
|
|
|
|||
|
|
@ -91,11 +91,8 @@ if( WIN32)
|
|||
endif()
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)#useful for config.h
|
||||
|
||||
set(QT5_PACKAGES Core Widgets Network)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED)
|
||||
find_package(Qt5 COMPONENTS ${QT5_PACKAGES_OPTIONAL} QUIET)
|
||||
|
||||
find_package(LinphoneCxx CONFIG)
|
||||
|
|
@ -109,7 +106,7 @@ find_library(APP_PLUGIN_LIBRARY NAMES "app-plugin" PATHS "${APP_PLUGIN_LIB_PATH}
|
|||
|
||||
add_library(${TARGET_NAME} SHARED ${SOURCES} ${HEADERS})
|
||||
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE Qt5::Widgets Qt5::Network ${LINPHONECXX_LIBRARIES} ${APP_PLUGIN_LIBRARY})
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ${LINPHONECXX_LIBRARIES} ${APP_PLUGIN_LIBRARY})
|
||||
target_compile_options(${TARGET_NAME} PRIVATE ${COMPILE_OPTIONS})
|
||||
set_source_files_properties( ${TARGET_NAME} PROPERTIES EXTERNAL_OBJECT true GENERATED true )
|
||||
|
||||
|
|
@ -117,6 +114,23 @@ set_property(TARGET ${TARGET_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) #Nee
|
|||
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_PREFIX_PATH} ${LINPHONECXX_INCLUDE_DIRS})
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${TARGET_NAME}-${PLUGIN_VERSION}")
|
||||
|
||||
# Qt stuffs
|
||||
set(QT5_PACKAGES Gui Core Widgets Network)
|
||||
find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED)
|
||||
foreach (package ${QT5_PACKAGES})
|
||||
list(APPEND QT_INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}")
|
||||
list(APPEND QT_ALL_LIBRARIES ${Qt5${package}_LIBRARIES})
|
||||
if(APPLE)# On Mac, shared libs can be generated with absolute path on Qt libs. This lead to get undeployable shared library.
|
||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND install_name_tool -change "/usr/local/opt/qt/lib/Qt${package}.framework/Versions/5/Qt${package}" "@rpath/Qt${package}.framework/Versions/5/Qt${package}" $<TARGET_FILE:${TARGET_NAME}>)
|
||||
endif()
|
||||
endforeach ()
|
||||
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC ${QT_INCLUDED_DIRECTORIES})
|
||||
target_link_libraries(${TARGET_NAME} PUBLIC ${QT_ALL_LIBRARIES})
|
||||
if(APPLE)
|
||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND install_name_tool -add_rpath "@executable_path/../Frameworks/" $<TARGET_FILE:${TARGET_NAME}>)
|
||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND install_name_tool -add_rpath "@executable_path/../lib/" $<TARGET_FILE:${TARGET_NAME}>)
|
||||
endif()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# IDE
|
||||
#-------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue