From b0f0731b47ef24d53909427c1c405dc07963b68b Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Sat, 27 Feb 2021 08:50:16 +0100 Subject: [PATCH] build: Add base target for dependencies The zm-dependency-interface target sets compiler flags in a way suitable for external dependencies. This means mainly to disable compile warnings since they concern upstream and not us. --- cmake/Modules/ConfigureBaseTargets.cmake | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/ConfigureBaseTargets.cmake b/cmake/Modules/ConfigureBaseTargets.cmake index 50589ccd1..ed86d35fc 100644 --- a/cmake/Modules/ConfigureBaseTargets.cmake +++ b/cmake/Modules/ConfigureBaseTargets.cmake @@ -16,11 +16,17 @@ else() cxx_std_11) endif() -# Interface to set warning levels on targets -# It gets populated in the compiler specific script +# Interface to set warning levels on targets. +# It gets populated in the compiler specific script. add_library(zm-warning-interface INTERFACE) -# An interface used by all other interfaces +# Interface which disables all warnings on the target. +add_library(zm-no-warning-interface INTERFACE) +target_compile_options(zm-no-warning-interface + INTERFACE + -w) + +# An interface used by all other interfaces. add_library(zm-default-interface INTERFACE) target_link_libraries(zm-default-interface INTERFACE @@ -34,3 +40,11 @@ target_link_libraries(zm-core-interface INTERFACE zm-default-interface zm-warning-interface) + +# An interface which provides the flags and definitions +# used by the external dependency targets. +add_library(zm-dependency-interface INTERFACE) +target_link_libraries(zm-dependency-interface + INTERFACE + zm-default-interface + zm-no-warning-interface)