mirror of
https://github.com/BlackMATov/promise.hpp.git
synced 2025-12-13 11:56:26 +07:00
fix #25 warning
This commit is contained in:
@@ -1270,11 +1270,12 @@ namespace promise_hpp
|
|||||||
try {
|
try {
|
||||||
auto context = std::make_shared<tuple_promise_context_t<
|
auto context = std::make_shared<tuple_promise_context_t<
|
||||||
std::tuple_element_t<Is, ResultTuple>...>>();
|
std::tuple_element_t<Is, ResultTuple>...>>();
|
||||||
std::make_tuple(make_tuple_sub_promise_impl<Is>(
|
auto promises = std::make_tuple(make_tuple_sub_promise_impl<Is>(
|
||||||
tuple,
|
tuple,
|
||||||
resolver,
|
resolver,
|
||||||
rejector,
|
rejector,
|
||||||
context)...);
|
context)...);
|
||||||
|
(void)promises;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
result.reject(std::current_exception());
|
result.reject(std::current_exception());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,18 +3,9 @@ cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
|
|||||||
|
|
||||||
project(promise.hpp.untests)
|
project(promise.hpp.untests)
|
||||||
|
|
||||||
set(CATCH_BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
#
|
||||||
|
# coverage
|
||||||
include(FetchContent)
|
#
|
||||||
FetchContent_Declare(
|
|
||||||
catch2
|
|
||||||
GIT_REPOSITORY https://github.com/catchorg/catch2)
|
|
||||||
|
|
||||||
FetchContent_GetProperties(catch2)
|
|
||||||
if(NOT catch2_POPULATED)
|
|
||||||
FetchContent_Populate(catch2)
|
|
||||||
add_subdirectory(${catch2_SOURCE_DIR} ${catch2_BINARY_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(BUILD_WITH_COVERAGE "Build with coverage" OFF)
|
option(BUILD_WITH_COVERAGE "Build with coverage" OFF)
|
||||||
if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
|
if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
|
||||||
@@ -24,16 +15,13 @@ if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
|
|||||||
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# executable
|
||||||
|
#
|
||||||
|
|
||||||
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp")
|
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp")
|
||||||
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
||||||
|
target_link_libraries(${PROJECT_NAME} promise.hpp)
|
||||||
target_link_libraries(${PROJECT_NAME}
|
|
||||||
Catch2
|
|
||||||
promise.hpp)
|
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
|
||||||
Threads::Threads)
|
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME}
|
target_compile_options(${PROJECT_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
@@ -44,3 +32,22 @@ target_compile_options(${PROJECT_NAME}
|
|||||||
-Wall -Wextra -Wpedantic>)
|
-Wall -Wextra -Wpedantic>)
|
||||||
|
|
||||||
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
||||||
|
|
||||||
|
#
|
||||||
|
# dependencies
|
||||||
|
#
|
||||||
|
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
target_link_libraries(${PROJECT_NAME} Threads::Threads)
|
||||||
|
|
||||||
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(
|
||||||
|
catch2
|
||||||
|
GIT_REPOSITORY https://github.com/catchorg/catch2)
|
||||||
|
|
||||||
|
FetchContent_GetProperties(catch2)
|
||||||
|
if(NOT catch2_POPULATED)
|
||||||
|
FetchContent_Populate(catch2)
|
||||||
|
target_include_directories(${PROJECT_NAME}
|
||||||
|
PRIVATE ${catch2_SOURCE_DIR}/single_include)
|
||||||
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user