Closed sy6sy2 closed 4 years ago
Is the plan to add each of the logical pieces from here?
Or to submit this PR up to being able to generate the Xcode project?
Good question, I don't which of the two solutions is the best.
Either do I. I guess smaller is better and if anything fundamental changes in review there would be less rework.
I think you are right. So the plan would be to submit a PR having as only goal to be able to generate the kodi Xcode project for tvOS with tvOS toolchain. Then we we do not care if we can compile or not this project with Xcode.
If it is right I can:
Sounds good? :-)
Perfect
PR open!
You are right kambala! Never used sips
but I can look at that
shouldn't tvOS condition be added here as well? https://github.com/SylvainCecchetto/xbmc/blob/ATV-cmake-generation/cmake/scripts/osx/Macros.cmake#L23
Oh you are right, I miss this one :-/ Thank you! I will apply changes tomorrow.
this must be set(CMAKE_XCODE_ATTRIBUTE_TVOS_DEPLOYMENT_TARGET "11.0")
(yes, I'm lazy to create a PR)
Done, thank you for your review
Rechi comment: "I still think making tvos a complete separate platform is the wrong approach, but I would have to see the whole code to make a final decision." about set(CORE_SYSTEM_NAME tvos)
in the Toolchain.
Do you think that we can keep set(CORE_SYSTEM_NAME ios)
even for tvOS and still have TARGET_DARWIN_TVOS
in core source files?
Even though the build systems are similar I think that core wise it will diverge over time.
What approach is used in the yab branch?
The yab branch uses #if defined(TARGET_DARWIN_IOS) || defined(TARGET_DARWIN_TVOS)
approach in source files.
But there is no cmake folder in root folder because Memphiz directly uses a "custom" Xcode project
Ok, I think that Rechi wants that we use the same approach as Raspberry (see existing Toolchain file) by using the CORE_PLATFORM_NAME
variable.
I think something like that:
[...]
elseif(OS STREQUAL ios)
set(CMAKE_SYSTEM_NAME Darwin)
set(CORE_SYSTEM_NAME ios)
if(PLATFORM STREQUAL appletvos)
set(CORE_PLATFORM_NAME appletvos)
endif()
[...]
instead of:
[...]
elseif(OS STREQUAL ios)
set(CMAKE_SYSTEM_NAME Darwin)
if(PLATFORM STREQUAL appletvos)
set(CORE_SYSTEM_NAME tvos)
else()
set(CORE_SYSTEM_NAME ios)
endif()
[...]
With this approach we have nothing to modify everywhere there is a if(CORE_SYSTEM_NAME STREQUAL ios)
and we only need to apply modification where there is a difference between tvOS and iOS.
What do you think about that?
Sounds good š
What is CORE_PLATFORM_NAME set to for iOS?
I think this variable is currently not set for iOS
Should we ask Rechi this on the PR?
EDIT: you already did š
The yab branch uses
#if defined(TARGET_DARWIN_IOS) || defined(TARGET_DARWIN_TVOS)
approach in source files
no, it's not entirely true. In yab both TARGET_DARWIN_IOS
and TARGET_DARWIN_TVOS
are defined for tvOS, that's why much less code changes were required.
@kambala-decapitator
Do you like this approach:
[...]
elseif(OS STREQUAL ios)
set(CMAKE_SYSTEM_NAME Darwin)
set(CORE_SYSTEM_NAME ios)
if(PLATFORM STREQUAL appletvos)
set(CORE_PLATFORM_NAME appletvos)
endif()
[...]```
@phunkyfish I have no problem with it, as I'm not a fan of cmake at all :) whatever others think is best, I agree. The only thing: shouldn't CORE_PLATFORM_NAME be tvos
, not appletvos
?
I'm more interested in source code defines/macros.
no, it's not entirely true. In yab both TARGET_DARWIN_IOS and TARGET_DARWIN_TVOS are defined for tvOS, that's why much less code changes were required.
Oh yes! Maybe can we follow this approach and also define TARGET_DARWIN_IOS and TARGET_DARWIN_TVOS in our case?
@phunkyfish I have no problem with it, as I'm not a fan of cmake at all :) whatever others think is best, I agree. The only thing: shouldn't CORE_PLATFORM_NAME be tvos, not appletvos?
Maybe, absolutely no idea which one is best ;-)
Maybe can we follow this approach and also define TARGET_DARWIN_IOS and TARGET_DARWIN_TVOS in our case?
I don't like this approach tbh, that's why I once mentioned adding a "parent" define for both. But then in some review rechi reminded of the SDK-defined TARGET_OS_IPHONE
which is set for both iOS and tvOS, so I think this is the way to go in the sources instead of the currently used "iOS or tvOS" approach. Unless kodi code style requires using only custom defines...
Although, considering that tvOS would be a "variant" of iOS, the yab approach sounds valid.
Maybe, absolutely no idea which one is best ;-)
I'd personally go with tvos
The TARGET_OS_IPHONE
seems to be the cleanest way. But this modification would have an impact on both iOS and tvOS existing code, isn't is?
Don't know if Rechi is agree to replace all TARGET_DARWIN_IOS
by TARGET_OS_IPHONE
in the code. Or maybe I misunderstood a thing?
you're absolutely correct :) you could already ask Rechi about that.
for now we can follow yab approach, and after our cmake and core PRs are merged, I can open a separate one that uses TARGET_OS_IPHONE
.
In the last PR he referenced a set of defines. Let me look it up.
Yes, that's what kambala was referring to I think.
I will ask Rechi about his plan directly in the PR discussion.
That didnāt really work.
From Rechi:
The reason I'm asking is the following comment from TargetConditionals.h in the platforms SDKs. Also most of the build system code looks the same. I was thinking to handle it like the different windowing for linux.
TARGET_OS_*
These conditionals specify in which Operating System the generated code will
run. Indention is used to show which conditionals are evolutionary subclasses.
The MAC/WIN32/UNIX conditionals are mutually exclusive.
The IOS/TV/WATCH conditionals are mutually exclusive.
TARGET_OS_WIN32 - Generated code will run under 32-bit Windows
TARGET_OS_UNIX - Generated code will run under some Unix (not OSX)
TARGET_OS_MAC - Generated code will run under Mac OS X variant
TARGET_OS_OSX - Generated code will run under OS X devices
TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator
TARGET_OS_IOS - Generated code will run under iOS
TARGET_OS_TV - Generated code will run under Apple TV OS
TARGET_OS_WATCH - Generated code will run under Apple Watch OS
TARGET_OS_BRIDGE - Generated code will run under Bridge devices
TARGET_OS_SIMULATOR - Generated code will run under a simulator
TARGET_OS_EMBEDDED - Generated code for firmware
TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR
TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH
+------------------------------------------------+
| TARGET_OS_MAC |
| +---+ +-------------------------------------+ |
| | | | TARGET_OS_IPHONE | |
| |OSX| | +-----+ +----+ +-------+ +--------+ | |
| | | | | IOS | | TV | | WATCH | | BRIDGE | | |
| | | | +-----+ +----+ +-------+ +--------+ | |
| +---+ +-------------------------------------+ |
+------------------------------------------------+
That didnāt really work.
What do you mean?
I tried to link to the comment but it just brought you to the entire PR instead. Copy paste and worked much better.
Ah ok!
So maybe we can wait for Rechi's answer in the PR.
Edit: I updated my comment in the PR discussion
So, what I understand from Rechi answer:
set(CORE_SYSTEM_NAME ios)
+ set(CORE_PLATFORM_NAME tvos)
in the Toolchain for Apple TV build#define
preprocessor I am not very sure to understand...I think he means that TARGET_DARWIN_IPHONE is set for either iOS or tvOS to show they are related as well as their specific include.
He asked if there was a better name for TARGET_DARWIN_IPHONE as itās not exactly suited as a family name for tvOS.
@phunkyfish yes, correct. That's why I thought of the name like TARGET_DARWIN_EMBEDDED
. Or maybe TARGET_DARWIN_NONDESKTOP
would also do.
Letās ask Rechi what he thinks.
EDIT: asked on PR.
TARGET_DARWIN_EMBEDDED
it is.
So for tvOS that should be defined to denote itās either iOS or tvOS and also define TARGET_DARWIN_TVOS
.
Does that make sense @SylvainCecchetto?
So based on your earlier 3 points they should be:
TARGET_DARWIN_EMBEDDED
and TARGET_DARWIN_TVOS
for tvOS (and by inference iOS would define TARGET_DARWIN_EMBEDDED
and TARGET_DARWIN_IOS
) Sorry I just come back. The plan seems clear to me, thank you for the 3 points above!
Maybe I should rename ATV-cmake-generation
with other name like ATV-PR
and use this branch to the final PR with ALL modifications?
May I keep the current PR open?
I donāt think the branch name matters much. Just rename the PR Iād say and add everything else.
Post here when you are happy with the branch and Iāll kick off a test build.
Ok no problem, thank you ;-)
cmake/treedata/ios/subdirs.txt
also needs to be copied for tvOS and modified accordingly, I guess
Hi all! So, I'm sure that there is:
Anyway, this is a first try xD but this branch is up to date with upstream/master (rebase).
I will try to compile everything from scratch also.
Edit: As expected, dependencies build still works
Edit2: I am currently fixing things that Rechi highlighted, I will force push soon on this branch.
Don't know if I broke something but I cannot build Kodi ATV with this branch ; error on cores/AudioEngine/Skins/AESinkDARWINIOS.mm
file
would you post the error? :)
/Users/sylvain/Kodi_dev/kodi/xbmc/cores/AudioEngine/Sinks/AESinkDARWINIOS.mm:105:19:
Unknown type name 'AudioSessionPropertyID'; did you mean 'AudioServicesPropertyID'?
/Users/sylvain/Kodi_dev/kodi/xbmc/cores/AudioEngine/Sinks/AESinkDARWINIOS.mm:284:45:
Use of undeclared identifier 'kAudioSessionProperty_PreferredHardwareIOBufferDuration'
15 errors
ATV-cmake-generation branch
Description
Branch to use for the next PR to upstream/master.
This branch must be kept up to date with upstream/master by using:
The only purpose of the modifications made by this branch is to be able to generate without error the project Xcode with Cmake for the Apple TV. Here we do not care if we can compile or not this project with Xcode
Commits
tools/depends/target/Toolchain.cmake.in
file changes