aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-06-19 16:34:02 +0200
committerCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-06-19 16:56:15 +0200
commit992ff1f7925009b7ead6d6f005cafcf2e57ed44e (patch)
tree7d5f8a64462671022b8007ccf57425411ceebd7e
parent7dba09d7c4007e96fb0a39bf6f6e740cd207324a (diff)
Use default compiler on macOS
While building on macOS the detection of the compiler properly works, but at the time of getting the header libraries we rely on the command: <compiler> -E -x c++ - -v The problem is that since CMake resolves the full path of the compiler we do not properly get the includes that we should, calling the compiler directly via an absolute path (and not via the /usr/bin/clang shim) does not include the default SDK sysroot path. Here is an extract of both executions: * /Library/Developer/CommandLineTools/usr/bin/c++ -E -x c++ - -v #include <...> search starts here: /Library/Developer/CommandLineTools/usr/include/c++/v1 /usr/local/include /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include /Library/Developer/CommandLineTools/usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory) End of search list. * c++ -E -x c++ - -v #include <...> search starts here: /usr/local/include /Library/Developer/CommandLineTools/usr/include/c++/v1 /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include /Library/Developer/CommandLineTools/usr/include /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory) End of search list. Change-Id: Iff300b3b543f5fb3a43f9ce1ea8986f9bc172323 Fixes: PYSIDE-1032 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
index 3196c824e..f301733fe 100644
--- a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
+++ b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
@@ -291,10 +291,11 @@ static QString findClangBuiltInIncludesDir()
#if defined(Q_CC_CLANG) || defined(Q_CC_GNU)
static QString compilerFromCMake(const QString &defaultCompiler)
{
-# ifdef CMAKE_CXX_COMPILER
+// Added !defined(Q_OS_DARWIN) due to PYSIDE-1032
+# if defined(CMAKE_CXX_COMPILER) && !defined(Q_OS_DARWIN)
Q_UNUSED(defaultCompiler)
return QString::fromLocal8Bit(CMAKE_CXX_COMPILER);
-#else
+# else
return defaultCompiler;
# endif
}