From 01460873daa6f6ba4ac3666c6b949717d9f1f2fe Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 11 May 2017 06:32:41 -0700 Subject: [PATCH] Move jschelpers to fb_xplat_cxx_library Reviewed By: bestander Differential Revision: D5035858 fbshipit-source-id: 110fc5140ee4930634ef2ac3453d0a84124516f9 --- ReactCommon/DEFS | 1 + ReactCommon/jschelpers/BUCK | 107 ++++++++++++------------------------ 2 files changed, 37 insertions(+), 71 deletions(-) diff --git a/ReactCommon/DEFS b/ReactCommon/DEFS index 30dcaf619..a1af94d5f 100644 --- a/ReactCommon/DEFS +++ b/ReactCommon/DEFS @@ -5,3 +5,4 @@ GLOG_DEP = "//ReactAndroid/build/third-party-ndk/glog:glog" INSPECTOR_FLAGS = [] JSC_DEPS = [] +JSC_INTERNAL_DEPS = [] diff --git a/ReactCommon/jschelpers/BUCK b/ReactCommon/jschelpers/BUCK index af29360f7..fb0e0a4a2 100644 --- a/ReactCommon/jschelpers/BUCK +++ b/ReactCommon/jschelpers/BUCK @@ -1,3 +1,5 @@ +include_defs("//ReactCommon/DEFS") + EXPORTED_HEADERS = [ "InspectorInterfaces.h", "JavaScriptCore.h", @@ -8,89 +10,52 @@ EXPORTED_HEADERS = [ "Value.h", ] -EXPORTED_HEADER_MAP = subdir_glob( - (("", header) for header in EXPORTED_HEADERS), - prefix = "jschelpers", -) - -if THIS_IS_FBANDROID: - include_defs("//ReactAndroid/DEFS") - - cxx_library( +fb_xplat_cxx_library( name = "jscinternalhelpers", - force_static = True, + srcs = glob( + ["*.cpp"], + excludes = ["systemJSCWrapper.cpp"], + ), compiler_flags = [ - "-Wall", - "-fexceptions", - "-fvisibility=hidden", - "-std=c++1y", + "-Wall", + "-fexceptions", + "-fvisibility=hidden", + "-std=c++1y", ], exported_headers = EXPORTED_HEADERS, - headers = glob(["*.h"], excludes=EXPORTED_HEADERS), - header_namespace = "jschelpers", - srcs = glob(["*.cpp"], excludes=["systemJSCWrapper.cpp"]), - deps = JSC_INTERNAL_DEPS + [ - "//xplat/folly:molly", - ], - visibility = [ - "PUBLIC", - ], - ) - - cxx_library( - name = "jschelpers", + fbobjc_header_path_prefix = "jschelpers", + fbobjc_inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS, force_static = True, - compiler_flags = [ - "-Wall", - "-fexceptions", - "-fvisibility=hidden", - "-std=c++1y", - ], - srcs = [], - deps = [ ":jscinternalhelpers" ], - visibility = [ - "PUBLIC", - ], - ) - -if THIS_IS_FBOBJC: - - fb_apple_library( - name = "jscinternalhelpers", - inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS, - compiler_flags = [ - "-Wall", - "-fexceptions", - "-fvisibility=hidden", - "-std=c++1y", - ], - exported_headers = EXPORTED_HEADER_MAP, - headers = subdir_glob([("", "*.h")], excludes=EXPORTED_HEADERS, prefix="jschelpers"), header_namespace = "jschelpers", - srcs = glob(["*.cpp"], excludes=["systemJSCWrapper.cpp"]), - deps = [ - "//xplat/folly:molly", - ], + headers = glob( + ["*.h"], + excludes = EXPORTED_HEADERS, + ), visibility = [ - "PUBLIC", + "PUBLIC", ], - ) + deps = JSC_INTERNAL_DEPS + [ + "//xplat/folly:molly", + ], +) - fb_apple_library( +fb_xplat_cxx_library( name = "jschelpers", - inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS, + srcs = [], compiler_flags = [ - "-Wall", - "-fexceptions", - "-fvisibility=hidden", - "-std=c++1y", + "-Wall", + "-fexceptions", + "-fvisibility=hidden", + "-std=c++1y", ], - srcs = ["systemJSCWrapper.cpp"], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework", + fbobjc_frameworks = [ + "$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework", ], - deps = [ ":jscinternalhelpers" ], + fbobjc_inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS, + fbobjc_srcs = ["systemJSCWrapper.cpp"], + force_static = True, visibility = [ - "PUBLIC", + "PUBLIC", ], - ) + deps = [":jscinternalhelpers"], +)