Skip to content

Commit

Permalink
Added IHFT_PERF_PROFILING option for perf usage
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeny Proydakov <[email protected]>
  • Loading branch information
proydakov committed Mar 19, 2024
1 parent 301a4c7 commit 31851fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .cmake/icompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ macro(ihft_setup_compiler_flags)
message(FATAL_ERROR "Unknown compiler")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gdwarf-4")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-4")

if(IHFT_MARCH_NATIVE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()

if(IHFT_PERF_PROFILING)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")

if(NOT IHFT_LINK_STATIC)
Expand Down
1 change: 1 addition & 0 deletions .cmake/ioption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ option(IHFT_SANITIZER_THREAD "Using thread sanitizers for project." OFF)
option(IHFT_SANITIZER_UB "Using undefined behavior sanitizer for project." OFF)
option(IHFT_BUILD_UNITTESTS "Build unit tests for project." ON)
option(IHFT_BUILD_TOML "Build tomlplusplus library for parsing configurations." ON)
option(IHFT_PERF_PROFILING "Use -fno-omit-frame-pointer compile flag." ON)

0 comments on commit 31851fb

Please sign in to comment.