aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorYaroslav <[email protected]>2024-05-17 15:06:31 +0500
committerGitHub <[email protected]>2024-05-17 11:06:31 +0100
commitf91431465b910b1acfc352d2425310beb34b7598 (patch)
tree7be18f4fe2cbf2d9e09cb0beba4a29c89c796e69 /CMakeLists.txt
parenta66cfe0fbed7fb4dc69383e107c2bf3b1e7cd80a (diff)
downloadHyprland-f91431465b910b1acfc352d2425310beb34b7598.tar.gz
Hyprland-f91431465b910b1acfc352d2425310beb34b7598.zip
cmake: make gprof optional for debug builds (#6120)
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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b30591d9..43927fbe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)