debug: unbreak debug builds

This commit is contained in:
vaxerski 2023-03-16 15:40:50 +00:00
parent 96718d8b09
commit e8adae65fe

View file

@ -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