CMake: Slightly tweak component-library -D inheritance rules

This only inherits -D flags from another component library. The private
-D flags should not be inherited from regular libraries.
This commit is contained in:
Sam Edwards 2018-04-19 00:05:21 -06:00
parent 29799643e0
commit 5a31844e11
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ function(target_link_libraries target)
# Also build with the same BUILDING_ macros, because these will all end
# up in the same library.
set(compile_definitions "$<TARGET_PROPERTY:${library},COMPILE_DEFINITIONS>")
set(compile_definitions "$<$<BOOL:$<TARGET_PROPERTY:${library},IS_COMPONENT>>:$<TARGET_PROPERTY:${library},COMPILE_DEFINITIONS>>")
set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}")
# Libraries are only linked transitively if they aren't components.