NikolayJuly / swift-toolchain-for-android-on-macos

Swift toolchain for android on macos
MIT License
7 stars 1 forks source link

Build 5.10 #27

Open NikolayJuly opened 3 months ago

NikolayJuly commented 3 months ago

Configure llbuild:

PATH="${HOME}/Library/Android/sdk/cmake/3.22.1/bin/:$PATH" \
cmake -G Ninja \
      -S "${HOME}/ws/SwiftAndroid_working/swift-llbuild" \
      -B "${HOME}/ws/SwiftAndroid_working/build/swift-llbuild" \
      -D CMAKE_INSTALL_PREFIX=/ \
      -D CMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
      -D CMAKE_BUILD_TYPE=Release \
      -D CMAKE_Swift_FLAGS="-Xlinker -v -Xfrontend -target -Xfrontend arm64-apple-macosx12.0 -target arm64-apple-macosx12.0 -v" \
      -D LLBUILD_SUPPORT_BINDINGS=Swift \
      -D CMAKE_OSX_ARCHITECTURES=arm64 \
      -D BUILD_SHARED_LIBS=false

Getting error:

CMake Error in cmake/modules/CMakeLists.txt:
  export called with target "llbuildSwift" which requires target "libllbuild"
  that is not in any export set.

Removing BUILD_SHARED_LIBS=false fixed situation for now, later we will see - does it bite or not.

NikolayJuly commented 3 months ago

Configure swiftpm:

PATH="${HOME}/Library/Android/sdk/cmake/3.22.1/bin/:$PATH" \
cmake -G Ninja \
      -S "${HOME}/ws/SwiftAndroid_working/swiftpm" \
      -B "${HOME}/ws/SwiftAndroid_working/build/swiftpm" \
      -D CMAKE_INSTALL_PREFIX=/ \
      -D CMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
      -D CMAKE_BUILD_TYPE=Release \
      -D CMAKE_Swift_FLAGS="-Xlinker -rpath -Xlinker @executable_path/../lib" \
      -D USE_CMAKE_INSTALL=TRUE \
      -D CMAKE_BUILD_WITH_INSTALL_RPATH=true \
      -D SwiftDriver_DIR="${HOME}/ws/SwiftAndroid_working/build/swift-driver/cmake/modules" \
      -D ArgumentParser_DIR="${HOME}/ws/SwiftAndroid_working/build/swift-argument-parser/cmake/modules" \
      -D SwiftCollections_DIR="${HOME}/ws/SwiftAndroid_working/build/swift-collections/cmake/modules" \
      -D SwiftSystem_DIR="${HOME}/ws/SwiftAndroid_working/build/swift-system/cmake/modules" \
      -D LLBuild_DIR="${HOME}/ws/SwiftAndroid_working/build/swift-llbuild/cmake/modules" \
      -D TSC_DIR="${HOME}/ws/SwiftAndroid_working/build/swift-tools-support-core/cmake/modules" \
      -D SwiftCrypto_DIR="${HOME}/ws/SwiftAndroid_working/build/swift-crypto/cmake/modules"

Gor error:

CMake Error at CMakeLists.txt:45 (find_package):
  Could not find a package configuration file provided by "SwiftASN1" with
  any of the following names:

    SwiftASN1Config.cmake
    swiftasn1-config.cmake

  Add the installation prefix of "SwiftASN1" to CMAKE_PREFIX_PATH or set
  "SwiftASN1_DIR" to a directory containing one of the above files.  If
  "SwiftASN1" provides a separate development package or SDK, be sure it has
  been installed.

Attempt to solve: I can see that there is new repo in defaul swift checkout swift-asn1. I need add it and add needed properties.