CMake: Add benchmarks

Put each benchmark application in a sub-directory instead of specifying all in one
file, because cotire cannot create PCH targets for the same file twice (bench.cpp).
This commit is contained in:
Maarten Bent
2021-02-07 20:15:37 +01:00
parent 7b79423470
commit 9585e08365
7 changed files with 102 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
#############################################################################
# Name: build/cmake/benchmarks/CMakeLists.txt
# Purpose: CMake file for benchmarks
# Author: Maarten Bent
# Created: 2021-02-07
# Copyright: (c) 2021 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
add_subdirectory(bench)
add_subdirectory(bench_graphics)
add_subdirectory(bench_gui)

View File

@@ -0,0 +1,34 @@
#############################################################################
# Name: build/cmake/benchmarks/bench/CMakeLists.txt
# Purpose: CMake file for benchmarks
# Author: Maarten Bent
# Created: 2021-02-07
# Copyright: (c) 2021 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(BENCH_SRC
bench.cpp
bench.h
datetime.cpp
htmlparser/htmlpars.cpp
htmlparser/htmlpars.h
htmlparser/htmltag.cpp
htmlparser/htmltag.h
ipcclient.cpp
log.cpp
mbconv.cpp
printfbench.cpp
strings.cpp
tls.cpp
)
set(BENCH_DATA
htmltest.html
)
wx_add_benchmark(bench CONSOLE ${BENCH_SRC} DATA ${BENCH_DATA})
if(wxUSE_SOCKETS)
wx_exe_link_libraries(bench wxnet)
endif()

View File

@@ -0,0 +1,18 @@
#############################################################################
# Name: build/cmake/benchmarks/bench_graphics/CMakeLists.txt
# Purpose: CMake file for benchmarks
# Author: Maarten Bent
# Created: 2021-02-07
# Copyright: (c) 2021 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(BENCH_GRAPGICS_SRC
graphics.cpp
)
wx_add_benchmark(bench_graphics CONSOLE_GUI ${BENCH_GRAPGICS_SRC})
if(wxUSE_OPENGL)
wx_exe_link_libraries(bench_graphics wxgl)
endif()

View File

@@ -0,0 +1,24 @@
#############################################################################
# Name: build/cmake/benchmarks/bench_gui/CMakeLists.txt
# Purpose: CMake file for benchmarks
# Author: Maarten Bent
# Created: 2021-02-07
# Copyright: (c) 2021 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
set(BENCH_GUI_SRC
bench.cpp
bench.h
display.cpp
image.cpp
)
set(IMAGE_DATA
../../samples/image/horse.bmp:horse.bmp
../../samples/image/horse.jpg:horse.jpg
../../samples/image/horse.png:horse.png
../../samples/image/horse.tif:horse.tif
)
wx_add_benchmark(bench_gui CONSOLE_GUI ${BENCH_GUI_SRC} DATA ${IMAGE_DATA})