소스 검색

Merge topic 'note-link-libraries-genex'

8bd81981 Help: Add note about restoring pre-3.0 link libraries genex behavior
Brad King 11 년 전
부모
커밋
a7b9b571b3
1개의 변경된 파일22개의 추가작업 그리고 0개의 파일을 삭제
  1. 22 0
      Help/release/dev/note-link-libraries-genex.rst

+ 22 - 0
Help/release/dev/note-link-libraries-genex.rst

@@ -0,0 +1,22 @@
+note-link-libraries-genex
+-------------------------
+
+* In CMake 3.0 the :command:`target_link_libraries` command
+  accidentally began allowing unquoted arguments to use
+  :manual:`generator expressions <cmake-generator-expressions(7)>`
+  containing a (``;`` separated) list within them.  For example::
+
+    set(libs B C)
+    target_link_libraries(A PUBLIC $<BUILD_INTERFACE:${libs}>)
+
+  This is equivalent to writing::
+
+    target_link_libraries(A PUBLIC $<BUILD_INTERFACE:B C>)
+
+  and was never intended to work.  It did not work in CMake 2.8.12.
+  Such generator expressions should be in quoted arguments::
+
+    set(libs B C)
+    target_link_libraries(A PUBLIC "$<BUILD_INTERFACE:${libs}>")
+
+  CMake 3.1 again requires the quotes for this to work correctly.