diff --git a/u01/CMakeLists.txt b/u01/CMakeLists.txt index ce35d11..95192e0 100644 --- a/u01/CMakeLists.txt +++ b/u01/CMakeLists.txt @@ -7,6 +7,11 @@ set(CMAKE_CXX_STANDARD 17) # On GNU this has the effect of passing -std=c++11 instead of -std=gnu++11 set(CMAKE_CXX_EXTENSIONS no) +# Enable all compiler warnings (and make them errors) on GNU/Clang platforms +if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang)$") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") +endif() + add_library(tree node.cpp) add_executable(main main.cpp) target_link_libraries(main tree)