From 00233b8111e47f17ead683874a3bdab1d3b1c0ba Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 4 Jul 2018 21:02:09 -0300 Subject: [PATCH 1/3] add USE_PROFILER to Cmake --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e91e80b57..b8b8845e45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,8 @@ if (USE_PCH) include (cotire) endif(USE_PCH) +option(USE_PROFILER "Build with GPROF support(Linux)." OFF) + IF( NOT WIN32 ) list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeModules" ) ENDIF( NOT WIN32 ) @@ -111,7 +113,11 @@ else( WIN32 ) # Apple AND Linux else( APPLE ) # Linux Specific Options Here message( STATUS "Configuring BitShares on Linux" ) - set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" ) + if(USE_PROFILER) + set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall -pg" ) + else(USE_PROFILER) + set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" ) + endif( USE_PROFILER ) set( rt_library rt ) set( pthread_library pthread) if ( NOT DEFINED crypto_library ) From ed368cd92ad43dc32389dc393d15ffe9911fd815 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Tue, 17 Jul 2018 15:17:48 -0300 Subject: [PATCH 2/3] keep the original line and append -pg --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8b8845e45..5f63a0b054 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,10 +113,9 @@ else( WIN32 ) # Apple AND Linux else( APPLE ) # Linux Specific Options Here message( STATUS "Configuring BitShares on Linux" ) + set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" ) if(USE_PROFILER) - set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall -pg" ) - else(USE_PROFILER) - set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg" ) endif( USE_PROFILER ) set( rt_library rt ) set( pthread_library pthread) From 1f435ee98f9246d46f97bc8432cf6330b306a538 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Mon, 30 Jul 2018 15:12:15 -0300 Subject: [PATCH 3/3] add profiler status message --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f63a0b054..cf16db8d91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,3 +208,7 @@ endif(LINUX) include(CPack) endif(ENABLE_INSTALLER) + +MESSAGE( STATUS "" ) +MESSAGE( STATUS "PROFILER: ${USE_PROFILER}" ) +MESSAGE( STATUS "" )