summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-02-21 14:17:29 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-02-21 14:17:29 +0000
commit6be6579352b63a809919e16eb13eec16c9a62716 (patch)
treef83254732531033ff188aba0b98927b44ca3a0c3 /cmake
parent1901ee61d56cba612c687fa3b33929e0b1f57fa5 (diff)
downloadllvm-6be6579352b63a809919e16eb13eec16c9a62716.tar.gz
[CMake] llvm_add_library: Add dependencies also to objlibs as workaround of CMake issue 14747.
http://www.cmake.org/Bug/view.php?id=14747 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/AddLLVM.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index a10262b14ef6..90c15a9d70e9 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -127,6 +127,10 @@ function(add_llvm_symbol_exports target_name export_file)
PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${native_export_file})
add_dependencies(${target_name} ${target_name}_exports)
+
+ # Add dependency to *_exports later -- CMake issue 14747
+ list(APPEND LLVM_COMMON_DEPENDS ${target_name}_exports)
+ set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)
endfunction(add_llvm_symbol_exports)
function(add_dead_strip target_name)
@@ -224,6 +228,9 @@ function(llvm_add_library name)
llvm_update_compile_flags(${obj_name})
set(ALL_FILES "$<TARGET_OBJECTS:${obj_name}>")
+ # Do add_dependencies(obj) later due to CMake issue 14747.
+ list(APPEND objlibs ${obj_name})
+
set_target_properties(${obj_name} PROPERTIES FOLDER "Object Libraries")
endif()
@@ -288,6 +295,12 @@ function(llvm_add_library name)
if(LLVM_COMMON_DEPENDS)
add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
+ # Add dependencies also to objlibs.
+ # CMake issue 14747 -- add_dependencies() might be ignored to objlib's user.
+ foreach(objlib ${objlibs})
+ message("add_dependencies(${objlib} ${LLVM_COMMON_DEPENDS})")
+ add_dependencies(${objlib} ${LLVM_COMMON_DEPENDS})
+ endforeach()
endif()
endfunction()