mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
build-system: add option to enable profiling
Simply nice to have - even though it didn't help me track down the issue this time around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
94b8d4070f
commit
285f5661ea
1 changed files with 10 additions and 0 deletions
|
@ -24,6 +24,9 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
|
|||
"We don't support building in source, please create a build folder elsewhere and remember to run git clean -xdf to remove temporary files created by CMake."
|
||||
)
|
||||
|
||||
#Option for profiling
|
||||
option(SUBSURFACE_PROFILING_BUILD "enable profiling of Subsurface binary" OFF)
|
||||
|
||||
#Options regarding usage of pkgconfig
|
||||
option(LIBGIT2_FROM_PKGCONFIG "use pkg-config to retrieve libgit2" OFF)
|
||||
option(LIBDC_FROM_PKGCONFIG "use pkg-config to retrieve libdivecomputer" OFF)
|
||||
|
@ -97,6 +100,13 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|||
# using Visual Studio C++
|
||||
endif()
|
||||
|
||||
# set up profiling
|
||||
if (SUBSURFACE_PROFILING_BUILD)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
|
||||
endif()
|
||||
|
||||
# every compiler understands -Wall
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
|
|
Loading…
Reference in a new issue