From 4b5f5afaeb03acc02ea946918612115ce608d10a Mon Sep 17 00:00:00 2001 From: Vir Chaudhury Date: Sun, 28 Apr 2024 08:59:50 +0800 Subject: [PATCH] feat: add compile_commands.json output to `make debug` build --- CMakeLists.txt | 2 +- Makefile | 3 ++- src/includes.hpp | 6 ------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16419981..1b467220 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,7 +180,7 @@ if(NO_XWAYLAND) add_compile_definitions(NO_XWAYLAND) else() message(STATUS "XWAYLAND Enabled (NO_XWAYLAND not defined) checking deps...") - pkg_check_modules(xdeps REQUIRED IMPORTED_TARGET xcb xwayland xcb-util xcb-render xcb-xfixes xcb-icccm xcb-composite xcb-res xcb-ewmh) + pkg_check_modules(xdeps REQUIRED IMPORTED_TARGET xcb xcb-render xcb-xfixes xcb-icccm xcb-composite xcb-res xcb-ewmh) pkg_check_modules(xcb_errors IMPORTED_TARGET xcb-errors) target_link_libraries(Hyprland PkgConfig::xdeps) if(xcb_errors_FOUND) diff --git a/Makefile b/Makefile index cd93173b..c7b7a683 100644 --- a/Makefile +++ b/Makefile @@ -16,9 +16,10 @@ release: chmod -R 777 ./build debug: - cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -S . -B ./build -G Ninja + cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -S . -B ./build -G Ninja cmake --build ./build --config Debug --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` chmod -R 777 ./build + ln -s build/compile_commands.json compile_commands.json || true nopch: cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON -S . -B ./build -G Ninja diff --git a/src/includes.hpp b/src/includes.hpp index 7f679f97..e15f5cb6 100644 --- a/src/includes.hpp +++ b/src/includes.hpp @@ -1,11 +1,5 @@ #pragma once -// because C/C++ VS Code intellisense is stupid with includes, we will suppress them here. -// This suppresses all "include file not found" errors. -#ifdef __INTELLISENSE__ -#pragma diag_suppress 1696 -#endif - #include #include #include