[cmake/osx] Fix generating Xcode projects #10495
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes broken Xcode project generation after #10372.
core_add_library
does a different thing depending on the generator. For makefiles, it creates a new static library target (everytime it gets called). This leads to hunderts of small libraries (one per each directory). For Xcode or VS there is one libkodi static library andcore_add_library
only appends to that one. This was done to get a decent project structure in the IDEs. Using the same thing for makefiles leads to >60s linking time (every time you touch only a single line).So in CMakeLists.txt files inside of the xbmc directory, make sure to always use the
CORE_LIBRARY
variable when specifying compile options or dependencies.Unfortunately this is currently not very well documented, and I expect errors like this to appear from now and then. Don't yet have a good idea how to prevent them. One thing I could imagine is to have a script that runs some checks on the project files in CI.