Skip to content

Commit 65cd1ac

Browse files
committed
[CMake] If apinotes/ is a Git repository, re-run CMake when HEAD changes.
CMake doesn't have a nice, blessed way to do this (until 3.0), but most of the time this will be good enough. Swift SVN r21079
1 parent 73cce97 commit 65cd1ac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,6 +1600,14 @@ foreach(file ${SWIFT_API_NOTES_INPUT_FILES})
16001600
list(APPEND SWIFT_API_NOTES_INPUTS ${name})
16011601
endforeach()
16021602

1603+
if(EXISTS "${SWIFT_API_NOTES_PATH}/.git/HEAD")
1604+
# Trigger updates if the apinotes repository version changes.
1605+
configure_file(
1606+
"${SWIFT_API_NOTES_PATH}/.git/HEAD"
1607+
"${CMAKE_BINARY_DIR}/apinotes-version.check_cache"
1608+
@ONLY)
1609+
endif()
1610+
16031611
# Add all of the subdirectories, where we actually do work.
16041612
if (SWIFT_BUILD_TOOLS)
16051613
add_subdirectory(include)

0 commit comments

Comments
 (0)