From b4e6a786b74f01d7e1dc106f76bab1fb6788674e Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 8 Jul 2022 08:41:05 -0700 Subject: [PATCH] Use preprocessor flags to set CREATE_SHARED_LIBRARY instead of mode file Summary: Changelog: [Internal] Reviewed By: MartinSherburn Differential Revision: D37600540 fbshipit-source-id: 40cf30ec2960864fc862c31661b1308c57f33bec --- ReactCommon/hermes/inspector/BUCK | 3 ++- ReactCommon/jsinspector/BUCK | 3 ++- tools/build_defs/oss/rn_defs.bzl | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ReactCommon/hermes/inspector/BUCK b/ReactCommon/hermes/inspector/BUCK index 4a76c62471d885..9099fb6e59da2a 100644 --- a/ReactCommon/hermes/inspector/BUCK +++ b/ReactCommon/hermes/inspector/BUCK @@ -2,7 +2,7 @@ load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary load("@fbsource//tools/build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") load("@fbsource//tools/build_defs:fb_xplat_cxx_test.bzl", "fb_xplat_cxx_test") load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID", "APPLE", "CXX", "FBCODE", "WINDOWS") -load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "react_native_xplat_target") +load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "get_hermes_shared_library_preprocessor_flags", "react_native_xplat_target") load("@fbsource//xplat/hermes/defs:hermes.bzl", "hermes_build_mode", "hermes_optimize_flag") CFLAGS_BY_MODE = { @@ -195,6 +195,7 @@ fb_xplat_cxx_library( labels = ["supermodule:xplat/default/public.hermes"], macosx_tests_override = [], platforms = (ANDROID, APPLE, CXX, FBCODE, WINDOWS), + preprocessor_flags = get_hermes_shared_library_preprocessor_flags(), visibility = [ "PUBLIC", ], diff --git a/ReactCommon/jsinspector/BUCK b/ReactCommon/jsinspector/BUCK index 43298b46cb76b6..24e63a862a7067 100644 --- a/ReactCommon/jsinspector/BUCK +++ b/ReactCommon/jsinspector/BUCK @@ -1,6 +1,6 @@ load("@fbsource//tools/build_defs:glob_defs.bzl", "subdir_glob") load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID", "APPLE", "CXX", "FBCODE", "WINDOWS") -load("//tools/build_defs/oss:rn_defs.bzl", "rn_xplat_cxx_library") +load("//tools/build_defs/oss:rn_defs.bzl", "get_hermes_shared_library_preprocessor_flags", "rn_xplat_cxx_library") EXPORTED_HEADERS = [ "InspectorInterfaces.h", @@ -32,6 +32,7 @@ rn_xplat_cxx_library( "supermodule:xplat/default/public.react_native.infra", ], platforms = (ANDROID, APPLE, CXX, FBCODE, WINDOWS), + preprocessor_flags = get_hermes_shared_library_preprocessor_flags(), visibility = [ "PUBLIC", ], diff --git a/tools/build_defs/oss/rn_defs.bzl b/tools/build_defs/oss/rn_defs.bzl index e67e0cfaeef2ce..b51c98be4cebe6 100644 --- a/tools/build_defs/oss/rn_defs.bzl +++ b/tools/build_defs/oss/rn_defs.bzl @@ -36,6 +36,9 @@ def get_objc_arc_preprocessor_flags(): "-Qunused-arguments", ] +def get_hermes_shared_library_preprocessor_flags(): + return [] + IS_OSS_BUILD = True GLOG_DEP = "//ReactAndroid/build/third-party-ndk/glog:glog"