File tree Expand file tree Collapse file tree 6 files changed +17
-21
lines changed Expand file tree Collapse file tree 6 files changed +17
-21
lines changed Original file line number Diff line number Diff line change @@ -784,13 +784,9 @@ endif()
784
784
# Should we cross-compile the standard library for WebAssembly (WASI)?
785
785
is_sdk_requested (WASI swift_build_wasm )
786
786
if (swift_build_wasm AND NOT "${SWIFT_HOST_VARIANT_SDK} " STREQUAL "WASI" )
787
- #if ("${SWIFT_ANDROID_NDK_PATH}" STREQUAL "")
788
- # message(FATAL_ERROR "You must set SWIFT_ANDROID_NDK_PATH to cross-compile the Swift runtime for Android")
789
- #endif()
790
- #if (NOT ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin" OR "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux"))
791
- # message(FATAL_ERROR "A Darwin or Linux host is required to build the Swift runtime for Android")
792
- #endif()
793
-
787
+ if (SWIFT_BUILD_DYNAMIC_SDK_OVERLAY OR SWIFT_BUILD_DYNAMIC_STDLIB )
788
+ message (FATAL_ERROR "Unable to build dynamic overlay/stdlib for WASI. WASM does not support dynamic linking." )
789
+ endif ()
794
790
if ("${SWIFT_SDK_WASI_ARCHITECTURES} " STREQUAL "" )
795
791
set (SWIFT_SDK_WASI_ARCHITECTURES wasm32 )
796
792
endif ()
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ export sourcedir=$PWD/..
12
12
-DCMAKE_RANLIB='$sourcedir /wasi-sdk/bin/llvm-ranlib' \
13
13
" \
14
14
--build-stdlib-deployment-targets " wasi-wasm32" \
15
+ --build-swift-dynamic-sdk-overlay false \
16
+ --build-swift-dynamic-stdlib false \
17
+ --build-swift-static-sdk-overlay \
15
18
--build-swift-static-stdlib \
16
19
--install-destdir=" $sourcedir /install" \
17
20
--install-prefix=" /opt/swiftwasm-sdk" \
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ export sourcedir=$PWD/..
15
15
" \
16
16
--build-stdlib-deployment-targets " wasi-wasm32" \
17
17
--build-swift-dynamic-sdk-overlay false \
18
- --build-swift-static-sdk-overlay false \
18
+ --build-swift-dynamic-stdlib false \
19
+ --build-swift-static-sdk-overlay \
19
20
--build-swift-static-stdlib \
20
21
--llvm-targets-to-build " X86;WebAssembly" \
21
22
--stdlib-deployment-targets " wasi-wasm32" \
Original file line number Diff line number Diff line change @@ -582,9 +582,7 @@ function(_add_variant_link_flags)
582
582
if (NOT SWIFT_COMPILER_IS_MSVC_LIKE )
583
583
# FIXME: On Apple platforms, find_program needs to look for "ld64.lld"
584
584
find_program (LDLLD_PATH "ld.lld" )
585
- if ("${SWIFT_SDK_${LFLAGS_SDK} _OBJECT_FORMAT}" STREQUAL "WASM" )
586
- list (APPEND result "-fuse-ld=${CMAKE_SOURCE_DIR} /fakeld" )
587
- elseif ((SWIFT_ENABLE_LLD_LINKER AND LDLLD_PATH AND NOT APPLE ) OR
585
+ if ((SWIFT_ENABLE_LLD_LINKER AND LDLLD_PATH AND NOT APPLE ) OR
588
586
("${LFLAGS_SDK} " STREQUAL "WINDOWS" AND
589
587
NOT "${CMAKE_SYSTEM_NAME} " STREQUAL "WINDOWS" ))
590
588
list (APPEND result "-fuse-ld=lld" )
@@ -1404,6 +1402,12 @@ function(_add_swift_library_single target name)
1404
1402
list (APPEND c_compile_flags -D_WINDLL )
1405
1403
endif ()
1406
1404
endif ()
1405
+ # Double-check that we're not trying to build a dynamic library for WASM.
1406
+ if (SWIFTLIB_SINGLE_SDK MATCHES WASM )
1407
+ if (libkind STREQUAL SHARED )
1408
+ message (FATAL_ERROR "WASM does not support shared libraries." )
1409
+ endif ()
1410
+ endif ()
1407
1411
_add_variant_link_flags (
1408
1412
SDK "${SWIFTLIB_SINGLE_SDK} "
1409
1413
ARCH "${SWIFTLIB_SINGLE_ARCHITECTURE} "
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ if(SWIFT_BUILD_SDK_OVERLAY)
18
18
19
19
add_subdirectory (OSLog )
20
20
21
- if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
21
+ list_intersect ("${SWIFT_APPLE_PLATFORMS} " "${SWIFT_SDKS} " building_darwin_sdks )
22
+ if (building_darwin_sdks )
22
23
add_subdirectory (StdlibUnittestFoundationExtras )
23
24
if (SWIFT_INCLUDE_TESTS )
24
25
add_subdirectory (SwiftReflectionTest )
You can’t perform that action at this time.
0 commit comments