Skip to content

Commit b888abf

Browse files
committed
[CMake] Update source file list only if different
Write source file list using 'file(GENERATE' so that they are updated only if thier content is changed. Otherwise stdlib modules are rebuild everytime cmake configuration happens.
1 parent ca41171 commit b888abf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ function(_compile_swift_files
921921
string(REPLACE ";" "'\n'" source_files_quoted "${source_files}")
922922
string(SHA1 file_name "'${source_files_quoted}'")
923923
set(file_path "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.txt")
924-
file(WRITE "${file_path}" "'${source_files_quoted}'")
924+
file(GENERATE OUTPUT "${file_path}" CONTENT "'${source_files_quoted}'")
925925

926926
# If this platform/architecture combo supports backward deployment to old
927927
# Objective-C runtimes, we need to copy a YAML file with legacy type layout

0 commit comments

Comments
 (0)