Skip to content

Commit

Permalink
feat: add compile_commands.json output to make debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
virchau13 committed Apr 28, 2024
1 parent 2e76376 commit d46c576
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d46c576

Please sign in to comment.