diff --git a/.clangd b/.clangd new file mode 100644 index 0000000000..5d49a0191e --- /dev/null +++ b/.clangd @@ -0,0 +1,2 @@ +CompileFlags: + CompilationDatabase: build.tooldata/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1fc6e218e8..f660df1186 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ build.release build.debug build.install +build.tooldata build.qtc build-* win32build diff --git a/.vscode/settings.json b/.vscode/settings.json index ebf4014c41..707a2696e3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -48,5 +48,6 @@ "qcombobox": "cpp" }, "cmake.buildDirectory": "${workspaceRoot}/build.debug", - "cmake.configureOnOpen": true + "cmake.configureOnOpen": true, + "uncrustify.configPath.linux": "tools/codestyle/uncrustify_musescore.cfg" } \ No newline at end of file diff --git a/ninja_build.sh b/ninja_build.sh index 6ff0cf180f..605126483b 100755 --- a/ninja_build.sh +++ b/ninja_build.sh @@ -135,6 +135,36 @@ case $TARGET in clean) rm -rf build.debug build.release ;; + + compile_commands) + # Generate compile_commands.json file (https://clang.llvm.org/docs/JSONCompilationDatabase.html) + mkdir -p build.tooldata + cd build.tooldata + cmake .. -GNinja \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ + -DMUE_COMPILE_USE_UNITY=OFF \ + -DCMAKE_BUILD_TYPE="Debug" \ + -DCMAKE_INSTALL_PREFIX="${MUSESCORE_INSTALL_DIR}" \ + -DMUSESCORE_INSTALL_SUFFIX="${MUSESCORE_INSTALL_SUFFIX}" \ + -DMUSESCORE_BUILD_CONFIGURATION="${MUSESCORE_BUILD_CONFIGURATION}" \ + -DMUSESCORE_BUILD_MODE="${MUSESCORE_BUILD_MODE}" \ + -DCMAKE_BUILD_NUMBER="${MUSESCORE_BUILD_NUMBER}" \ + -DMUSESCORE_REVISION="${MUSESCORE_REVISION}" \ + -DMUE_RUN_LRELEASE="${MUSESCORE_RUN_LRELEASE}" \ + -DMUE_BUILD_VST_MODULE="${MUSESCORE_BUILD_VST_MODULE}" \ + -DMUE_BUILD_VIDEOEXPORT_MODULE="${MUSESCORE_BUILD_VIDEOEXPORT_MODULE}" \ + -DMUE_LEARN_YOUTUBE_API_KEY="${MUSESCORE_YOUTUBE_API_KEY}" \ + -DMUE_BUILD_UPDATE_MODULE="${MUSESCORE_BUILD_UPDATE_MODULE}" \ + -DMUE_DOWNLOAD_SOUNDFONT="${MUSESCORE_DOWNLOAD_SOUNDFONT}" \ + -DMUE_BUILD_UNIT_TESTS="${MUSESCORE_BUILD_UNIT_TESTS}" \ + -DMUE_BUILD_CRASHPAD_CLIENT="${MUSESCORE_BUILD_CRASHPAD_CLIENT}" \ + -DMUE_CRASH_REPORT_URL="${MUSESCORE_CRASHREPORT_URL}" \ + -DMUE_LOGGER_DEBUGLEVEL_ENABLED="${MUSESCORE_DEBUGLEVEL_ENABLED}" \ + -DVST3_SDK_PATH="${MUSESCORE_VST3_SDK_PATH}" \ + -DCMAKE_SKIP_RPATH="${MUSESCORE_NO_RPATH}" \ + + + ;; revision) git rev-parse --short=7 HEAD | tr -d '\n' > local_build_revision.env