[QBS] Building qbs using clang on Mac OS X

William Gallafent william at gallaf.net
Thu Sep 6 17:16:24 CEST 2012


Hi all,

If I configure qbs thus:

qmake -spec unsupported/macx-clang -r qbs.pro

… then I would expect the whole of qbs to be built using clang! In
fact the part below src/lib is instead built using llvm-gcc-4.2.

Humber:qbs williamg$ make -j5
cd src/lib/ && make -f Makefile
/usr/bin/llvm-g++-4.2 -c -pipe -O2 -arch x86_64 -Xarch_x86_64
-mmacosx-version-min=10.7 -fPIC -Wall -W -DQT_CREATOR
-DQML_BUILD_STATIC_LIB -DQBS_VERSION=\"0.2.0\" -DQT_NO_DEBUG
-DQT_SCRIPT_LIB -DQT_CORE_LIB -DQT_SHARED
-I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -Ijsextensions -Itools
-I. -I../../src -I../../../qbs -Iparser -Ibuildgraph -IQbs -Ilanguage
-I/opt/local/include/QtScript -I/opt/local/include/QtCore
-I/opt/local/include -o textfile.o jsextensions/textfile.cpp
/usr/bin/llvm-g++-4.2 -c -pipe -O2 -arch x86_64 -Xarch_x86_64
-mmacosx-version-min=10.7 -fPIC -Wall -W -DQT_CREATOR
-DQML_BUILD_STATIC_LIB -DQBS_VERSION=\"0.2.0\" -DQT_NO_DEBUG
-DQT_SCRIPT_LIB -DQT_CORE_LIB -DQT_SHARED
-I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -Ijsextensions -Itools
-I. -I../../src -I../../../qbs -Iparser -Ibuildgraph -IQbs -Ilanguage
-I/opt/local/include/QtScript -I/opt/local/include/QtCore
-I/opt/local/include -o process.o jsextensions/process.cpp
/usr/bin/llvm-g++-4.2 -c -pipe -O2 -arch x86_64 -Xarch_x86_64
-mmacosx-version-min=10.7 -fPIC -Wall -W -DQT_CREATOR
-DQML_BUILD_STATIC_LIB -DQBS_VERSION=\"0.2.0\" -DQT_NO_DEBUG
-DQT_SCRIPT_LIB -DQT_CORE_LIB -DQT_SHARED
-I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -Ijsextensions -Itools
-I. -I../../src -I../../../qbs -Iparser -Ibuildgraph -IQbs -Ilanguage
-I/opt/local/include/QtScript -I/opt/local/include/QtCore
-I/opt/local/include -o error.o tools/error.cpp
…

Is there a way to actually build the whole using clang? It appears
that qmake has decided to use llvm instead of clang inside the "lib"
directory. After running qmake I find:

Humber:qbs williamg$ grep -r llvm *
src/lib/Makefile:CC            = /usr/bin/llvm-gcc-4.2
src/lib/Makefile:CXX           = /usr/bin/llvm-g++-4.2

Why is qmake not propagating my "-spec unsupported/macx-clang" down
into this directory? It does seem to propagate correctly to all the
other subprojects!

I'm using qmake of Qt 4.8.2 of MacPorts:

Humber:qbs williamg$ qmake --version
QMake version 2.01a
Using Qt version 4.8.2 in /opt/local/lib

Can anyone suggest how to get clang used to compile the whole project?

Thanks,

-- 
Bill Gallafent.



More information about the Qbs mailing list