Skip to content

Commit

Permalink
Merge b5dafbb into dc6fe4f
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Oct 12, 2019
2 parents dc6fe4f + b5dafbb commit b2080be
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 26 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ ENABLE_LANGUAGE(C)
include(SwiftUtils)
include(CheckSymbolExists)

# WebAssembly: hack: use llvm-ar for creating static libraries; Ubuntu's GNU ar doesn't work with wasm-ld
set(CMAKE_AR "${SWIFT_WASM_WASI_SDK_PATH}/bin/llvm-ar")

#
# User-configurable options that control the inclusion and default build
# behavior for components which may not strictly be necessary (tools, examples,
Expand Down Expand Up @@ -814,6 +811,11 @@ if(swift_build_wasm AND NOT "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WASM")
# message(FATAL_ERROR "A Darwin or Linux host is required to build the Swift runtime for Android")
#endif()

if (NOT ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin"))
# WebAssembly: hack: use llvm-ar for creating static libraries; Ubuntu's GNU ar doesn't work with wasm-ld
set(CMAKE_AR "${SWIFT_WASM_WASI_SDK_PATH}/bin/llvm-ar")
endif()

if("${SWIFT_SDK_WASM_ARCHITECTURES}" STREQUAL "")
set(SWIFT_SDK_WASM_ARCHITECTURES wasm32)
endif()
Expand Down
45 changes: 29 additions & 16 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ jobs:
sourcedir="$PWD"
cd swift
utils/update-checkout --clone --scheme wasm
git checkout $BUILD_SOURCEBRANCHNAME || git checkout $SYSTEM_PULLREQUEST_SOURCEBRANCH
utils/build-script --release --wasm \
--llvm-targets-to-build "X86;WebAssembly" \
--build-swift-dynamic-sdk-overlay false \
--build-swift-static-sdk-overlay false \
--wasm-wasi-sdk "/opt/wasi-sdk" \
--wasm-icu-uc "todo" \
--wasm-icu-uc-include "$sourcedir/icu_out/include" \
Expand All @@ -61,14 +64,7 @@ jobs:
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: swiftwasm-sdk
- task: GitHubRelease@0
inputs:
gitHubConnection: swiftwasm-release
tagSource: manual
tag: $(Build.BuildNumber)
assets: |
$(Build.ArtifactStagingDirectory)/*
artifactName: swiftwasm-sdk-linux

- job: macOS
timeoutInMinutes: 0
Expand All @@ -92,8 +88,13 @@ jobs:
- checkout: self
path: swift-source/swift
- script: |
wget -O wasisdk.deb "https://github.com/swiftwasm/wasi-sdk/releases/download/20190421.6/wasi-sdk_3.19gefb17cb478f9.m_amd64.deb"
sudo dpkg -i wasisdk.deb
wget -O wasi-sdk.tar.gz https://github.com/swiftwasm/wasi-sdk/releases/download/20190421.6/wasi-sdk-3.19gefb17cb478f9.m-linux.tar.gz
tar xfz wasi-sdk.tar.gz
mv wasi-sdk-3.19gefb17cb478f9+m/opt/wasi-sdk ./wasi-sdk
# Link sysroot/usr/include to sysroot/include because Darwin sysroot doesn't
# find header files in sysroot/include but sysroot/usr/include
mkdir wasi-sdk/share/sysroot/usr/
ln -s ../include wasi-sdk/share/sysroot/usr/include
wget -O icu.tar.xz "https://github.com/swiftwasm/icu4c-wasi/releases/download/20190421.3/icu4c-wasi.tar.xz"
tar xf icu.tar.xz
workingDirectory: $(Pipeline.Workspace)/swift-source
Expand All @@ -102,11 +103,14 @@ jobs:
sourcedir="$PWD"
cd swift
utils/update-checkout --clone --scheme wasm
git checkout $BUILD_SOURCEBRANCHNAME || git checkout $SYSTEM_PULLREQUEST_SOURCEBRANCH
utils/build-script --release --wasm \
--verbose \
--skip-build-benchmarks \
--build-swift-dynamic-sdk-overlay false \
--build-swift-static-sdk-overlay false \
--llvm-targets-to-build "X86;WebAssembly" \
--stdlib-deployment-targets "macosx-x86_64" \
--extra-cmake-options="-DSWIFT_WASM_WASI_SDK_PATH=/usr/local/opt/llvm" \
--wasm-wasi-sdk "/opt/wasi-sdk" \
--wasm-wasi-sdk "$sourcedir/wasi-sdk" \
--wasm-icu-uc "todo" \
--wasm-icu-uc-include "$sourcedir/icu_out/include" \
--wasm-icu-i18n "todo" \
Expand All @@ -125,11 +129,20 @@ jobs:
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: swiftwasm-sdk
artifactName: swiftwasm-sdk-macos
- job: UploadArtifacts
dependsOn:
- Ubuntu
- macOS
steps:
- task: DownloadBuildArtifacts@0
inputs:
downloadType: 'specific'
itemPattern: '**'
downloadPath: $(Build.ArtifactStagingDirectory)
- task: GitHubRelease@0
inputs:
gitHubConnection: swiftwasm-release
tagSource: manual
tag: $(Build.BuildNumber)
assets: |
$(Build.ArtifactStagingDirectory)/*
assets: $(Build.ArtifactStagingDirectory)/*
2 changes: 1 addition & 1 deletion cmake/modules/FindICU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ foreach(MODULE ${ICU_FIND_COMPONENTS})
HINTS ${PC_ICU_${MODULE}_LIBRARY_DIRS})
endforeach()

foreach(sdk ANDROID;FREEBSD;LINUX;WINDOWS;HAIKU)
foreach(sdk ANDROID;FREEBSD;LINUX;WINDOWS;HAIKU;WASM)
foreach(MODULE ${ICU_FIND_COMPONENTS})
string(TOUPPER "${MODULE}" MODULE)
if("${SWIFT_${sdk}_${SWIFT_HOST_VARIANT_ARCH}_ICU_${MODULE}_INCLUDE}" STREQUAL "")
Expand Down
2 changes: 1 addition & 1 deletion fakeld
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
import sys
def outputname():
for i in range(len(sys.argv)):
Expand Down
2 changes: 1 addition & 1 deletion lib/Driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(SWIFT_BUILD_STATIC_STDLIB)
set(ICU_STATICLIB "TRUE")
else()
set(ICU_STATICLIB "FALSE")
find_package(ICU REQUIRED COMPONENTS uc i18n)
#find_package(ICU REQUIRED COMPONENTS uc i18n)
get_filename_component(ICU_UC_LIBDIR "${ICU_UC_LIBRARIES}" DIRECTORY)
get_filename_component(ICU_I18N_LIBDIR "${ICU_I18N_LIBRARIES}" DIRECTORY)
endif()
Expand Down
1 change: 1 addition & 0 deletions stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ list(APPEND CMAKE_MODULE_PATH

include(AddSwiftStdlib)

set(CMAKE_OSX_SYSROOT "${SWIFT_WASM_WASI_SDK_PATH}")
# Create convenience targets for the Swift standard library.

# NOTE(compnerd) save the original compiler for the host swiftReflection that
Expand Down
1 change: 1 addition & 0 deletions stdlib/public/Darwin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# All libraries in this directory tree are overlays that depend on Darwin SDK.

set(CMAKE_OSX_SYSROOT "/Applications/Xcode-11.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk")
set(SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES)
if(SWIFT_BUILD_DYNAMIC_SDK_OVERLAY)
list(APPEND SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES SHARED)
Expand Down
4 changes: 0 additions & 4 deletions utils/swift_build_support/swift_build_support/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,6 @@ def host_target():
if machine == 'x86_64':
return StdlibDeploymentTarget.Haiku.x86_64

elif system == 'Wasm':
if machine == 'wasm32':
return StdlibDeploymentTarget.Wasm.wasm32

raise NotImplementedError('System "%s" with architecture "%s" is not '
'supported' % (system, machine))

Expand Down

0 comments on commit b2080be

Please sign in to comment.