Skip to content

Commit

Permalink
Add flag to compile out layout specs
Browse files Browse the repository at this point in the history
  • Loading branch information
maicki committed Mar 7, 2019
1 parent 878b827 commit 0b6615c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ObjC/Weaver/NSObject+WVCSSRuleMatchesProviding.m
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ @implementation ASLayoutElementStyle (PDCSSRuleMatchesProviding)

#pragma mark - Layout specs

// This needs to stay in sync with Texture
#ifndef AS_ENABLE_LAYOUTSPECS
#define AS_ENABLE_LAYOUTSPECS 1
#endif

#if AS_ENABLE_LAYOUTSPECS

@implementation ASLayoutSpec (PDCSSRuleMatchesProviding)

- (NSArray<NSString *> *)wv_ruleMatchNames
Expand Down Expand Up @@ -252,6 +259,8 @@ @implementation ASAbsoluteLayoutSpec (PDCSSRuleMatchesProviding)

@end

#endif // AS_ENABLE_LAYOUTSPECS

#pragma mark - Display nodes

@implementation ASDisplayNode (PDCSSRuleMatchesProviding)
Expand Down Expand Up @@ -362,6 +371,13 @@ @implementation ASNetworkImageNode (PDCSSRuleMatchesProviding)
#define AS_USE_VIDEO 0
#endif

// If AS_ENABLE_LAYOUTSPECS is disabled, AS_USE_VIDEO will be implicitly disabled as video nodes
// are using layout specs for their layout.
#if !AS_ENABLE_LAYOUTSPECS
#undef AS_USE_VIDEO
#define AS_USE_VIDEO 0
#endif

#if AS_USE_VIDEO
@implementation ASVideoNode (PDCSSRuleMatchesProviding)

Expand Down

0 comments on commit 0b6615c

Please sign in to comment.