Skip to content

Commit

Permalink
introduce get_rn_ios_target_sdk_version()
Browse files Browse the repository at this point in the history
Summary:
feels like this should be shared across oss

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D32940936

fbshipit-source-id: 76fa8fdac5a768586f7f3e916af2c57685a70e12
  • Loading branch information
philIip authored and facebook-github-bot committed Dec 9, 2021
1 parent d7768a5 commit 891a1c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ load(
"RCT_IMAGE_URL_LOADER_SOCKET",
"RCT_URL_REQUEST_HANDLER_SOCKET",
"YOGA_CXX_TARGET",
"get_react_native_ios_target_sdk_version",
"react_fabric_component_plugin_provider",
"react_module_plugin_providers",
"react_native_root_target",
Expand Down Expand Up @@ -496,7 +497,7 @@ rn_xplat_cxx_library2(
],
contacts = ["oncall+react_native@xmail.facebook.com"],
fbobjc_enable_exceptions = True,
fbobjc_target_sdk_version = "11.0",
fbobjc_target_sdk_version = get_react_native_ios_target_sdk_version(),
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
"$SDKROOT/System/Library/Frameworks/QuartzCore.framework",
Expand Down
8 changes: 7 additions & 1 deletion tools/build_defs/oss/rn_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ JNI_TARGET = "//ReactAndroid/src/main/jni/first-party/jni-hack:jni-hack"

KEYSTORE_TARGET = "//keystores:debug"

# Minimum supported iOS version for RN
REACT_NATIVE_TARGET_IOS_SDK = "11.0"

def get_apple_inspector_flags():
return []

Expand All @@ -79,6 +82,9 @@ def get_react_native_preprocessor_flags():
# This is a replacement for NDEBUG since NDEBUG is always defined in Buck on all Android builds.
return []

def get_react_native_ios_target_sdk_version():
return REACT_NATIVE_TARGET_IOS_SDK

# Building is not supported in OSS right now
def rn_xplat_cxx_library(name, compiler_flags_enable_exceptions = False, compiler_flags_enable_rtti = False, **kwargs):
visibility = kwargs.get("visibility", [])
Expand Down Expand Up @@ -210,7 +216,7 @@ def rn_android_prebuilt_aar(*args, **kwargs):
def rn_apple_library(*args, **kwargs):
kwargs.setdefault("link_whole", True)
kwargs.setdefault("enable_exceptions", True)
kwargs.setdefault("target_sdk_version", "11.0")
kwargs.setdefault("target_sdk_version", get_react_native_ios_target_sdk_version())

fb_apple_library(*args, **kwargs)

Expand Down

0 comments on commit 891a1c1

Please sign in to comment.