Commit a7172f83 authored by Johan Pascal's avatar Johan Pascal

Enable profiling with GCC

parent b9850bfb
......@@ -36,6 +36,7 @@ option(ENABLE_STRICT "Build with strict compile options." YES)
option(ENABLE_CURVE25519 "Enable support of Curve 25519." YES)
option(ENABLE_CURVE448 "Enable support of Curve 448(goldilock)." YES)
option(ENABLE_UNIT_TESTS "Enable compilation of unit tests." YES)
option(ENABLE_PROFILING "Enable profiling, GCC only" NO)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......@@ -84,6 +85,9 @@ if(MSVC)
list(APPEND STRICT_OPTIONS_CPP "/WX")
endif()
else()
if (ENABLE_PROFILING)
list(APPEND STRICT_OPTIONS_CXX "-g -pg")
endif()
list(APPEND STRICT_OPTIONS_CXX "-std=c++11")
#list(APPEND STRICT_OPTIONS_CPP "-Wall" "-Wuninitialized" "-Wno-error=deprecated-declarations") # turn off deprecated-declaration warning to avoid being flooded by soci.h
list(APPEND STRICT_OPTIONS_CPP "-Wall" "-Wuninitialized" "-Wno-deprecated-declarations" "-Wno-missing-field-initializers")
......
......@@ -53,6 +53,9 @@ if(ENABLE_STATIC)
set_target_properties(lime-static PROPERTIES OUTPUT_NAME lime)
target_include_directories(lime-static PUBLIC ${BCTOOLBOX_INCLUDE_DIRS} ${SOCI_INCLUDE_DIRS} ${SOCI_INCLUDE_DIRS}/soci)
target_link_libraries(lime-static INTERFACE ${BCTOOLBOX_CORE_LIBRARIES} ${SOCI_LIBRARIES} ${SOCI_sqlite3_PLUGIN})
if(ENABLE_PROFILING)
set_target_properties(lime-static PROPERTIES LINK_FLAGS "-pg")
endif()
endif()
if(ENABLE_SHARED)
add_library(lime SHARED ${LIME_HEADER_FILES} ${LIME_SOURCE_FILES_C} ${LIME_SOURCE_FILES_CXX})
......
......@@ -77,5 +77,9 @@ else()
# lime test suit request a local server to be launched, so keep testing double ratchet only for now
add_test(NAME double_ratchet COMMAND lime_tester --verbose --resource-dir ${CMAKE_CURRENT_SOURCE_DIR} --suite "double ratchet")
if(ENABLE_PROFILING)
set_target_properties(lime_tester PROPERTIES LINK_FLAGS "-pg")
endif()
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment