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

Set xcode target build settings, so xcode indexer will work #90

Merged
merged 8 commits into from
Jul 23, 2020

Conversation

amberdixon
Copy link
Collaborator

If xcode indexer fails, autocomplete operations will not work.

rules/xcodeproj.bzl Outdated Show resolved Hide resolved
if fi[0] != '/':
fi = "$BAZEL_WORKSPACE_ROOT/%s" % fi
other_cflags.append("-F%s" % fi)
other_cflags.extend(["-D%s" % di for di in target[CcInfo].compilation_context.defines.to_list()])
Copy link
Member

Choose a reason for hiding this comment

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

do we also want to pull out defines from the SwiftInfo provider to pass to to SWIFT_ACTIVE_COMPILATION_CONDITIONS ? What about paths to swiftmodules for non-framework deps (such as a test that will try to import its test host)?

rules/xcodeproj.bzl Outdated Show resolved Hide resolved
rules/xcodeproj.bzl Outdated Show resolved Hide resolved
rules/xcodeproj.bzl Outdated Show resolved Hide resolved
rules/xcodeproj.bzl Outdated Show resolved Hide resolved
Copy link
Member

@segiddins segiddins left a comment

Choose a reason for hiding this comment

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

Looks good! Will need the fixture projects updated & buildifier run to pass CI.

Is there a project in the repo we can run that demonstrates that indexing is fixed with this change?

"path": paths.join(src_dot_dots, s.short_path),
"group": paths.dirname(s.short_path),
"optional": True,
"compilerFlags": "-fobjc-no-arc", # TODO: why is this not working
Copy link
Member

Choose a reason for hiding this comment

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

probably because the flag is -fno-objc-arc

@amberdixon amberdixon requested a review from gyfelton July 21, 2020 20:48
@amberdixon amberdixon changed the title Set OTHER_CFLAGS in the xcode target build settings, so xcode indexer will work Set xcode target build settings, so xcode indexer will work Jul 22, 2020
@amberdixon amberdixon marked this pull request as ready for review July 22, 2020 20:07
@amberdixon amberdixon force-pushed the amber/xcodeproj-other-cflags branch from 972ff6f to 564db51 Compare July 22, 2020 23:25
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