mirror of
https://github.com/apple/swift.git
synced 2026-10-12 14:50:47 +02:00
Added three cache files: one each for the cross-LLVM and the Swift compiler, the third is a top-level include that pre-defines the lld imported targets `find_package(Clang)` expects. Two existing CMake files gain `SWIFT_HOST_VARIANT_SDK == EMSCRIPTEN` branches for the runtime link and module include paths, which don't affect other hosts. The one non-gated change wraps a `CROSSCOMPILE` swift-stdlib ordering dependency in an existence check. It is a no-op unless that target is absent, which happens only when building against a prebuilt stdlib.
17 lines
626 B
CMake
17 lines
626 B
CMake
if(NOT SWIFT_EMSCRIPTEN_HOST_LLVM_LIB_DIR)
|
|
message(FATAL_ERROR
|
|
"SWIFT_EMSCRIPTEN_HOST_LLVM_LIB_DIR is not set. This top-level include "
|
|
"expects -DSWIFT_EMSCRIPTEN_HOST_LLVM_LIB_DIR=<emscriptenhostllvm>/lib, "
|
|
"pointing at the EmscriptenHostLLVM build's lib directory (the one "
|
|
"containing liblldWasm.a / liblldCommon.a).")
|
|
endif()
|
|
|
|
foreach(_lldlib lldWasm lldCommon)
|
|
if(NOT TARGET ${_lldlib})
|
|
add_library(${_lldlib} STATIC IMPORTED GLOBAL)
|
|
set_target_properties(${_lldlib} PROPERTIES
|
|
IMPORTED_LOCATION
|
|
"${SWIFT_EMSCRIPTEN_HOST_LLVM_LIB_DIR}/lib${_lldlib}.a")
|
|
endif()
|
|
endforeach()
|