mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
For compiling codes required for macro support, we now need swiftc compiler in the build machine. Unlike Darwin OSes, where swiftCore runtime is guaranteed to be present in /usr/lib, Linux doesn't have ABI stability and the stdlib of the build machine is not at the specific location. So the built compiler cannot relies on the shared object in the toolchain.
38 lines
1.1 KiB
CMake
38 lines
1.1 KiB
CMake
add_sourcekit_executable(sourcekitd-repl
|
|
sourcekitd-repl.cpp
|
|
LLVM_LINK_COMPONENTS coverage lto
|
|
)
|
|
if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY)
|
|
target_link_libraries(sourcekitd-repl PRIVATE sourcekitdInProc)
|
|
else()
|
|
target_link_libraries(sourcekitd-repl PRIVATE sourcekitd)
|
|
endif()
|
|
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
target_link_libraries(sourcekitd-repl PRIVATE
|
|
dispatch
|
|
BlocksRuntime)
|
|
endif()
|
|
target_link_libraries(sourcekitd-repl PRIVATE
|
|
LibEdit::LibEdit)
|
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
set_target_properties(sourcekitd-repl PROPERTIES
|
|
INSTALL_RPATH "@executable_path/../lib")
|
|
target_link_options(sourcekitd-repl PRIVATE
|
|
"LINKER:-exported_symbol,_main")
|
|
endif()
|
|
if(SWIFT_ANALYZE_CODE_COVERAGE)
|
|
set_property(TARGET sourcekitd-repl APPEND_STRING PROPERTY
|
|
LINK_FLAGS " -fprofile-instr-generate -fcoverage-mapping")
|
|
endif()
|
|
|
|
add_dependencies(tools sourcekitd-repl)
|
|
swift_install_in_component(TARGETS sourcekitd-repl
|
|
RUNTIME DESTINATION bin COMPONENT tools)
|
|
|
|
swift_install_strip_builder_rpath(
|
|
TARGETS sourcekitd-repl
|
|
DESTINATION bin
|
|
COMPONENT tools
|
|
)
|