Skip to content

ENH: Improve Qt include path resolution macOS #271

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

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

Conversation

hjmjohnson
Copy link
Contributor

Add specific framework path handling

Refactor include directory parsing to support multiple candidate paths for headers and introduce macOS-specific logic for resolving framework-relative header paths. Enhance generator flexibility and robustness for cross-platform usage.

Push upstream fix via:
danmar/simplecpp#448

Add specific framework path handling

Refactor include directory parsing to support multiple candidate paths
for headers and introduce macOS-specific logic for resolving
framework-relative header paths. Enhance generator flexibility and
robustness for cross-platform usage.

Push upstream fix via:
danmar/simplecpp#448
@@ -217,7 +217,20 @@ namespace
QRegularExpression re("#define\\s+QTCORE_VERSION\\s+0x([0-9a-f]+)", QRegularExpression::CaseInsensitiveOption);
for (const QString &includeDir: getIncludeDirectories(commandLineIncludes))
{
QFileInfo fi(QDir(includeDir), "qtcoreversion.h");
std::list<std::string> candiate_paths;
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: candidate_paths

Comment on lines +43 to +44
std::string get_apple_framework_relative_path(const std::string& header);

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this have to be public, or could you just put it into an anonymous namespace in the implementation?

@@ -3116,13 +3116,40 @@ static std::string getIncludePathFileName(const std::string &includePath, const
return path + header;
}

#ifdef __APPLE__
static std::string get_apple_framework_relative_path(const std::string& header)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please try to use the same naming style (e.g. camel case) as the rest of the code.

@hjmjohnson
Copy link
Contributor Author

I am working with the upstream simplecpp developers to finalize the changes. danmar/simplecpp#448

I'll make fixes there. It will probably be a few months before I get back to this.

@hjmjohnson hjmjohnson marked this pull request as draft July 17, 2025 12:13
@mrbean-bremen
Copy link
Contributor

Ah, I had missed that this is from an upstream change. In this case it is of course preferrable to leave the code compatible, though it would be even better if you could change this upstream, thanks!

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