From e8adae65feb26a16693490a3a1bc10d953e031d8 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 16 Mar 2023 15:40:50 +0000 Subject: [PATCH] debug: unbreak debug builds --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a262433..a9c972d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,15 @@ file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp") add_executable(Hyprland ${SRCFILES}) +if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG) + message(STATUS "Setting debug flags") + + target_link_libraries(Hyprland asan) + + add_compile_options(-pg -no-pie -fno-builtin -fsanitize=address) + add_link_options(-pg -no-pie -fno-builtin) +endif() + include(CheckLibraryExists) check_library_exists(execinfo backtrace "" HAVE_LIBEXECINFO) if(HAVE_LIBEXECINFO) @@ -123,15 +132,6 @@ message(STATUS "Setting link libraries") target_link_libraries(Hyprland PkgConfig::deps) -if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG) - message(STATUS "Setting debug flags") - - target_link_libraries(Hyprland asan) - - add_compile_options(-pg -no-pie -fno-builtin -fsanitize=address) - add_link_options(-pg -no-pie -fno-builtin) -endif() - target_link_libraries(Hyprland ${CMAKE_SOURCE_DIR}/subprojects/wlroots/build/libwlroots.so.12032 # wlroots is provided by us pixman-1