Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1074: Add -mno-omit-leaf-frame-pointer conditionally #1131

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
cmake_minimum_required(VERSION 3.20)
project(skupper-router LANGUAGES C CXX)

include(CheckCCompilerFlag)
include(CheckLibraryExists)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckIncludeFiles)
include(CMakeDependentOption)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON) # gnu11
Expand All @@ -38,7 +45,11 @@ option(ENABLE_PROFILE_GUIDED_OPTIMIZATION "Perform profile guided optimization"

# preserve frame pointers for ease of debugging and profiling
# see https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer
add_compile_options(-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer)
add_compile_options(-fno-omit-frame-pointer)
check_c_compiler_flag(-mno-omit-leaf-frame-pointer CC_HAVE_MNO_OMIT_LEAF_FRAME_POINTER)
if(CC_HAVE_MNO_OMIT_LEAF_FRAME_POINTER)
add_compile_options(-mno-omit-leaf-frame-pointer)
endif()

# Set warning compile flags
set(C_WARNING_GNU -Wall -Wextra -Wpedantic -pedantic-errors
Expand Down Expand Up @@ -154,12 +165,6 @@ endif(NOT DEFINED VERSION)

message(STATUS "Setting skupper-router version to ${QPID_DISPATCH_VERSION}")

include(CheckLibraryExists)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckIncludeFiles)
include(CMakeDependentOption)

##
## Find dependencies
##
Expand Down