Skip to content

Commit c4ae556

Browse files
[wasm][build] Add WASILibc module as a platform overlay
1 parent 1d14e5d commit c4ae556

File tree

4 files changed

+21
-28
lines changed

4 files changed

+21
-28
lines changed

stdlib/public/Platform/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ add_swift_target_library(swiftWASILibc ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SD
104104

105105
GYB_SOURCES
106106
${swift_platform_gyb_sources}
107-
WASI.swift.gyb
107+
WASILibc.swift.gyb
108108

109109
SWIFT_COMPILE_FLAGS
110110
${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}
111111
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
112+
${swift_platform_compile_flags}
112113
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
113114
TARGET_SDKS WASI
114115
INSTALL_IN_COMPONENT sdk-overlay
@@ -142,7 +143,7 @@ foreach(sdk ${SWIFT_SDKS})
142143
set(glibc_modulemap_source "glibc.modulemap.gyb")
143144
set(glibc_header_source "SwiftGlibc.h.gyb")
144145
elseif("${sdk}" STREQUAL "WASI")
145-
set(glibc_modulemap_source "wasi.modulemap.gyb")
146+
set(glibc_modulemap_source "wasi-libc.modulemap.gyb")
146147
set(glibc_header_source "SwiftWASILibc.h.gyb")
147148
else()
148149
continue()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===--- wasi-libc.modulemap.gyb ------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2020 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
module SwiftWASILibc [system] {
14+
// C standard library
15+
header "SwiftWASILibc.h"
16+
17+
export *
18+
}

stdlib/public/Platform/wasi.modulemap.gyb

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)