Skip to content

Commit

Permalink
build: cmake: enabling frame pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
spalicki committed Dec 9, 2024
1 parent 40f939c commit 08119c8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmake/platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ endif()
if(MSVC)
set(USERCONFIG_PLATFORM "x64")
append_if(DNNL_WERROR CMAKE_CCXX_FLAGS "/WX")

# Generating frame pointers for easier performance profiling
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
append(CMAKE_CCXX_FLAGS "-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer")
else()
append(CMAKE_CCXX_FLAGS "/Oy-")
endif()

if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
append(CMAKE_CCXX_FLAGS "/MP")
# increase number of sections in obj file
Expand Down Expand Up @@ -233,6 +241,9 @@ elseif(UNIX OR MINGW)
append(CMAKE_CCXX_FLAGS "-Wsign-compare")
endif()

# Generating frame pointers for easier performance profiling
append(CMAKE_CCXX_FLAGS "-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer")

platform_unix_and_mingw_common_ccxx_flags(CMAKE_CCXX_FLAGS)
platform_unix_and_mingw_common_cxx_flags(CMAKE_CXX_FLAGS)
platform_unix_and_mingw_noexcept_ccxx_flags(CMAKE_CMAKE_CCXX_NOEXCEPT_FLAGS)
Expand Down

0 comments on commit 08119c8

Please sign in to comment.