瀏覽代碼

CMake: Make BuildMetalib's link override more like CMake 3.12

Sam Edwards 7 年之前
父節點
當前提交
32a6552af4
共有 1 個文件被更改,包括 1 次插入6 次删除
  1. 1 6
      cmake/macros/BuildMetalib.cmake

+ 1 - 6
cmake/macros/BuildMetalib.cmake

@@ -34,6 +34,7 @@ if(CMAKE_VERSION VERSION_LESS "3.12")
         # And for INTERFACE_COMPILE_DEFINITIONS as well
         # And for INTERFACE_COMPILE_DEFINITIONS as well
         set(compile_definitions "$<TARGET_PROPERTY:${library},INTERFACE_COMPILE_DEFINITIONS>")
         set(compile_definitions "$<TARGET_PROPERTY:${library},INTERFACE_COMPILE_DEFINITIONS>")
         set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}")
         set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}")
+        set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "${compile_definitions}")
 
 
         # Build up some generator expressions for determining whether `library`
         # Build up some generator expressions for determining whether `library`
         # is a component library or not.
         # is a component library or not.
@@ -58,12 +59,6 @@ if(CMAKE_VERSION VERSION_LESS "3.12")
         # Libraries are only linked transitively if they aren't components.
         # Libraries are only linked transitively if they aren't components.
         set_property(TARGET "${target}" APPEND PROPERTY
         set_property(TARGET "${target}" APPEND PROPERTY
           INTERFACE_LINK_LIBRARIES "${name_of_non_component}")
           INTERFACE_LINK_LIBRARIES "${name_of_non_component}")
-
-        # 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_property(TARGET "${target}" APPEND PROPERTY
-          COMPILE_DEFINITIONS "$<${is_component}:${compile_definitions}>")
       else()
       else()
         # This is a file path to an out-of-tree library - this needs to be
         # This is a file path to an out-of-tree library - this needs to be
         # recorded so that the metalib can link them. (They aren't needed at
         # recorded so that the metalib can link them. (They aren't needed at