From 992ff1f7925009b7ead6d6f005cafcf2e57ed44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Wed, 19 Jun 2019 16:34:02 +0200 Subject: 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: -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 Reviewed-by: Christian Tismer --- sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp | 5 +++-- 1 file 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 } -- cgit v1.2.3