Skip to content

Commit feaeca2

Browse files
committed
cmake: fix a cmake error with the Xcode generator
rdar://86285942
1 parent 3540c01 commit feaeca2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

SwiftCompilerSources/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ function(add_swift_compiler_modules_library name)
107107
get_versioned_target_triple(target ${SWIFT_HOST_VARIANT_SDK}
108108
${SWIFT_HOST_VARIANT_ARCH} "${deployment_version}")
109109

110+
set(all_obj_files)
111+
set(all_module_targets)
110112
get_property(modules GLOBAL PROPERTY "swift_compiler_modules")
111113
foreach(module ${modules})
112114

@@ -148,10 +150,12 @@ function(add_swift_compiler_modules_library name)
148150
COMMENT "Building swift module ${module}")
149151

150152
set("${module}_dep_target" ${dep_target})
153+
set(all_module_targets ${all_module_targets} ${dep_target})
151154
endforeach()
152155

153156
# Create a static library containing all module object files.
154157
add_library(${name} STATIC ${all_obj_files})
158+
add_dependencies(${name} ${all_module_targets})
155159
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX)
156160
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})
157161
endfunction()

0 commit comments

Comments
 (0)