From 9788629bf867a964d1a60824fbd4f1e44477dd1e Mon Sep 17 00:00:00 2001 From: bergmann Date: Thu, 20 Jun 2019 22:25:39 +0200 Subject: [PATCH] * improved pedantic flags --- cmake/modules | 2 +- projects/helloworld/src/CMakeLists.txt | 11 +++++++---- projects/helloworld/test/CMakeLists.txt | 5 +++++ projects/libhelloworld/src/CMakeLists.txt | 12 ++++++++---- projects/libhelloworld/test/CMakeLists.txt | 5 +++++ 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/cmake/modules b/cmake/modules index 1e74005..1a32531 160000 --- a/cmake/modules +++ b/cmake/modules @@ -1 +1 @@ -Subproject commit 1e74005bc2f91434fecb2e5f698c21b73f7e3a13 +Subproject commit 1a32531aef2deeebd5637b1873bc4e976628801c diff --git a/projects/helloworld/src/CMakeLists.txt b/projects/helloworld/src/CMakeLists.txt index 096d450..f25e1e0 100644 --- a/projects/helloworld/src/CMakeLists.txt +++ b/projects/helloworld/src/CMakeLists.txt @@ -4,10 +4,6 @@ Include ( cotire OPTIONAL RESULT_VARIABLE HAS_COTIRE Include ( pedantic OPTIONAL RESULT_VARIABLE HAS_PEDANTIC ) Include ( strip_symbols OPTIONAL RESULT_VARIABLE HAS_STRIP_SYMBOLS ) -If ( HAS_PEDANTIC ) - Pedantic_Apply_Flags ( ALL ) -EndIf ( ) - Option ( HELLOWORLD_INSTALL_DEBUG "Install the stripped debug informations of helloworld." OFF ) @@ -51,6 +47,13 @@ Target_Link_Libraries ( helloworld # Optimization #################################################################################### +# pedantic +If ( HAS_PEDANTIC ) + Pedantic_Apply_Flags_Target ( helloworld-objects ALL ) + Pedantic_Apply_Flags_Target ( helloworld ALL ) +EndIf ( ) + +# cotire If ( HAS_COTIRE ) Cotire ( helloworld-objects ) Cotire ( helloworld ) diff --git a/projects/helloworld/test/CMakeLists.txt b/projects/helloworld/test/CMakeLists.txt index e0383eb..a7c0676 100644 --- a/projects/helloworld/test/CMakeLists.txt +++ b/projects/helloworld/test/CMakeLists.txt @@ -29,6 +29,11 @@ Target_Link_Libraries ( helloworld-test helloworld-objects GTest::Main ) +# pedantic +If ( HAS_PEDANTIC ) + Pedantic_Apply_Flags_Target ( helloworld-test ALL ) +EndIf ( ) + # optimization If ( HAS_COTIRE ) Cotire ( helloworld-test ) diff --git a/projects/libhelloworld/src/CMakeLists.txt b/projects/libhelloworld/src/CMakeLists.txt index 11f4b5a..cd715a2 100644 --- a/projects/libhelloworld/src/CMakeLists.txt +++ b/projects/libhelloworld/src/CMakeLists.txt @@ -4,10 +4,6 @@ Include ( cotire OPTIONAL RESULT_VARIABLE HAS_COTIRE Include ( pedantic OPTIONAL RESULT_VARIABLE HAS_PEDANTIC ) Include ( strip_symbols OPTIONAL RESULT_VARIABLE HAS_STRIP_SYMBOLS ) -If ( HAS_PEDANTIC ) - Pedantic_Apply_Flags ( ALL ) -EndIf ( ) - Option ( LIBHELLOWORLD_INSTALL_HEADER "Install headers of libhelloworld." ON ) @@ -70,6 +66,14 @@ Target_Include_Directories ( libhelloworld-shared # Optimization #################################################################################### +# pedantic +If ( HAS_PEDANTIC ) + Pedantic_Apply_Flags_Target ( libhelloworld-objects ALL ) + Pedantic_Apply_Flags_Target ( libhelloworld-static ALL ) + Pedantic_Apply_Flags_Target ( libhelloworld-shared ALL ) +EndIf ( ) + +# cotire If ( HAS_COTIRE ) Cotire ( libhelloworld-objects ) Cotire ( libhelloworld-static ) diff --git a/projects/libhelloworld/test/CMakeLists.txt b/projects/libhelloworld/test/CMakeLists.txt index b4f8c38..456c640 100644 --- a/projects/libhelloworld/test/CMakeLists.txt +++ b/projects/libhelloworld/test/CMakeLists.txt @@ -29,6 +29,11 @@ Target_Link_Libraries ( libhelloworld-test libhelloworld-objects GTest::Main ) +# pedantic +If ( HAS_PEDANTIC ) + Pedantic_Apply_Flags_Target ( libhelloworld-test ALL ) +EndIf ( ) + # optimization If ( HAS_COTIRE ) Cotire ( libhelloworld-test )