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.
This commit is contained in:
Peter Keresztes Schmidt 2021-02-27 08:50:16 +01:00
parent 9f16c5073f
commit b0f0731b47
1 changed files with 17 additions and 3 deletions

View File

@ -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)