Returned basic warnings to CMake generated builds

This commit is contained in:
Martin Hořeňovský 2017-01-31 17:37:27 +01:00
parent 70d3c937c3
commit 7ae96c710b

View File

@ -238,6 +238,17 @@ include_directories(${HEADER_DIR})
add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${HEADERS}) add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${HEADERS})
add_executable(Benchmark ${BENCH_SOURCES} ${HEADERS}) add_executable(Benchmark ${BENCH_SOURCES} ${HEADERS})
# Add desired warnings
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
target_compile_options( SelfTest PRIVATE -Wall -Wextra )
target_compile_options( Benchmark PRIVATE -Wall -Wextra )
endif()
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options( SelfTest PRIVATE /W4 )
target_compile_options( Benchmark PRIVATE /W4 )
endif()
# configure unit tests via CTest # configure unit tests via CTest
enable_testing() enable_testing()
add_test(NAME RunTests COMMAND SelfTest) add_test(NAME RunTests COMMAND SelfTest)