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

fix json-compilation-database pch file path bug #250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BillBai
Copy link

@BillBai BillBai commented Oct 16, 2016

Found a bug in json_compilation_database.rb about pch file.

When building a target A, which depends on target B. And the Target B has a prefix header and sets the precompile prefix header to YES. Target A also has its own prefix header, but sets the precompile prefix header to NO.

First xcodebuild will build target B, sets the @pch_path in JSONCompilationDatabase via format_process_pch_command, and everything is fine.

And then it begins to build target A, since the target A sets the precompile prefix header to NO, the format_process_pch_command will not be called, so the @pch_path remains the same as target B. That's the problem! the target A's pch path will be replaced by Target B's.

My solution is simply reset the @pch_path before every target in format_build_target.

@supermarin
Copy link
Contributor

Thanks for the contribution @BillBai ! Mind adding a test (spec/ and/or feature/) so we ensure this doesn't break again?

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.

None yet

2 participants