[PATCH] D62172: [cmake] Add custom command to touch archives so ninja won't rebuild them.
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 21 10:54:18 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL361280: [cmake] Add custom command to touch archives on Darwin so ninja won't rebuild… (authored by dhinton, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D62172?vs=200540&id=200543#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62172/new/
https://reviews.llvm.org/D62172
Files:
llvm/trunk/cmake/config-ix.cmake
llvm/trunk/cmake/modules/AddLLVM.cmake
Index: llvm/trunk/cmake/config-ix.cmake
===================================================================
--- llvm/trunk/cmake/config-ix.cmake
+++ llvm/trunk/cmake/config-ix.cmake
@@ -554,6 +554,22 @@
set(LLVM_BINUTILS_INCDIR "" CACHE PATH
"PATH to binutils/include containing plugin-api.h for gold plugin.")
+if(CMAKE_GENERATOR STREQUAL "Ninja")
+ include(CMakeNInjaFindMake)
+ if(CMAKE_MAKE_PROGRAM)
+ execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} --version
+ OUTPUT_VARIABLE NINJA_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(NINJA_VERSION ${NINJA_VERSION} CACHE STRING "Ninja version number" FORCE)
+ endif()
+endif()
+
+if(CMAKE_GENERATOR STREQUAL "Ninja" AND
+ NINJA_VERSION VERSION_GREATER_EQUAL "1.9.0" AND
+ CMAKE_HOST_APPLE AND CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER "15.6.0")
+ set(LLVM_TOUCH_STATIC_LIBRARIES ON)
+endif()
+
if(CMAKE_HOST_APPLE AND APPLE)
if(NOT CMAKE_XCRUN)
find_program(CMAKE_XCRUN NAMES xcrun)
Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -596,6 +596,18 @@
llvm_externalize_debuginfo(${name})
llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS})
endif()
+ # clang and newer versions of ninja use high-resolutions timestamps,
+ # but older versions of libtool on Darwin don't, so the archive will
+ # often get an older timestamp than the last object that was added
+ # or updated. To fix this, we add a custom command to touch archive
+ # after it's been built so that ninja won't rebuild it unnecessarily
+ # the next time it's run.
+ if(ARG_STATIC AND LLVM_TOUCH_STATIC_LIBRARIES)
+ add_custom_command(TARGET ${name}
+ POST_BUILD
+ COMMAND touch ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${name}${CMAKE_STATIC_LIBRARY_SUFFIX}
+ )
+ endif()
endfunction()
function(add_llvm_install_targets target)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62172.200543.patch
Type: text/x-patch
Size: 1992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190521/19776040/attachment.bin>
More information about the llvm-commits
mailing list