summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTDarwinUtils.cmake
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-11-09 23:07:45 +0000
committerChris Bieneman <beanz@apple.com>2015-11-09 23:07:45 +0000
commit7e1db730a4fd8f3231ec506f4613f55bd9fd8786 (patch)
tree699306bdf2f7c4d6798edb88b8a92be07fed2763 /cmake/Modules/CompilerRTDarwinUtils.cmake
parent5be03d36ed643aab0d9dbef3b61356e0b346968b (diff)
[CMake] [Darwin] Don't generate lipo commands if we don't have libraries to put into the fat archive.
Not making sure there are thin libraries results in some difficult to diagnose build failures. This check should make those build failures go away. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252527 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules/CompilerRTDarwinUtils.cmake')
-rw-r--r--cmake/Modules/CompilerRTDarwinUtils.cmake28
1 files changed, 16 insertions, 12 deletions
diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake
index 1b1143306..27c6479fb 100644
--- a/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ b/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -186,18 +186,22 @@ function(darwin_lipo_libs name)
"PARENT_TARGET;OUTPUT_DIR;INSTALL_DIR"
"LIPO_FLAGS;DEPENDS"
${ARGN})
- add_custom_command(OUTPUT ${LIB_OUTPUT_DIR}/lib${name}.a
- COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_OUTPUT_DIR}
- COMMAND lipo -output
- ${LIB_OUTPUT_DIR}/lib${name}.a
- -create ${LIB_LIPO_FLAGS}
- DEPENDS ${LIB_DEPENDS}
- )
- add_custom_target(${name}
- DEPENDS ${LIB_OUTPUT_DIR}/lib${name}.a)
- add_dependencies(${LIB_PARENT_TARGET} ${name})
- install(FILES ${LIB_OUTPUT_DIR}/lib${name}.a
- DESTINATION ${LIB_INSTALL_DIR})
+ if(ARGN_DEPENDS AND ARG_LIPO_FLAGS)
+ add_custom_command(OUTPUT ${LIB_OUTPUT_DIR}/lib${name}.a
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_OUTPUT_DIR}
+ COMMAND lipo -output
+ ${LIB_OUTPUT_DIR}/lib${name}.a
+ -create ${LIB_LIPO_FLAGS}
+ DEPENDS ${LIB_DEPENDS}
+ )
+ add_custom_target(${name}
+ DEPENDS ${LIB_OUTPUT_DIR}/lib${name}.a)
+ add_dependencies(${LIB_PARENT_TARGET} ${name})
+ install(FILES ${LIB_OUTPUT_DIR}/lib${name}.a
+ DESTINATION ${LIB_INSTALL_DIR})
+ else()
+ message(WARNING "Not generating lipo target for ${name} because no input libraries exist.")
+ endif()
endfunction()
# Filter out generic versions of routines that are re-implemented in