1
0
mirror of https://github.com/hyprwm/Hyprland.git synced 2025-08-03 13:41:59 -07:00

cmake: make gprof optional for debug builds ()

This fixes the debug build on musl systems, as -pg option is specific to
glibc. Now we can build the project on such systems with -DUSE_GPROF=OFF
This commit is contained in:
Yaroslav
2024-05-17 15:06:31 +05:00
committed by GitHub
parent a66cfe0fbe
commit f91431465b

@@ -126,6 +126,8 @@ endif()
add_executable(Hyprland ${SRCFILES} ${TRACY_CPP_FILES})
add_dependencies(Hyprland wlroots-hyprland)
set(USE_GPROF ON)
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
message(STATUS "Setting debug flags")
@@ -151,8 +153,12 @@ if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
endif()
endif()
add_compile_options(-pg -no-pie -fno-builtin)
add_link_options(-pg -no-pie -fno-builtin)
add_compile_options(-fno-pie -fno-builtin)
add_link_options(-no-pie -fno-builtin)
if(USE_GPROF)
add_compile_options(-pg)
add_link_options(-pg)
endif()
endif()
check_include_file("execinfo.h" EXECINFOH)