Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ios9 #15658

Merged
merged 4 commits into from Mar 17, 2019
Merged

Fix ios9 #15658

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/scripts/ios/Install.cmake
Expand Up @@ -82,6 +82,7 @@ add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
"BUILT_PRODUCTS_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.."
"WRAPPER_NAME=${APP_NAME}.app"
"APP_NAME=${APP_NAME}"
"CURRENT_ARCH=${ARCH}"
${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign.command
)

Expand Down
11 changes: 10 additions & 1 deletion tools/darwin/Support/Codesign.command
Expand Up @@ -9,7 +9,16 @@ export CODESIGN_ALLOCATE=`xcodebuild -find codesign_allocate`

GEN_ENTITLEMENTS="$NATIVEPREFIX/bin/gen_entitlements.py"
IOS11_ENTITLEMENTS="$XBMC_DEPENDS/share/ios11_entitlements.xml"
LDID="$NATIVEPREFIX/bin/ldid"
LDID32="$NATIVEPREFIX/bin/ldid32"
LDID64="$NATIVEPREFIX/bin/ldid64"
LDID=${LDID32}

if [ "${CURRENT_ARCH}" == "arm64" ] || [ "${CURRENT_ARCH}" == "aarch64" ]; then
LDID=${LDID64}
echo "using LDID64"
else
echo "using LDID32"
fi

if [ ! -f ${GEN_ENTITLEMENTS} ]; then
echo "error: $GEN_ENTITLEMENTS not found. Codesign won't work."
Expand Down
25 changes: 17 additions & 8 deletions tools/depends/native/ldid-native/Makefile
Expand Up @@ -5,21 +5,30 @@ DEPS= ../../Makefile.include Makefile

# lib name, version
LIBNAME=ldid
VERSION=2
SOURCE=$(LIBNAME)-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz
VERSION32=1.0.0
VERSION64=2
SOURCE32=$(LIBNAME)-$(VERSION32)
SOURCE64=$(LIBNAME)-$(VERSION64)
ARCHIVE32=$(SOURCE32).tar.gz
ARCHIVE64=$(SOURCE64).tar.gz

all: .installed-$(PLATFORM)

$(TARBALLS_LOCATION)/$(ARCHIVE):
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
$(TARBALLS_LOCATION)/$(ARCHIVE32):
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE32)

$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
$(TARBALLS_LOCATION)/$(ARCHIVE64):
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE64)

$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE32) $(TARBALLS_LOCATION)/$(ARCHIVE64) $(DEPS)
rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE32)
mv $(PLATFORM)/ldid $(PLATFORM)/ldid32
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE64)
mv $(PLATFORM)/ldid $(PLATFORM)/ldid64

.installed-$(PLATFORM):$(PLATFORM)
cp $(PLATFORM)/ldid $(NATIVEPREFIX)/bin
cp $(PLATFORM)/ldid* $(NATIVEPREFIX)/bin
touch $@

clean:
Expand Down
2 changes: 2 additions & 0 deletions xbmc/windowing/osx/WinSystemIOS.h
Expand Up @@ -85,5 +85,7 @@ class CWinSystemIOS : public CWinSystemBase, public CRenderSystemGLES
void FillInVideoModes(int screenIdx);
bool SwitchToVideoMode(int width, int height, double refreshrate);
CADisplayLinkWrapper *m_pDisplayLink;
int m_internalTouchscreenResolutionWidth = -1;
int m_internalTouchscreenResolutionHeight = -1;
};

27 changes: 20 additions & 7 deletions xbmc/windowing/osx/WinSystemIOS.mm
Expand Up @@ -228,6 +228,7 @@ - (void) runDisplayLink;
*w = screenSize.width;
*h = screenSize.height;
*fps = 0.0;

//if current mode is 0x0 (happens with external screens which aren't active)
//then use the preferred mode
if(*h == 0 || *w ==0)
Expand All @@ -236,15 +237,27 @@ - (void) runDisplayLink;
*w = firstMode.size.width;
*h = firstMode.size.height;
}

//for mainscreen exchange w and h
//because mainscreen is build in
//in 90° rotated
// for mainscreen use the eagl bounds from xbmcController
// because mainscreen is might be 90° rotate dependend on
// the device and eagl gives the correct values in all cases.
if(screenIdx == 0)
{
int tmp = *w;
*w = *h;
*h = tmp;
// at very first start up we cache the internal screen resolution
// because when using external screens and need to go back
// to internal we are not able to determine the eagl bounds
// before we really switched back to internal
// but display settings ask for the internal resolution before
// switching. So we give the cached values back in that case.
if (m_internalTouchscreenResolutionWidth == -1 &&
m_internalTouchscreenResolutionHeight == -1)
{
m_internalTouchscreenResolutionWidth = [g_xbmcController getScreenSize].width;
m_internalTouchscreenResolutionHeight = [g_xbmcController getScreenSize].height;
}

*w = m_internalTouchscreenResolutionWidth;
*h = m_internalTouchscreenResolutionHeight;
}
CLog::Log(LOGDEBUG,"Current resolution Screen: %i with %i x %i",screenIdx, *w, *h);
return true;
Expand Down