Fix qmlls & clang LSP issues

This makes cmake export the qmlls.ini settings for qmlls (lang server),
which makes it aware of the C++ components used in the project. By
default, qmlls wasn't able to find these as they lived in a separate
build dir which it didn't know about.

Additionally, this also enables exporting compile commands to provide
better support for other editors that rely on these. Note that the
compile_commands.json will still only be exported into the build dir
though, so to make use of this, you'll probably want to symlink this
from the build dir.
This commit is contained in:
ItsDrike 2024-12-05 01:22:57 +01:00
parent cb75fde6d7
commit 529753b078
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
2 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View file

@ -29,6 +29,7 @@ Thumbs.db
*.rc
/.qmake.cache
/.qmake.stash
compile_commands.json
# qtcreator generated files
*.pro.user*

View file

@ -4,8 +4,10 @@ project(Solitare VERSION 0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 6.5 REQUIRED COMPONENTS Quick)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(QT_QML_GENERATE_QMLLS_INI ON)
find_package(Qt6 6.5 REQUIRED COMPONENTS Quick)
qt_standard_project_setup(REQUIRES 6.5)
set(CMAKE_AUTORCC ON)