Skip to content

Commit

Permalink
B Turn off "warnings as errors"
Browse files Browse the repository at this point in the history
This will allow this project to build in Visual Studio,
until approvals/ApprovalTests.cpp#154
is fixed.
  • Loading branch information
claremacrae committed Nov 9, 2020
1 parent eec6d60 commit f18b922
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ target_link_libraries(${TEST_NAME} StarterProject.code ApprovalTests::ApprovalTe
target_compile_definitions(${TEST_NAME} PRIVATE -DAPPROVAL_TESTS_HIDE_DEPRECATED_CODE=1)
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
target_compile_options(StarterProject.tests PRIVATE
/W4
/WX
)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(StarterProject.tests PRIVATE
-Wall
-Wextra
-Wpedantic
-Werror
)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
target_compile_options(StarterProject.tests PRIVATE
/W4
/WX
)
endif()
#if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
# target_compile_options(StarterProject.tests PRIVATE
# /W4
# /WX
# )
#elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# target_compile_options(StarterProject.tests PRIVATE
# -Wall
# -Wextra
# -Wpedantic
# -Werror
# )
#elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# target_compile_options(StarterProject.tests PRIVATE
# /W4
# /WX
# )
#endif()

0 comments on commit f18b922

Please sign in to comment.