diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-02-12 13:38:57 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-02-12 20:10:27 +0100 |
| commit | ea20990968ccbf11a99b45247ea5d231ab55cacb (patch) | |
| tree | b595dc641fad31e5ddb05aa34544e77cfe84febf /sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp | |
| parent | 34c4dab7cf68450959383240a68433b979aba821 (diff) | |
shiboken6/compiler support: Extract helper compilerFromCMake()
It is needed by the shiboken wizard.
Task-number: PYSIDE-1338
Task-number: PYSIDE-1032
Pick-to: 6.6
Change-Id: I53e2bd7bc27940a0d00e0db6acdd0f8603e94d41
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp index 1b4f336bb..1b3c2d7d8 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp @@ -306,17 +306,26 @@ static QString findClangBuiltInIncludesDir() return queryLlvmConfigDir(u"--includedir"_s); } +QString compilerFromCMake() +{ +#ifdef CMAKE_CXX_COMPILER + return QString::fromLocal8Bit(CMAKE_CXX_COMPILER); +#else + return {}; +#endif +} + +// Return a compiler suitable for determining the internal include paths static QString compilerFromCMake(const QString &defaultCompiler) { if (!compilerPath().isEmpty()) return compilerPath(); -// Added !defined(Q_OS_DARWIN) due to PYSIDE-1032 - QString result = defaultCompiler; -#ifdef CMAKE_CXX_COMPILER - if (platform() != Platform::macOS) - result = QString::fromLocal8Bit(CMAKE_CXX_COMPILER); -#endif - return result; + // Exclude macOS since cmakeCompiler returns the full path instead of the + // /usr/bin/clang shim, which results in the default SDK sysroot path + // missing (PYSIDE-1032) + const QString &cmakeCompiler = compilerFromCMake(); + return platform() != Platform::macOS && !cmakeCompiler.isEmpty() + ? cmakeCompiler : defaultCompiler; } static void appendClangBuiltinIncludes(HeaderPaths *p) |
