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

Search paths in clang/swiftc commands can be relative paths #57

Open
kjcjohnson opened this issue Feb 21, 2024 · 2 comments
Open

Search paths in clang/swiftc commands can be relative paths #57

kjcjohnson opened this issue Feb 21, 2024 · 2 comments

Comments

@kjcjohnson
Copy link

Another "interesting" situation here. It looks like, in some circumstances, Xcode will use relative paths for the -I and -F for clang and swiftc commands. This means that gen-ir will not find, for instance, third-party pre-compiled frameworks and include files needed to compile source files.

Looks like this happens when setting the following project settings to paths starting at $(PROJECT_DIR) and being recursive. Example:

image

If you set this in an example project, you'll see flags like -I. and other relative paths in the CompileC command in Xcode.

Because gen-ir runs the commands in a temp directory (from what I can tell), these relative includes/framework references aren't found and files fail to compile due to missing header files.

Presumably you're running the commands in a temp directory for a good reason, so maybe gen-ir should fix up relative paths on -I and -F flags (and others) to be absolute paths (relative to the xcodeproj directory) before running the commands? Not sure how feasible that is.

It's also unclear how feasible it is to not use recursive search paths; we have these pointing at a big directory of a bunch of third-party references, and we'd have to untangle that mess.

@buzzcode
Copy link
Collaborator

buzzcode commented Feb 22, 2024 via email

@kjcjohnson
Copy link
Author

Note that we ended up just reorganizing our code to not use recursive search paths - we wanted to untangle that mess for other reasons, too. So while this is still an issue to consider for the future, it's not affecting us anymore.

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

No branches or pull requests

2 participants