From 7b033668097cb312481b17a64c27cd50cffcee91 Mon Sep 17 00:00:00 2001 From: Cedric LE CAM Date: Fri, 31 May 2024 14:50:25 +0200 Subject: [PATCH] Add compiler warnings flags --- CMakeLists.txt | 8 ++++++++ test/CMakeLists.txt | 1 + 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1470ca..cfdca1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,10 +22,18 @@ find_package(spdlog CONFIG REQUIRED) add_library(khiopsdriver_file_gcs MODULE src/gcsplugin.h src/gcsplugin.cpp) set_target_properties(khiopsdriver_file_gcs PROPERTIES LINK_FLAGS_RELEASE -s) target_link_libraries(khiopsdriver_file_gcs PRIVATE google-cloud-cpp::storage spdlog::spdlog) +target_compile_options(khiopsdriver_file_gcs + PRIVATE $<$:-Wall> + PRIVATE $<$:-Wall;-Wextra;-pedantic> +) add_library(khiopsdriver_file_gcs_test SHARED src/gcsplugin.h src/gcsplugin.cpp) set_target_properties(khiopsdriver_file_gcs_test PROPERTIES LINK_FLAGS_RELEASE -s) target_link_libraries(khiopsdriver_file_gcs_test PRIVATE google-cloud-cpp::storage spdlog::spdlog) +target_compile_options(khiopsdriver_file_gcs_test + PRIVATE $<$:-Wall> + PRIVATE $<$:-Wall;-Wextra;-pedantic> +) add_executable(KhiopsPluginTest src/khiopsplugintest.cpp) target_link_libraries(KhiopsPluginTest PRIVATE fmt::fmt) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 97d8c84..8a8b1b0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,6 +9,7 @@ target_sources( basic_test target_compile_options(basic_test PRIVATE $<$:-Wall> + PRIVATE $<$:-Wall;-Wextra;-pedantic> ) target_link_libraries(basic_test GTest::gtest khiopsdriver_file_gcs_test)