lann
Merci pour ta réponse ce qui est étrange c'est que sur macOs bear renvoie un fichier json vide avec les specs macx de clang si je lui passe les. specs linux pour créer mon projet j'ai bien un compile_commands.json mais le projet ne compile pas. Voici des logs pour les specs linux-clang:
test mkdir build && cd build
➜ build qmake -spec linux-clang ../test.pro
Info: creating stash file /Users/miro/Desktop/test/build/.qmake.stash
➜ build bear -- make
clang++ -c -pipe -O2 -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../../test -I. -I../../../Qt/5.15.13/clang_64/lib/QtGui.framework/Headers -I../../../Qt/5.15.13/clang_64/lib/QtCore.framework/Headers -I. -I/System/Library/Frameworks/OpenGL.framework/Headers -I/System/Library/Frameworks/AGL.framework/Headers/ -I../../../Qt/5.15.13/clang_64/mkspecs/linux-clang -o main.o ../main.cpp
In file included from ../main.cpp:1:
In file included from ../../../Qt/5.15.13/clang_64/lib/QtCore.framework/Headers/QCoreApplication:1:
../../../Qt/5.15.13/clang_64/lib/QtCore.framework/Headers/qcoreapplication.h:43:10: fatal error: 'QtCore/qglobal.h' file not found
#include <QtCore/qglobal.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [main.o] Error 1
➜ build cat compile_commands.json
[
{
"arguments": [
"/usr/bin/clang++",
"-c",
"-pipe",
"-O2",
"-std=gnu++1z",
"-Wall",
"-Wextra",
"-D_REENTRANT",
"-fPIC",
"-DQT_NO_DEBUG",
"-DQT_GUI_LIB",
"-DQT_CORE_LIB",
"-I../../test",
"-I.",
"-I../../../Qt/5.15.13/clang_64/lib/QtGui.framework/Headers",
"-I../../../Qt/5.15.13/clang_64/lib/QtCore.framework/Headers",
"-I.",
"-I/System/Library/Frameworks/OpenGL.framework/Headers",
"-I/System/Library/Frameworks/AGL.framework/Headers/",
"-I../../../Qt/5.15.13/clang_64/mkspecs/linux-clang",
"-o",
"main.o",
"../main.cpp"
],
"directory": "/Users/miro/Desktop/test/build",
"file": "/Users/miro/Desktop/test/main.cpp",
"output": "/Users/miro/Desktop/test/build/main.o"
}
]
Maintenant si je fais la même chose avec les specs macx j'ai:
`➜ test mkdir build && cd build
➜ build qmake -spec macx-clang ../test.pro
Info: creating stash file /Users/miro/Desktop/test/build/.qmake.stash
➜ build bear -- make
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++1z -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../../test -I. -I../../../Qt/5.15.13/clang_64/lib/QtGui.framework/Headers -I../../../Qt/5.15.13/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/AGL.framework/Headers -I../../../Qt/5.15.13/clang_64/mkspecs/macx-clang -F/Users/miro/Qt/5.15.13/clang_64/lib -o main.o ../main.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=10.13 -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,/Users/miro/Qt/5.15.13/clang_64/lib -o test main.o -F/Users/miro/Qt/5.15.13/clang_64/lib -framework QtGui -framework AppKit -framework Metal -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL
➜ cat compile_commands.json
[] -> renvoie un json vide`
Je n'est pour le moment pas trouvé la raison de ce soucis. Y'a bien un ticket sur github : https://github.com/rizsotto/Bear/issues/102 mais y'a pas de solution