Skip to content

Fix evaluation of SOURCE_ROOT path - #1

Merged
miki-shapr merged 2 commits into
masterfrom
source-root-fix
Aug 15, 2025
Merged

Fix evaluation of SOURCE_ROOT path#1
miki-shapr merged 2 commits into
masterfrom
source-root-fix

Conversation

@miki-shapr

@miki-shapr miki-shapr commented Aug 15, 2025

Copy link
Copy Markdown

The value of the SOURCE_ROOT variable was evaluated incorrectly by CocoaPods.

In Xcode, it is the path to the root of the repository (e.g. ~/Developer/shapr3d) but in the CocoaPods implementation, it was expanded to the path to the project, which, in the case of KernelProject.xcodeproj was ~/Developer/shapr3d/build/cmake.

This mismatch caused CocoaPods to not find the .xcconfig file of targets generated by CMake (e.g. SPLibBinginsTests).

Tip

See CocoaPods/CocoaPods#6268 for more info. Specifically this comment.

Note

Opened a PR for upstream: CocoaPods#1024

@lowdesertpunk lowdesertpunk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a unit test similarly as done in https://github.com/CocoaPods/Xcodeproj/pull/739/files

And then lets open PR for upstream too.

The value `SOURCE_ROOT` resolves to in Xcode and in CocoaPods differs, causing `pod install` to emit warnings about the `xcconfig` files not being used properly for targets generated from CMake.
@miki-shapr

Copy link
Copy Markdown
Author

The tests can be executed using this command:

bundle exec rake spec:all

@miki-shapr
miki-shapr merged commit cc44fee into master Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants