浏览代码

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.
Sam Edwards 7 年之前
父节点
当前提交
5a31844e11
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      cmake/macros/BuildMetalib.cmake

+ 1 - 1
cmake/macros/BuildMetalib.cmake

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