Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WatchOS new architecture. #21

Open
amirrajan opened this issue Feb 7, 2019 · 0 comments
Open

WatchOS new architecture. #21

amirrajan opened this issue Feb 7, 2019 · 0 comments

Comments

@amirrajan
Copy link
Collaborator

amirrajan commented Feb 7, 2019

maybe this will fix it:

Starting at line 355 in lib/motion/project/template/ios-extension-builder.rb:

  # Use the `-no_implicit_dylibs` linker option to hide the fact that it
  # links against `libextension.dylib` which contains `NSExtensionMain`.
sh "#{cxx} -o \"#{main_exec}\" #{entitlements} #{objs_list}  -fobjc-link-runtime -fapplication-extension -Xlinker -no_implicit_dylibs #{config.ldflags(platform)} -L\"#{File.join(datadir, platform)}\" -lrubymotion-static -lobjc -licucore #{linker_option} #{framework_search_paths} #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs}"

  if platform == "WatchOS" &&
     Util::Version.new(config.deployment_target) >= Util::Version.new("5.0")
    App.info "Patch", relative_path(main_exec)

    bitcode_build_tool = File.join(config.xcode_dir, '/usr/bin/bitcode-build-tool')
    if File.exists? bitcode_build_tool
      arm64_32_exec = "#{main_exec}.arm64_32"
      armv7k_exec = "#{main_exec}.armv7k"

      FileUtils.mv(main_exec, armv7k_exec)

      sh "#{bitcode_build_tool} --translate-watchos -o \"#{arm64_32_exec}\" \"#{armv7k_exec}\" > /dev/null"
      sh "/usr/bin/lipo -create \"#{arm64_32_exec}\" \"#{armv7k_exec}\" -output \"#{main_exec}\""

      FileUtils.rm armv7k_exec
      FileUtils.rm arm64_32_exec
    else
      App.warn "Cannot add arm64_32 support for the Watch app extension required for AppStore distribution"
    end
  end

  main_exec_created = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant