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

Add gprof profiling support. #7547

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,13 @@ elseif(MSVC)
add_compile_options("/utf-8")
ENDIF()

# gcc builds support gprof for profiling, should not be used for release builds because
# -fomit-frame-pointer clashes with -pg
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
Rossmaxx marked this conversation as resolved.
Show resolved Hide resolved
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
Rossmaxx marked this conversation as resolved.
Show resolved Hide resolved
endif()

# add enabled sanitizers
function(add_sanitizer sanitizer supported_compilers want_flag status_flag)
if(${want_flag})
Expand Down
6 changes: 5 additions & 1 deletion plugins/LadspaEffect/swh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ ENDIF()
# Additional compile flags
if(NOT MSVC)
set(COMPILE_FLAGS ${COMPILE_FLAGS} -O3 -c
-fomit-frame-pointer -funroll-loops -ffast-math -fno-strict-aliasing
-funroll-loops -ffast-math -fno-strict-aliasing
${PIC_FLAGS}
)
# an optimisation flag, but makes it harder to debug
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(COMPILE_FLAGS ${COMPILE_FLAGS} -fomit-frame-pointer)
Rossmaxx marked this conversation as resolved.
Show resolved Hide resolved
endif()
endif()

# Loop over every XML file
Expand Down
7 changes: 6 additions & 1 deletion plugins/LadspaEffect/tap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ LIST(SORT PLUGIN_SOURCES)
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:fast")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fno-strict-aliasing -funroll-loops -ffast-math")

# an optimisation flag, but makes it harder to debug
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(COMPILE_FLAGS "${COMPILE_FLAGS} -fomit-frame-pointer")
endif()
endif()
FOREACH(_item ${PLUGIN_SOURCES})
GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE)
Expand Down
Loading