blob: 0c1dfe63dcc01c03986fb659f88971f1ef0a273b [file] [log] [blame]
set(datafiles
macos3.json
macos4.json
ios3.json
ios4.json
tvos3.json
tvos4.json
watchos3.json
watchos4.json
overlay3.json
overlay4.json
)
set(SWIFTLIB_DIR
"${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/swift")
set(output_dir "${SWIFTLIB_DIR}/migrator")
add_custom_command(
OUTPUT "${output_dir}"
COMMAND ${CMAKE_COMMAND} "-E" "make_directory" "${output_dir}")
set(outputs)
foreach(input ${datafiles})
set(source "${CMAKE_CURRENT_SOURCE_DIR}/${input}")
set(dest "${output_dir}/${input}")
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_SYMLINK_COMMAND copy)
else()
set(CMAKE_SYMLINK_COMMAND create_symlink)
endif()
add_custom_command(OUTPUT
"${output_dir}/${input}"
DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/${input}"
COMMAND
"${CMAKE_COMMAND}" "-E" "${CMAKE_SYMLINK_COMMAND}" "${source}" "${dest}")
list(APPEND outputs "${output_dir}/${input}")
endforeach()
list(APPEND outputs "${output_dir}")
add_custom_target("symlink_migrator_data"
DEPENDS "${output_dir}" "${outputs}"
COMMENT "Symlinking migrator data to ${output_dir}")
swift_install_in_component(compiler
FILES ${datafiles}
DESTINATION "lib/swift/migrator")
add_swift_library(swiftMigrator STATIC
APIDiffMigratorPass.cpp
EditorAdapter.cpp
FixitApplyDiagnosticConsumer.cpp
Migrator.cpp
MigrationState.cpp
RewriteBufferEditsReceiver.cpp
TupleSplatMigratorPass.cpp
TypeOfMigratorPass.cpp
LINK_LIBRARIES swiftSyntax swiftIDE)
add_dependencies(swiftMigrator
"symlink_migrator_data")