Skip to content

Commit

Permalink
Fix linker
Browse files Browse the repository at this point in the history
  • Loading branch information
Adlai-Holler committed Nov 1, 2018
1 parent 49ada61 commit 7be25f9
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 10 deletions.
2 changes: 2 additions & 0 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2621,6 +2621,8 @@
"AS_USE_ASSETS_LIBRARY=1",
"AS_USE_MAPKIT=1",
"AS_USE_PHOTOS=1",
"AS_USE_CORE_MEDIA=1",
"AS_USE_AV_FOUNDATION=1",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
12 changes: 12 additions & 0 deletions Source/ASVideoNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import <AsyncDisplayKit/ASAvailability.h>

#if TARGET_OS_IOS && AS_USE_AV_FOUNDATION
#define AS_ENABLE_VIDEO_NODE 1
#else
#define AS_ENABLE_VIDEO_NODE 0
#endif

#if AS_ENABLE_VIDEO_NODE

#import <AsyncDisplayKit/ASNetworkImageNode.h>

@class AVAsset, AVPlayer, AVPlayerLayer, AVPlayerItem, AVVideoComposition, AVAudioMix;
Expand Down Expand Up @@ -164,3 +174,5 @@ NS_ASSUME_NONNULL_BEGIN
@end

NS_ASSUME_NONNULL_END

#endif // AS_ENABLE_VIDEO_NODE
7 changes: 6 additions & 1 deletion Source/ASVideoNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import <AsyncDisplayKit/ASVideoNode.h>

#if AS_ENABLE_VIDEO_NODE

#import <AVFoundation/AVFoundation.h>
#import <AsyncDisplayKit/ASDisplayNode+FrameworkPrivate.h>
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
#import <AsyncDisplayKit/ASVideoNode.h>
#import <AsyncDisplayKit/ASEqualityHelpers.h>
#import <AsyncDisplayKit/ASInternalHelpers.h>
#import <AsyncDisplayKit/ASDisplayNodeExtras.h>
Expand Down Expand Up @@ -850,3 +853,5 @@ - (void)dealloc
}

@end

#endif // AS_ENABLE_VIDEO_NODE
12 changes: 11 additions & 1 deletion Source/ASVideoPlayerNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#if TARGET_OS_IOS
#import <AsyncDisplayKit/ASAvailability.h>

#if TARGET_OS_IOS && AS_USE_CORE_MEDIA && AS_USE_AV_FOUNDATION
#define AS_ENABLE_VIDEO_PLAYER_NODE 1
#else
#define AS_ENABLE_VIDEO_PLAYER_NODE 0
#endif

#if AS_ENABLE_VIDEO_PLAYER_NODE

#import <AVFoundation/AVFoundation.h>
#import <CoreMedia/CoreMedia.h>
#import <AsyncDisplayKit/ASThread.h>
#import <AsyncDisplayKit/ASVideoNode.h>
Expand Down
6 changes: 1 addition & 5 deletions Source/ASVideoPlayerNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import <Foundation/Foundation.h>

#if TARGET_OS_IOS

#import <AsyncDisplayKit/ASVideoPlayerNode.h>

#import <AVFoundation/AVFoundation.h>
#if AS_ENABLE_VIDEO_PLAYER_NODE

#import <AsyncDisplayKit/AsyncDisplayKit.h>
#import <AsyncDisplayKit/ASDefaultPlaybackButton.h>
Expand Down
8 changes: 8 additions & 0 deletions Source/Base/ASAvailability.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
#define AS_USE_ASSETS_LIBRARY 0
#endif

#ifndef AS_USE_AV_FOUNDATION
#define AS_USE_AV_FOUNDATION 0
#endif

#ifndef AS_USE_CORE_MEDIA
#define AS_USE_CORE_MEDIA 0
#endif

#ifndef kCFCoreFoundationVersionNumber_iOS_10_0
#define kCFCoreFoundationVersionNumber_iOS_10_0 1348.00
#endif
Expand Down
17 changes: 14 additions & 3 deletions Texture.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ Pod::Spec.new do |spec|
]

core.source_files = [
'Source/**/*.{h,m,mm}',
'Base/*.{h,m}',
'Source/**/*.{h,mm}',

# Most TextKit components are not public because the C++ content
# in the headers will cause build errors when using
Expand Down Expand Up @@ -74,9 +73,21 @@ Pod::Spec.new do |spec|
assetslib.dependency 'Texture/Core'
end

spec.subspec 'AVFoundation' do |avf|
avf.frameworks = 'AVFoundation'
avf.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) AS_USE_AV_FOUNDATION=1' }
avf.dependency 'Texture/Core'
end

spec.subspec 'CoreMedia' do |cm|
cm.frameworks = 'CoreMedia'
cm.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) AS_USE_CORE_MEDIA=1' }
cm.dependency 'Texture/Core'
end

# Include these by default for backwards compatibility.
# This will change in 3.0.
spec.default_subspecs = 'PINRemoteImage', 'MapKit', 'AssetsLibrary', 'Photos'
spec.default_subspecs = 'PINRemoteImage', 'MapKit', 'AssetsLibrary', 'Photos', 'AVFoundation', 'CoreMedia'

spec.social_media_url = 'https://twitter.com/TextureiOS'
spec.library = 'c++'
Expand Down

0 comments on commit 7be25f9

Please sign in to comment.