Skip to content

Commit

Permalink
Add profiling option with Clang via -ftime-trace (#146)
Browse files Browse the repository at this point in the history
Introduces a new option, ROUGHPY_PROFILE_BUILD, to enable profiling with Clang using the -ftime-trace flag. This option is only valid when using Clang and not Apple Clang.
  • Loading branch information
inakleinbottle authored Nov 8, 2024
1 parent b30275f commit 5ccd588
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmake/developer_options_setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ IF (CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
endif ()


cmake_dependent_option(ROUGHPY_PROFILE_BUILD
"Build with -ftime-trace when using Clang"
OFF
"CMAKE_CXX_COMPILER_ID MATCHES \"Clang\";NOT APPLE"
OFF)
if (ROUGHPY_PROFILE_BUILD)
add_compile_options("-ftime-trace")
endif()



# Essentially from Professional CMake 19th Edition pp 713-715
option(ROUGHPY_ROUGHPY_ENABLE_ASAN "Enable Address sanitizer" OFF)

Expand Down

0 comments on commit 5ccd588

Please sign in to comment.