load in platform macros

Reviewed By: ttsugriy

Differential Revision: D7809673

fbshipit-source-id: aacff1a99ba50393ed8f74842afa59384b846e63
This commit is contained in:
Jonathan Kim 2018-04-29 15:57:49 -07:00 committed by Facebook Github Bot
parent d0822c3bcc
commit 62784f35d8
3 changed files with 17 additions and 6 deletions

View File

@ -1,5 +1,4 @@
load("@xplat//configurations/buck/apple:flag_defs.bzl", "get_debug_preprocessor_flags")
load("//ReactNative:DEFS.bzl", "IS_OSS_BUILD", "rn_xplat_cxx_library", "get_android_inspector_flags", "get_apple_inspector_flags", "ANDROID_JSC_DEPS", "APPLE_JSC_DEPS", "react_native_xplat_target")
load("//ReactNative:DEFS.bzl", "IS_OSS_BUILD", "rn_xplat_cxx_library", "get_android_inspector_flags", "get_apple_inspector_flags", "ANDROID_JSC_DEPS", "APPLE_JSC_DEPS", "react_native_xplat_target", "ANDROID", "APPLE")
CXX_LIBRARY_COMPILER_FLAGS = [
"-std=c++14",
@ -8,9 +7,12 @@ CXX_LIBRARY_COMPILER_FLAGS = [
APPLE_COMPILER_FLAGS = []
DEBUG_PREPROCESSOR_FLAGS = []
if not IS_OSS_BUILD:
load("@xplat//configurations/buck/apple:flag_defs.bzl", "get_static_library_ios_flags", "flags")
load("@xplat//configurations/buck/apple:flag_defs.bzl", "get_debug_preprocessor_flags", "get_static_library_ios_flags", "flags")
APPLE_COMPILER_FLAGS = flags.get_flag_value(get_static_library_ios_flags(), 'compiler_flags')
DEBUG_PREPROCESSOR_FLAGS = get_debug_preprocessor_flags()
rn_xplat_cxx_library(
name = "module",
@ -140,7 +142,7 @@ rn_xplat_cxx_library(
fbobjc_frameworks = [
"$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework",
],
fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + get_apple_inspector_flags(),
fbobjc_preprocessor_flags = DEBUG_PREPROCESSOR_FLAGS + get_apple_inspector_flags(),
force_static = True,
macosx_tests_override = [],
platforms = (ANDROID, APPLE),

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS.bzl", "rn_xplat_cxx_library", "react_native_xplat_target", "ANDROID_JSC_INTERNAL_DEPS", "APPLE_JSC_INTERNAL_DEPS")
load("//ReactNative:DEFS.bzl", "rn_xplat_cxx_library", "react_native_xplat_target", "ANDROID_JSC_INTERNAL_DEPS", "APPLE_JSC_INTERNAL_DEPS", "ANDROID", "APPLE")
EXPORTED_HEADERS = [
"JavaScriptCore.h",

View File

@ -4,7 +4,7 @@ This lets us build React Native:
- At Facebook by running buck from the root of the fb repo
- Outside of Facebook by running buck in the root of the git repo
"""
# @lint-ignore-every SKYLINT
# @lint-ignore-every SKYLINT BUCKRESTRICTEDSYNTAX
IS_OSS_BUILD = True
@ -22,6 +22,7 @@ ANDROID_JSC_INTERNAL_DEPS = [
]
ANDROID_JSC_DEPS = ANDROID_JSC_INTERNAL_DEPS
ANDROID = "Android"
APPLE = ""
YOGA_TARGET = '//ReactAndroid/src/main/java/com/facebook:yoga'
FBGLOGINIT_TARGET = '//ReactAndroid/src/main/jni/first-party/fbgloginit:fbgloginit'
@ -33,6 +34,14 @@ with allow_unsafe_import():
import os
def get_apple_inspector_flags():
return []
def get_android_inspector_flags():
return []
# Building is not supported in OSS right now
def rn_xplat_cxx_library(name, **kwargs):
new_kwargs = {