mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Initial work on benchmarking
This commit is contained in:
parent
ede7a4a72b
commit
2b4f31c121
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -10,3 +10,6 @@
|
|||||||
[submodule "dep/asio/asio"]
|
[submodule "dep/asio/asio"]
|
||||||
path = dep/asio/asio
|
path = dep/asio/asio
|
||||||
url = https://github.com/chriskohlhoff/asio.git
|
url = https://github.com/chriskohlhoff/asio.git
|
||||||
|
[submodule "dep/benchmark/benchmark"]
|
||||||
|
path = dep/benchmark/benchmark
|
||||||
|
url = https://github.com/google/benchmark.git
|
||||||
|
|||||||
@ -33,6 +33,10 @@ option(CTI_CONTINUABLE_WITH_EXAMPLES
|
|||||||
"Build the continuable examples"
|
"Build the continuable examples"
|
||||||
${IS_TOP_LEVEL_PROJECT})
|
${IS_TOP_LEVEL_PROJECT})
|
||||||
|
|
||||||
|
option(CTI_CONTINUABLE_WITH_BENCHMARKS
|
||||||
|
"Build the continuable benchmarks"
|
||||||
|
${IS_TOP_LEVEL_PROJECT})
|
||||||
|
|
||||||
option(CTI_CONTINUABLE_WITH_NO_EXCEPTIONS
|
option(CTI_CONTINUABLE_WITH_NO_EXCEPTIONS
|
||||||
"Disable exception support"
|
"Disable exception support"
|
||||||
OFF)
|
OFF)
|
||||||
|
|||||||
@ -2,12 +2,24 @@ if(NOT TARGET function2)
|
|||||||
add_subdirectory(function2)
|
add_subdirectory(function2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CTI_CONTINUABLE_WITH_TESTS OR CTI_CONTINUABLE_WITH_EXAMPLES)
|
if (CTI_CONTINUABLE_WITH_TESTS OR CTI_CONTINUABLE_WITH_BENCHMARKS)
|
||||||
if(NOT TARGET gtest)
|
if(NOT TARGET gtest)
|
||||||
add_subdirectory(googletest)
|
add_subdirectory(googletest)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CTI_CONTINUABLE_WITH_EXAMPLES)
|
||||||
if(NOT TARGET asio)
|
if(NOT TARGET asio)
|
||||||
add_subdirectory(asio)
|
add_subdirectory(asio)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (CTI_CONTINUABLE_WITH_BENCHMARKS)
|
||||||
|
if(NOT TARGET benchmark)
|
||||||
|
add_subdirectory(benchmark)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT TARGET boost)
|
||||||
|
add_subdirectory(boost)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|||||||
9
dep/benchmark/CMakeLists.txt
Normal file
9
dep/benchmark/CMakeLists.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
set(BENCHMARK_ENABLE_TESTING OFF)
|
||||||
|
if (CTI_CONTINUABLE_WITHOUT_EXCEPTIONS)
|
||||||
|
set(BENCHMARK_ENABLE_EXCEPTIONS OFF)
|
||||||
|
else()
|
||||||
|
set(BENCHMARK_ENABLE_EXCEPTIONS ON)
|
||||||
|
endif()
|
||||||
|
set(BENCHMARK_ENABLE_INSTALL OFF)
|
||||||
|
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
|
||||||
|
add_subdirectory(benchmark)
|
||||||
1
dep/benchmark/benchmark
Submodule
1
dep/benchmark/benchmark
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit b1717916d1acafbd0753c145f30f76b06f2933e5
|
||||||
38
dep/boost/CMakeLists.txt
Normal file
38
dep/boost/CMakeLists.txt
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
if(WIN32)
|
||||||
|
if(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||||
|
set(PLATFORM 64)
|
||||||
|
else()
|
||||||
|
set(PLATFORM 32)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(DEFINED ENV{BOOST_ROOT})
|
||||||
|
set(BOOST_ROOT $ENV{BOOST_ROOT})
|
||||||
|
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/lib${PLATFORM}-msvc-14.1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(Boost_USE_STATIC_LIBS ON)
|
||||||
|
set(Boost_USE_MULTITHREADED ON)
|
||||||
|
set(Boost_USE_STATIC_RUNTIME OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(Boost 1.68 REQUIRED
|
||||||
|
COMPONENTS
|
||||||
|
system
|
||||||
|
iostreams)
|
||||||
|
|
||||||
|
if (${Boost_FOUND})
|
||||||
|
add_library(boost INTERFACE)
|
||||||
|
|
||||||
|
target_link_libraries(boost
|
||||||
|
INTERFACE
|
||||||
|
Boost::system
|
||||||
|
Boost::iostreams)
|
||||||
|
|
||||||
|
target_compile_definitions(boost
|
||||||
|
INTERFACE
|
||||||
|
BOOST_ALL_NO_LIB
|
||||||
|
BOOST_ASIO_DISABLE_BOOST_DATE_TIME
|
||||||
|
BOOST_ASIO_DISABLE_BOOST_REGEX
|
||||||
|
BOOST_RANGE_ENABLE_CONCEPT_ASSERT=0
|
||||||
|
BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||||
|
endif()
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
if(ON)
|
||||||
add_library(gtest STATIC
|
add_library(gtest STATIC
|
||||||
${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/src/gtest-all.cc)
|
${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/src/gtest-all.cc)
|
||||||
|
|
||||||
@ -42,3 +43,10 @@ target_include_directories(gmock
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/googletest/googlemock
|
${CMAKE_CURRENT_LIST_DIR}/googletest/googlemock
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${CMAKE_CURRENT_LIST_DIR}/googletest/googlemock/include)
|
${CMAKE_CURRENT_LIST_DIR}/googletest/googlemock/include)
|
||||||
|
|
||||||
|
else()
|
||||||
|
set(BUILD_GTEST ON)
|
||||||
|
set(BUILD_GMOCK OFF)
|
||||||
|
set(INSTALL_GTEST OFF)
|
||||||
|
add_subdirectory(googletest)
|
||||||
|
endif()
|
||||||
|
|||||||
@ -8,6 +8,7 @@ target_include_directories(test-continuable-base
|
|||||||
|
|
||||||
target_link_libraries(test-continuable-base
|
target_link_libraries(test-continuable-base
|
||||||
PUBLIC
|
PUBLIC
|
||||||
|
gtest
|
||||||
gtest-main
|
gtest-main
|
||||||
continuable
|
continuable
|
||||||
continuable-features-flags
|
continuable-features-flags
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user