From 7020c467729ec319821116f4ff9aea7667138d37 Mon Sep 17 00:00:00 2001 From: teskann Date: Mon, 30 May 2022 13:14:27 +0200 Subject: [PATCH] Added warnings at compile --- cmake/build_example.cmake | 5 ++++- cmake/build_lib.cmake | 5 ++++- examples/example.cpp | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/build_example.cmake b/cmake/build_example.cmake index 369cb37..771618c 100644 --- a/cmake/build_example.cmake +++ b/cmake/build_example.cmake @@ -1,4 +1,7 @@ include(cmake/build_lib.cmake) add_executable(blns_example examples/example.cpp) -target_link_libraries(blns_example PRIVATE lib_blns) \ No newline at end of file +target_link_libraries(blns_example PRIVATE lib_blns) +target_compile_options(blns_example PRIVATE + $<$:/W4 /WX> + $<$>:-Wall -Wextra -Wpedantic -Werror>) \ No newline at end of file diff --git a/cmake/build_lib.cmake b/cmake/build_lib.cmake index 1ddf55f..7537126 100644 --- a/cmake/build_lib.cmake +++ b/cmake/build_lib.cmake @@ -3,4 +3,7 @@ add_library(lib_blns STATIC src/blns/blns.cpp) target_include_directories(lib_blns PUBLIC ${PROJECT_SOURCE_DIR}/include - ) \ No newline at end of file + ) +target_compile_options(lib_blns PRIVATE + $<$:/W4 /WX> + $<$>:-Wall -Wextra -Wpedantic -Werror>) \ No newline at end of file diff --git a/examples/example.cpp b/examples/example.cpp index 1e0c537..054bcba 100644 --- a/examples/example.cpp +++ b/examples/example.cpp @@ -6,4 +6,5 @@ int main() { { std::cout << ns << std::endl; } + return 0; } \ No newline at end of file