1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

fix running on device from Xcode

proper codesigning
This commit is contained in:
Andrey Filipenkov 2021-03-12 14:01:00 +03:00
parent cfa22c33ad
commit 6e41e3154c
5 changed files with 19 additions and 2 deletions

View File

@ -155,6 +155,7 @@ set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release RelWithDebInfo MinSizeRel "")
if(APPLE_IOS)
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED NO)
set(SYSTEM_LIBS ${SYSTEM_LIBS} iconv) # boost.locale
endif(APPLE_IOS)

10
apple_codesign.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
if [[ "$PLATFORM_NAME" != "iphoneos" ]]; then
exit 0
fi
echo 'codesign dylibs'
for lib in $(find "$CODESIGNING_FOLDER_PATH/Frameworks" -iname '*.dylib'); do
codesign --force --timestamp=none --sign "$EXPANDED_CODE_SIGN_IDENTITY" "$lib"
done

View File

@ -183,6 +183,7 @@ elseif(APPLE_IOS)
set_target_properties(vcmiclient PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/ios/Info.plist.in"
SKIP_BUILD_RPATH 1
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED YES
)
target_sources(vcmiclient PRIVATE ${CMAKE_SOURCE_DIR}/client/LaunchScreen.storyboard)
@ -211,6 +212,7 @@ if(APPLE_IOS)
add_custom_command(TARGET vcmiclient POST_BUILD
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiclient>"
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath @executable_path/Frameworks $<TARGET_FILE:vcmiclient> || true
COMMAND ${CMAKE_SOURCE_DIR}/apple_codesign.sh
)
else()
install(TARGETS vcmiclient DESTINATION ${BIN_DIR})

View File

@ -5,7 +5,7 @@ ffmpegDir=~/dev/ios/vcmi-ios-deps/mobile-ffmpeg-min-universal
sdlLibsDir=~/dev/ios/vcmi-ios-deps/SDL2-lib
srcDir="../vcmi"
/Users/Shared/xbmc-depends/x86_64-darwin19.6.0-native/bin/cmake "$srcDir" -G Xcode \
cmake "$srcDir" -G Xcode \
-DBUNDLE_IDENTIFIER_PREFIX=com.kambala \
-Wno-dev \
-DCMAKE_TOOLCHAIN_FILE="$srcDir/ios.toolchain.cmake" \
@ -18,4 +18,6 @@ srcDir="../vcmi"
-DSDL2_IMAGE_INCLUDE_DIR=~/dev/ios/vcmi-ios-deps/SDL_image-release-2.0.5 \
-DSDL2_MIXER_INCLUDE_DIR=~/dev/ios/vcmi-ios-deps/SDL_mixer-release-2.0.4 \
-DSDL2_TTF_INCLUDE_DIR=~/dev/ios/vcmi-ios-deps/SDL_ttf-release-2.0.15 \
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY='Apple Development' \
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM='4XHN44TEVG'
# -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO

View File

@ -51,6 +51,7 @@ elseif(APPLE_IOS)
set_target_properties(vcmiserver PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/ios/Info.plist.in"
SKIP_BUILD_RPATH 1
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED YES
)
# TODO: move to a common dir / add macro?
target_sources(vcmiserver PRIVATE ${CMAKE_SOURCE_DIR}/client/LaunchScreen.storyboard)
@ -64,6 +65,7 @@ if(APPLE_IOS)
add_custom_command(TARGET vcmiserver POST_BUILD
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiserver>"
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath @executable_path/Frameworks $<TARGET_FILE:vcmiserver> || true
COMMAND ${CMAKE_SOURCE_DIR}/apple_codesign.sh
)
else()
install(TARGETS vcmiserver DESTINATION ${BIN_DIR})