Skip to content

Commit

Permalink
[tvOS] add binary-addons to xcode project
Browse files Browse the repository at this point in the history
binary-addon building added to xcode project for tvOS.
The default behaviour is to add all addons to the project, but not add as a dependency.
This means the addons will NOT be built be default.
Documentation updated and shows how to selectively build addons if required and how to
add the auto building dependecy to the Xcode project.
  • Loading branch information
fuzzard committed Nov 18, 2019
1 parent a856248 commit 791398d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmake/scripts/darwin_embedded/ArchSetup.cmake
Expand Up @@ -57,6 +57,8 @@ enable_arc()
# Xcode strips dead code by default which breaks wrapping
set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING OFF)

option(ENABLE_XCODE_ADDONBUILD "Enable Xcode automatic addon building?" OFF)

# Unify output directories for iOS/tvOS packaging scripts
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG})
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
Expand Down
15 changes: 15 additions & 0 deletions cmake/scripts/darwin_embedded/Install.cmake
Expand Up @@ -80,6 +80,21 @@ set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTI
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${DEVELOPMENT_TEAM}"
XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "${PROVISIONING_PROFILE_APP}")

# Create xcode target that allows to build binary-addons.
if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
if(ADDONS_TO_BUILD)
set(_addons "ADDONS=${ADDONS_TO_BUILD}")
endif()
add_custom_target(binary-addons
COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons clean
COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons VERBOSE=1 V=99
INSTALL_PREFIX="${CMAKE_BINARY_DIR}/addons" CROSS_COMPILING=yes ${_addons})
if(ENABLE_XCODE_ADDONBUILD)
add_dependencies(${APP_NAME_LC} binary-addons)
endif()
unset(_addons)
endif()

add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
# TODO: Remove in sync with CopyRootFiles-darwin_embedded expecting the ".bin" file
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}>
Expand Down
2 changes: 1 addition & 1 deletion tools/darwin/Support/CopyRootFiles-darwin_embedded.command
Expand Up @@ -14,7 +14,7 @@ SYNC="rsync -aq --exclude .git* --exclude .DS_Store* --exclude *.dll --exclude *
SKINSYNC="rsync -aq --exclude .git* --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude *.dll --exclude *.DLL --exclude *linux.* --exclude *.bat"

# rsync command for including everything but the skins
ADDONSYNC="rsync -aq --no-links --exclude .git* --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude addons/skin.estuary --exclude addons/skin.estouchy"
ADDONSYNC="rsync -aq --no-links --exclude .git* --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude addons/skin.estuary --exclude addons/skin.estouchy --exclude addons/lib --exclude addons/share"

# binary name is Kodi but we build Kodi.bin so to get a clean binary each time
mv $TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/$EXECUTABLE_NAME.bin $TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/$EXECUTABLE_NAME
Expand Down

0 comments on commit 791398d

Please sign in to comment.