g3log/test_performance/Performance.cmake

41 lines
1.5 KiB
CMake
Raw Normal View History

# 2. performance test (average + worst case) for KjellKod's g3log
# Do 'cmake -DUSE_G3LOG_PERFORMANCE=ON' to enable this
option (USE_G3LOG_PERFORMANCE "g3log performance test" OFF)
2014-10-03 00:56:13 -06:00
# 2. create the g3log's performance tests
2014-10-03 00:56:13 -06:00
# =========================
IF (USE_G3LOG_PERFORMANCE)
2014-10-03 00:56:13 -06:00
set(DIR_PERFORMANCE ${g3log_SOURCE_DIR}/test_performance)
MESSAGE("-DUSE_G3LOG_PERFORMANCE=ON")
2014-10-03 00:56:13 -06:00
include_directories (${DIR_PERFORMANCE})
# MEAN PERFORMANCE TEST
add_executable(g3log-performance-threaded_mean
2014-10-03 00:56:13 -06:00
${DIR_PERFORMANCE}/main_threaded_mean.cpp
${DIR_PERFORMANCE}/performance.h)
# Turn on G3LOG performance flag
set_target_properties(g3log-performance-threaded_mean PROPERTIES
2014-10-03 00:56:13 -06:00
COMPILE_DEFINITIONS "G2LOG_PERFORMANCE=1")
target_link_libraries(g3log-performance-threaded_mean
2014-10-03 00:56:13 -06:00
${G3LOG_LIBRARY} ${PLATFORM_LINK_LIBRIES})
# WORST CASE PERFORMANCE TEST
add_executable(g3log-performance-threaded_worst
2014-10-03 00:56:13 -06:00
${DIR_PERFORMANCE}/main_threaded_worst.cpp ${DIR_PERFORMANCE}/performance.h)
# Turn on G3LOG performance flag
set_target_properties(g3log-performance-threaded_worst PROPERTIES
2014-10-03 00:56:13 -06:00
COMPILE_DEFINITIONS "G2LOG_PERFORMANCE=1")
target_link_libraries(g3log-performance-threaded_worst
2014-10-03 00:56:13 -06:00
${G3LOG_LIBRARY} ${PLATFORM_LINK_LIBRIES})
ELSE()
MESSAGE("-DUSE_G3LOG_PERFORMANCE=OFF")
ENDIF(USE_G3LOG_PERFORMANCE)
2014-10-03 00:56:13 -06:00