From 46abb1cbf601ab70ccd972c3f8e9f20a06aa1c22 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 1 Sep 2022 19:55:02 +0200 Subject: [PATCH] WIP --- LiveKitObjC/LKRoom.m | 4 ++++ .../LiveKitObjC.xcodeproj/project.pbxproj | 23 +++++-------------- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- crates/capture/build.rs | 1 + crates/capture/src/main.rs | 8 ++++++- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/LiveKitObjC/LKRoom.m b/LiveKitObjC/LKRoom.m index ea4d7d4402..02fc01d2f4 100644 --- a/LiveKitObjC/LKRoom.m +++ b/LiveKitObjC/LKRoom.m @@ -26,3 +26,7 @@ [self.room connectWithUrl:url token:token callback:callback]; } @end + +LKRoom* BuildLKRoom() { + return [[LKRoom alloc] init]; +} diff --git a/LiveKitObjC/LiveKitObjC.xcodeproj/project.pbxproj b/LiveKitObjC/LiveKitObjC.xcodeproj/project.pbxproj index 93053cb68d..9c7a6136b3 100644 --- a/LiveKitObjC/LiveKitObjC.xcodeproj/project.pbxproj +++ b/LiveKitObjC/LiveKitObjC.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ AFA4DBD628C0F839001AD7BE /* LiveKit in Frameworks */ = {isa = PBXBuildFile; productRef = AFA4DBD528C0F839001AD7BE /* LiveKit */; }; AFA4DBD928C0F87F001AD7BE /* Room.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA4DBD828C0F87F001AD7BE /* Room.swift */; }; AFA4DBDB28C0FBC0001AD7BE /* LKRoom.m in Sources */ = {isa = PBXBuildFile; fileRef = AFA4DBDA28C0FBC0001AD7BE /* LKRoom.m */; }; - AFA4DBDE28C121E6001AD7BE /* LiveKit in Frameworks */ = {isa = PBXBuildFile; productRef = AFA4DBDD28C121E6001AD7BE /* LiveKit */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -26,7 +25,6 @@ buildActionMask = 2147483647; files = ( AFA4DBD628C0F839001AD7BE /* LiveKit in Frameworks */, - AFA4DBDE28C121E6001AD7BE /* LiveKit in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -79,7 +77,6 @@ name = LiveKitObjC; packageProductDependencies = ( AFA4DBD528C0F839001AD7BE /* LiveKit */, - AFA4DBDD28C121E6001AD7BE /* LiveKit */, ); productName = LiveKitObjC; productReference = AFA4DBCD28C0F7F5001AD7BE /* libLiveKitObjC.a */; @@ -111,7 +108,6 @@ mainGroup = AFA4DBC428C0F7F5001AD7BE; packageReferences = ( AFA4DBD428C0F839001AD7BE /* XCRemoteSwiftPackageReference "client-sdk-swift" */, - AFA4DBDC28C121E6001AD7BE /* XCRemoteSwiftPackageReference "client-sdk-swift" */, ); productRefGroup = AFA4DBCE28C0F7F5001AD7BE /* Products */; projectDirPath = ""; @@ -247,10 +243,13 @@ AFA4DBD228C0F7F5001AD7BE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = NO; EXECUTABLE_PREFIX = lib; + KEEP_PRIVATE_EXTERNS = NO; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", @@ -267,10 +266,13 @@ AFA4DBD328C0F7F5001AD7BE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = NO; EXECUTABLE_PREFIX = lib; + KEEP_PRIVATE_EXTERNS = NO; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", @@ -315,14 +317,6 @@ minimumVersion = 1.0.0; }; }; - AFA4DBDC28C121E6001AD7BE /* XCRemoteSwiftPackageReference "client-sdk-swift" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/livekit/client-sdk-swift"; - requirement = { - branch = main; - kind = branch; - }; - }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -331,11 +325,6 @@ package = AFA4DBD428C0F839001AD7BE /* XCRemoteSwiftPackageReference "client-sdk-swift" */; productName = LiveKit; }; - AFA4DBDD28C121E6001AD7BE /* LiveKit */ = { - isa = XCSwiftPackageProductDependency; - package = AFA4DBDC28C121E6001AD7BE /* XCRemoteSwiftPackageReference "client-sdk-swift" */; - productName = LiveKit; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = AFA4DBC528C0F7F5001AD7BE /* Project object */; diff --git a/LiveKitObjC/LiveKitObjC.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/LiveKitObjC/LiveKitObjC.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 904852142c..21468123fb 100644 --- a/LiveKitObjC/LiveKitObjC.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/LiveKitObjC/LiveKitObjC.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/livekit/client-sdk-swift", "state" : { - "branch" : "main", - "revision" : "e3de0d06e14825a7c9f1204f18f66898afb56cd6" + "revision" : "7e7decf3a09de4a169dfc0445a14d9fd2d8db58d", + "version" : "1.0.4" } }, { diff --git a/crates/capture/build.rs b/crates/capture/build.rs index e88423bed1..630cf1ed6b 100644 --- a/crates/capture/build.rs +++ b/crates/capture/build.rs @@ -1,6 +1,7 @@ use std::{env, path::PathBuf, process::Command}; fn main() { + println!("cargo:rerun-if-changed=/Users/as-cii/Library/Developer/Xcode/DerivedData/LiveKitObjC-ftgpxknhsgkrocbhhgjkyyvkgkbj/Build/Products/Debug/libLiveKitObjC.a"); println!("cargo:rustc-link-search=/Users/as-cii/Library/Developer/Xcode/DerivedData/LiveKitObjC-ftgpxknhsgkrocbhhgjkyyvkgkbj/Build/Products/Debug"); println!("cargo:rustc-link-lib=static=LiveKitObjC"); println!("cargo:rustc-link-lib=framework=ScreenCaptureKit"); diff --git a/crates/capture/src/main.rs b/crates/capture/src/main.rs index e456b032ea..6a4c53aede 100644 --- a/crates/capture/src/main.rs +++ b/crates/capture/src/main.rs @@ -47,8 +47,14 @@ const NSUTF8StringEncoding: NSUInteger = 4; actions!(capture, [Quit]); +extern "C" { + fn BuildLKRoom() -> *const c_void; +} + fn main() { - class!(LKRoom); + unsafe { + BuildLKRoom(); + } SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");