Force re-linking of LLVMgold.so when its exports file changes.
authorOscar Fuentes <ofv@wanadoo.es>
Fri, 11 Mar 2011 18:27:13 +0000 (18:27 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Fri, 11 Mar 2011 18:27:13 +0000 (18:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127473 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gold/CMakeLists.txt

index 15ca8d7f8f6f18d637f2d54d973aff422f46c222..d8633e6e47b133f46c232145bc8c89c043c52581 100644 (file)
@@ -32,6 +32,12 @@ else()
   set_property(DIRECTORY APPEND
     PROPERTY ADDITIONAL_MAKE_CLEAN_FILES exportsfile)
 
+  # Force re-linking when the exports file changes. Actually, it
+  # forces recompilation of gold-plugin.cpp. The LINK_DEPENDS target
+  # property only works for makefile-based generators.
+  set_property(SOURCE gold-plugin.cpp APPEND PROPERTY
+    OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/exportsfile)
+
   target_link_libraries(LLVMgold LTO -Wl,--version-script,exportsfile)
   add_dependencies(LLVMgold gold_exports)
 endif()