-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
99 lines (83 loc) · 2.64 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
cmake_minimum_required(VERSION 3.10)
project(vmtest)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${vmtest_SOURCE_DIR}/cmake")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_DEBUG_TARGET_PROPERTIES INCLUDE_DIRECTORIES)
enable_testing()
#include(cotire)
# languages
add_subdirectory(deps/lua-5.1.5) # liblua51
add_subdirectory(deps/lua-5.3.5) # liblua53
add_subdirectory(deps/duktape-2.4.0) # libduktape
include(wren)
include(luajit) # libluajit
include(v8)
# other
SET(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "X" FORCE)
SET(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "X" FORCE)
SET(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "X" FORCE)
add_subdirectory(deps/benchmark)
# shared config
if(MSVC)
add_compile_options(/W4 /WX)
else()
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()
add_compile_definitions("$<$<CONFIG:DEBUG>:DEBUG>")
set(TEST_ARGS --benchmark_format=json)
# executables
add_executable(test-lua51
lua/benchmarks.cpp
)
target_compile_definitions(test-lua51 PRIVATE LUA_51=1)
target_link_libraries(test-lua51 liblua51 benchmark_main)
add_test(NAME lua51
COMMAND test-lua51 ${TEST_ARGS} --benchmark_out=${CMAKE_BINARY_DIR}/lua51.json
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/lua"
)
add_executable(test-lua53
lua/benchmarks.cpp
)
target_compile_definitions(test-lua53 PRIVATE LUA_53=1)
target_link_libraries(test-lua53 liblua53 benchmark_main)
add_test(NAME lua53
COMMAND test-lua53 ${TEST_ARGS} --benchmark_out=${CMAKE_BINARY_DIR}/lua53.json
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/lua"
)
add_executable(test-luajit
lua/benchmarks.cpp
)
target_compile_definitions(test-luajit PRIVATE LUA_51=1)
target_link_libraries(test-luajit libluajit benchmark_main)
add_test(NAME luajit
COMMAND test-luajit ${TEST_ARGS} --benchmark_out=${CMAKE_BINARY_DIR}/luajit.json
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/lua"
)
add_executable(test-duktape
js/duk_console.c
js/duktape-benchmarks.cpp
)
target_link_libraries(test-duktape libduktape benchmark_main)
add_test(NAME duktape
COMMAND test-duktape ${TEST_ARGS} --benchmark_out=${CMAKE_BINARY_DIR}/duktape.json
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/js"
)
add_executable(test-v8
js/v8-benchmarks.cpp
)
target_link_libraries(test-v8 libv8 benchmark) # custom main fn
add_test(NAME v8
COMMAND test-v8 ${TEST_ARGS} --benchmark_out=${CMAKE_BINARY_DIR}/v8.json
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/js"
)
add_executable(test-wren
wren/benchmarks.cpp
)
target_link_libraries(test-wren wren benchmark_main)
add_test(NAME wren
COMMAND test-wren ${TEST_ARGS} --benchmark_out=${CMAKE_BINARY_DIR}/wren.json
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/wren"
)
#cotire(vmtest)