Skip to content

Commit

Permalink
Use modern cmake approach for flags. Fixed VS2015 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
James Moore authored and t-b committed Jul 6, 2020
1 parent cabfa93 commit 2e051a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,18 @@ foreach(file ${files})
add_executable(${testcase} $<TARGET_OBJECTS:doctest_main> ${file})
target_compile_definitions(${testcase} PRIVATE DOCTEST_CONFIG_SUPER_FAST_ASSERTS)
target_compile_options(${testcase} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/EHsc;$<$<CONFIG:Release>:/Od>>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated;-Wno-float-equal>
$<$<CXX_COMPILER_ID:MSVC>:/EHsc;/W4;/WX;$<$<CONFIG:Release>:/Od>>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated;-Wno-float-equal;-Wall;-Wextra;-pedantic;-Werror>
$<$<CXX_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
)
)

target_include_directories(${testcase} PRIVATE ${CMAKE_BINARY_DIR}/include thirdparty/doctest thirdparty/fifo_map)
target_link_libraries(${testcase} PRIVATE ${NLOHMANN_JSON_TARGET_NAME})

if (JSON_Coverage)
target_compile_options(${testcase} PRIVATE --coverage)
target_link_libraries(${testcase} PRIVATE --coverage)
endif()

add_test(NAME "${testcase}"
COMMAND ${testcase} ${DOCTEST_TEST_FILTER} --no-skip
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
Expand Down
2 changes: 2 additions & 0 deletions test/src/unit-allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ struct my_allocator : std::allocator<T>
{
if (next_deallocate_fails)
{
(void)p; // Ignored unused
(void)n; // ignored unused
next_deallocate_fails = false;
throw std::bad_alloc();
}
Expand Down

0 comments on commit 2e051a5

Please sign in to comment.