basalt-core 0.0.0-rc5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cli/basalt.d.ts +3 -0
- package/dist/cli/basalt.d.ts.map +1 -0
- package/dist/cli/basalt.js +47 -0
- package/dist/cli/basalt.js.map +1 -0
- package/dist/cli/bundle-cli.d.ts +12 -0
- package/dist/cli/bundle-cli.d.ts.map +1 -0
- package/dist/cli/bundle-cli.js +124 -0
- package/dist/cli/bundle-cli.js.map +1 -0
- package/dist/cli/bundleWithAssets.d.ts +79 -0
- package/dist/cli/bundleWithAssets.d.ts.map +1 -0
- package/dist/cli/bundleWithAssets.js +198 -0
- package/dist/cli/bundleWithAssets.js.map +1 -0
- package/dist/cli/desktop.d.ts +339 -0
- package/dist/cli/desktop.d.ts.map +1 -0
- package/dist/cli/desktop.js +1029 -0
- package/dist/cli/desktop.js.map +1 -0
- package/dist/cli/doctor.d.ts +31 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +283 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/init.d.ts +77 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +442 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/metro.d.ts +49 -0
- package/dist/cli/metro.d.ts.map +1 -0
- package/dist/cli/metro.js +148 -0
- package/dist/cli/metro.js.map +1 -0
- package/dist/cli/packageApp.d.ts +102 -0
- package/dist/cli/packageApp.d.ts.map +1 -0
- package/dist/cli/packageApp.js +319 -0
- package/dist/cli/packageApp.js.map +1 -0
- package/dist/cli/steps.d.ts +34 -0
- package/dist/cli/steps.d.ts.map +1 -0
- package/dist/cli/steps.js +53 -0
- package/dist/cli/steps.js.map +1 -0
- package/dist/metro-config.d.ts +168 -0
- package/dist/metro-config.d.ts.map +1 -0
- package/dist/metro-config.js +671 -0
- package/dist/metro-config.js.map +1 -0
- package/dist/react-native.config.d.ts +7 -0
- package/dist/react-native.config.d.ts.map +1 -0
- package/dist/react-native.config.js +80 -0
- package/dist/react-native.config.js.map +1 -0
- package/dist/src/DragSource.d.ts +52 -0
- package/dist/src/DragSource.d.ts.map +1 -0
- package/dist/src/DragSource.js +97 -0
- package/dist/src/DragSource.js.map +1 -0
- package/dist/src/DropTarget.d.ts +58 -0
- package/dist/src/DropTarget.d.ts.map +1 -0
- package/dist/src/DropTarget.js +131 -0
- package/dist/src/DropTarget.js.map +1 -0
- package/dist/src/KeyHandler.d.ts +57 -0
- package/dist/src/KeyHandler.d.ts.map +1 -0
- package/dist/src/KeyHandler.js +48 -0
- package/dist/src/KeyHandler.js.map +1 -0
- package/dist/src/Menu.d.ts +72 -0
- package/dist/src/Menu.d.ts.map +1 -0
- package/dist/src/Menu.js +179 -0
- package/dist/src/Menu.js.map +1 -0
- package/dist/src/TitleBar.d.ts +75 -0
- package/dist/src/TitleBar.d.ts.map +1 -0
- package/dist/src/TitleBar.js +236 -0
- package/dist/src/TitleBar.js.map +1 -0
- package/dist/src/Window.d.ts +87 -0
- package/dist/src/Window.d.ts.map +1 -0
- package/dist/src/Window.js +248 -0
- package/dist/src/Window.js.map +1 -0
- package/dist/src/closeRequest.d.ts +55 -0
- package/dist/src/closeRequest.d.ts.map +1 -0
- package/dist/src/closeRequest.js +134 -0
- package/dist/src/closeRequest.js.map +1 -0
- package/dist/src/index.d.ts +45 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +92 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/overrides/Alert.d.ts +69 -0
- package/dist/src/overrides/Alert.d.ts.map +1 -0
- package/dist/src/overrides/Alert.js +112 -0
- package/dist/src/overrides/Alert.js.map +1 -0
- package/dist/src/overrides/BaseViewConfig.d.ts +28 -0
- package/dist/src/overrides/BaseViewConfig.d.ts.map +1 -0
- package/dist/src/overrides/BaseViewConfig.js +72 -0
- package/dist/src/overrides/BaseViewConfig.js.map +1 -0
- package/dist/src/overrides/Platform.linux.d.ts +10 -0
- package/dist/src/overrides/Platform.linux.d.ts.map +1 -0
- package/dist/src/overrides/Platform.linux.js +15 -0
- package/dist/src/overrides/Platform.linux.js.map +1 -0
- package/dist/src/overrides/Platform.macos.d.ts +10 -0
- package/dist/src/overrides/Platform.macos.d.ts.map +1 -0
- package/dist/src/overrides/Platform.macos.js +15 -0
- package/dist/src/overrides/Platform.macos.js.map +1 -0
- package/dist/src/overrides/Platform.windows.d.ts +10 -0
- package/dist/src/overrides/Platform.windows.d.ts.map +1 -0
- package/dist/src/overrides/Platform.windows.js +15 -0
- package/dist/src/overrides/Platform.windows.js.map +1 -0
- package/dist/src/overrides/ReactDevToolsSettingsManager.d.ts +24 -0
- package/dist/src/overrides/ReactDevToolsSettingsManager.d.ts.map +1 -0
- package/dist/src/overrides/ReactDevToolsSettingsManager.js +30 -0
- package/dist/src/overrides/ReactDevToolsSettingsManager.js.map +1 -0
- package/dist/src/overrides/RefreshControl.d.ts +52 -0
- package/dist/src/overrides/RefreshControl.d.ts.map +1 -0
- package/dist/src/overrides/RefreshControl.js +92 -0
- package/dist/src/overrides/RefreshControl.js.map +1 -0
- package/dist/src/overrides/ScrollView.d.ts +39 -0
- package/dist/src/overrides/ScrollView.d.ts.map +1 -0
- package/dist/src/overrides/ScrollView.js +59 -0
- package/dist/src/overrides/ScrollView.js.map +1 -0
- package/dist/src/overrides/Share.d.ts +96 -0
- package/dist/src/overrides/Share.d.ts.map +1 -0
- package/dist/src/overrides/Share.js +97 -0
- package/dist/src/overrides/Share.js.map +1 -0
- package/dist/src/overrides/TextInput.d.ts +81 -0
- package/dist/src/overrides/TextInput.d.ts.map +1 -0
- package/dist/src/overrides/TextInput.js +213 -0
- package/dist/src/overrides/TextInput.js.map +1 -0
- package/dist/src/overrides/View.d.ts +36 -0
- package/dist/src/overrides/View.d.ts.map +1 -0
- package/dist/src/overrides/View.js +99 -0
- package/dist/src/overrides/View.js.map +1 -0
- package/dist/src/overrides/createPlatform.d.ts +32 -0
- package/dist/src/overrides/createPlatform.d.ts.map +1 -0
- package/dist/src/overrides/createPlatform.js +84 -0
- package/dist/src/overrides/createPlatform.js.map +1 -0
- package/dist/src/overrides/setUpDeveloperTools.d.ts +28 -0
- package/dist/src/overrides/setUpDeveloperTools.d.ts.map +1 -0
- package/dist/src/overrides/setUpDeveloperTools.js +84 -0
- package/dist/src/overrides/setUpDeveloperTools.js.map +1 -0
- package/dist/src/overrides/setUpXHR.d.ts +46 -0
- package/dist/src/overrides/setUpXHR.d.ts.map +1 -0
- package/dist/src/overrides/setUpXHR.js +236 -0
- package/dist/src/overrides/setUpXHR.js.map +1 -0
- package/dist/src/quitRequest.d.ts +55 -0
- package/dist/src/quitRequest.d.ts.map +1 -0
- package/dist/src/quitRequest.js +121 -0
- package/dist/src/quitRequest.js.map +1 -0
- package/dist/src/resourcePath.d.ts +18 -0
- package/dist/src/resourcePath.d.ts.map +1 -0
- package/dist/src/resourcePath.js +31 -0
- package/dist/src/resourcePath.js.map +1 -0
- package/dist/src/responseBody.d.ts +76 -0
- package/dist/src/responseBody.d.ts.map +1 -0
- package/dist/src/responseBody.js +94 -0
- package/dist/src/responseBody.js.map +1 -0
- package/dist/src/responseHeaders.d.ts +40 -0
- package/dist/src/responseHeaders.d.ts.map +1 -0
- package/dist/src/responseHeaders.js +75 -0
- package/dist/src/responseHeaders.js.map +1 -0
- package/dist/src/titleBarState.d.ts +43 -0
- package/dist/src/titleBarState.d.ts.map +1 -0
- package/dist/src/titleBarState.js +77 -0
- package/dist/src/titleBarState.js.map +1 -0
- package/dist/src/useContextMenu.d.ts +113 -0
- package/dist/src/useContextMenu.d.ts.map +1 -0
- package/dist/src/useContextMenu.js +109 -0
- package/dist/src/useContextMenu.js.map +1 -0
- package/dist/src/useDialog.d.ts +98 -0
- package/dist/src/useDialog.d.ts.map +1 -0
- package/dist/src/useDialog.js +112 -0
- package/dist/src/useDialog.js.map +1 -0
- package/dist/src/useDisplays.d.ts +70 -0
- package/dist/src/useDisplays.d.ts.map +1 -0
- package/dist/src/useDisplays.js +118 -0
- package/dist/src/useDisplays.js.map +1 -0
- package/dist/src/useHandledKeys.d.ts +38 -0
- package/dist/src/useHandledKeys.d.ts.map +1 -0
- package/dist/src/useHandledKeys.js +70 -0
- package/dist/src/useHandledKeys.js.map +1 -0
- package/dist/src/useWindow.d.ts +140 -0
- package/dist/src/useWindow.d.ts.map +1 -0
- package/dist/src/useWindow.js +233 -0
- package/dist/src/useWindow.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/native/CMakeLists.txt +355 -0
- package/native/bootstrap.sh +613 -0
- package/native/cmake/CompilerFlags.cmake +49 -0
- package/native/cmake/Expo.cmake +125 -0
- package/native/cmake/ReactNativeCore.cmake +612 -0
- package/native/cmake/Reanimated.cmake +108 -0
- package/native/cmake/Skia.cmake +379 -0
- package/native/cmake/ThirdParty.cmake +290 -0
- package/native/cmake/Worklets.cmake +67 -0
- package/native/cmake/codegen/CMakeLists.txt +32 -0
- package/native/core/AppIdentity.cpp +85 -0
- package/native/core/AppIdentity.h +59 -0
- package/native/core/AppPaths.cpp +96 -0
- package/native/core/AppPaths.h +53 -0
- package/native/core/AppearanceModule.cpp +60 -0
- package/native/core/AppearanceModule.h +40 -0
- package/native/core/Backface.h +59 -0
- package/native/core/BlobModule.cpp +283 -0
- package/native/core/BlobModule.h +76 -0
- package/native/core/BlobRegistry.cpp +75 -0
- package/native/core/BlobRegistry.h +44 -0
- package/native/core/ColorScheme.cpp +105 -0
- package/native/core/ColorScheme.h +59 -0
- package/native/core/ComponentRegistry.h +30 -0
- package/native/core/ControlMetrics.h +37 -0
- package/native/core/CoreModules.cpp +592 -0
- package/native/core/CoreModules.h +308 -0
- package/native/core/DebuggingOverlay.cpp +106 -0
- package/native/core/DebuggingOverlay.h +65 -0
- package/native/core/DesktopControls.cpp +232 -0
- package/native/core/DesktopControls.h +170 -0
- package/native/core/DevBundle.cpp +108 -0
- package/native/core/DevBundle.h +69 -0
- package/native/core/DevMenu.cpp +99 -0
- package/native/core/DevMenu.h +75 -0
- package/native/core/DialogModule.cpp +150 -0
- package/native/core/DialogModule.h +51 -0
- package/native/core/DragAndDrop.cpp +45 -0
- package/native/core/DragAndDrop.h +225 -0
- package/native/core/ExpoImageComponent.cpp +79 -0
- package/native/core/ExpoImageComponent.h +80 -0
- package/native/core/ExpoModules.cpp +415 -0
- package/native/core/ExpoModules.h +115 -0
- package/native/core/ExpoRuntime.cpp +366 -0
- package/native/core/ExpoRuntime.h +42 -0
- package/native/core/FocusRing.h +36 -0
- package/native/core/FontRegistry.h +51 -0
- package/native/core/GestureHandlerModule.cpp +136 -0
- package/native/core/GestureHandlerModule.h +71 -0
- package/native/core/Gestures.cpp +533 -0
- package/native/core/Gestures.h +145 -0
- package/native/core/HoverTracker.cpp +69 -0
- package/native/core/HoverTracker.h +109 -0
- package/native/core/HttpClient.cpp +282 -0
- package/native/core/ImageBytes.cpp +205 -0
- package/native/core/ImageBytes.h +29 -0
- package/native/core/ImageCache.cpp +51 -0
- package/native/core/ImageCache.h +89 -0
- package/native/core/JsRuntimeAccess.cpp +70 -0
- package/native/core/JsRuntimeAccess.h +60 -0
- package/native/core/JsiPromise.h +51 -0
- package/native/core/KeyEvents.cpp +116 -0
- package/native/core/KeyEvents.h +144 -0
- package/native/core/LogBoxSurface.cpp +46 -0
- package/native/core/LogBoxSurface.h +68 -0
- package/native/core/MenuModel.h +117 -0
- package/native/core/MenuModule.cpp +209 -0
- package/native/core/MenuModule.h +66 -0
- package/native/core/MountingWalk.h +524 -0
- package/native/core/PackageModules.cpp.in +25 -0
- package/native/core/PackageModules.h +50 -0
- package/native/core/PlatformConstantsModule.cpp +63 -0
- package/native/core/PlatformConstantsModule.h +64 -0
- package/native/core/PlatformServices.h +213 -0
- package/native/core/PointerButtons.h +63 -0
- package/native/core/PullToRefresh.cpp +57 -0
- package/native/core/PullToRefresh.h +73 -0
- package/native/core/ReanimatedCompat.h +47 -0
- package/native/core/ReanimatedModule.cpp +203 -0
- package/native/core/ReanimatedModule.h +55 -0
- package/native/core/ScrollAnimation.cpp +59 -0
- package/native/core/ScrollAnimation.h +70 -0
- package/native/core/ScrollBounds.cpp +26 -0
- package/native/core/ScrollBounds.h +68 -0
- package/native/core/ScrollIndicator.cpp +50 -0
- package/native/core/ScrollIndicator.h +69 -0
- package/native/core/ScrollMomentum.cpp +71 -0
- package/native/core/ScrollMomentum.h +73 -0
- package/native/core/ScrollSnap.cpp +123 -0
- package/native/core/ScrollSnap.h +80 -0
- package/native/core/ShareFallback.cpp +101 -0
- package/native/core/ShareFallback.h +45 -0
- package/native/core/SkiaPictureViewComponent.cpp +11 -0
- package/native/core/SkiaPictureViewComponent.h +47 -0
- package/native/core/SourceCodeModule.cpp +55 -0
- package/native/core/SourceCodeModule.h +53 -0
- package/native/core/StatusBarModule.cpp +23 -0
- package/native/core/StatusBarModule.h +42 -0
- package/native/core/TestDialog.cpp +148 -0
- package/native/core/TestDialog.h +96 -0
- package/native/core/TestKeys.cpp +78 -0
- package/native/core/TestKeys.h +50 -0
- package/native/core/TestQuitFile.cpp +33 -0
- package/native/core/TestQuitFile.h +60 -0
- package/native/core/TestSettle.h +192 -0
- package/native/core/TitleBarRegions.h +31 -0
- package/native/core/TurboModuleProxy.cpp +51 -0
- package/native/core/TurboModuleProxy.h +46 -0
- package/native/core/UIManagerAccess.cpp +43 -0
- package/native/core/UIManagerAccess.h +43 -0
- package/native/core/WindowBoundsCache.cpp +319 -0
- package/native/core/WindowControl.h +235 -0
- package/native/core/WindowHost.h +158 -0
- package/native/core/WindowMethods.cpp +167 -0
- package/native/core/WindowMethods.h +84 -0
- package/native/core/WindowsModule.cpp +448 -0
- package/native/core/WindowsModule.h +133 -0
- package/native/core/WorkletsModule.cpp +199 -0
- package/native/core/WorkletsModule.h +57 -0
- package/native/core/portability_probe.cpp +210 -0
- package/native/tests/EventRecorder.h +124 -0
- package/native/tests/TestHarness.cpp +109 -0
- package/native/tests/TestHarness.h +89 -0
- package/native/tests/TreeDump.h +49 -0
- package/native/tests/test_app_identity.cpp +114 -0
- package/native/tests/test_app_paths.cpp +48 -0
- package/native/tests/test_appearance.cpp +107 -0
- package/native/tests/test_backface.cpp +79 -0
- package/native/tests/test_blobs.cpp +157 -0
- package/native/tests/test_controls.cpp +185 -0
- package/native/tests/test_devbundle.cpp +103 -0
- package/native/tests/test_drag_and_drop.cpp +143 -0
- package/native/tests/test_gestures.cpp +331 -0
- package/native/tests/test_hover.cpp +92 -0
- package/native/tests/test_image_cache.cpp +109 -0
- package/native/tests/test_js_runtime_access.cpp +137 -0
- package/native/tests/test_key_events.cpp +235 -0
- package/native/tests/test_momentum.cpp +138 -0
- package/native/tests/test_quit_file.cpp +104 -0
- package/native/tests/test_scroll_animation.cpp +120 -0
- package/native/tests/test_scroll_bounds.cpp +66 -0
- package/native/tests/test_scroll_indicator.cpp +149 -0
- package/native/tests/test_scroll_snap.cpp +112 -0
- package/native/tests/test_settle.cpp +115 -0
- package/native/tests/test_share.cpp +75 -0
- package/native/tests/test_sourcecode.cpp +62 -0
- package/native/tests/test_window_close.cpp +119 -0
- package/native/tests/test_window_limits.cpp +123 -0
- package/package.json +43 -0
- package/react-native.config.js +86 -0
- package/supported-versions.json +66 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Expo's core runtime, from the app's own expo-modules-core.
|
|
2
|
+
#
|
|
3
|
+
# Nothing is vendored and nothing is fetched. expo-modules-core ships its
|
|
4
|
+
# portable C++ in the npm package, under common/cpp, and it depends on JSI and a
|
|
5
|
+
# call invoker and nothing else -- no JNI, no Objective-C. So the app's own copy
|
|
6
|
+
# compiles, at the app's own Expo version, which keeps Expo's C++ and JavaScript
|
|
7
|
+
# in step for the same reason building against the app's React Native does.
|
|
8
|
+
#
|
|
9
|
+
# See src/ExpoRuntime.cpp for what is installed and what is deliberately not.
|
|
10
|
+
|
|
11
|
+
if(NOT DEFINED BASALT_EXPO_MODULES_CORE)
|
|
12
|
+
return()
|
|
13
|
+
endif()
|
|
14
|
+
|
|
15
|
+
get_filename_component(EXPO_CORE_DIR "${BASALT_EXPO_MODULES_CORE}" ABSOLUTE)
|
|
16
|
+
set(EXPO_CPP_DIR ${EXPO_CORE_DIR}/common/cpp)
|
|
17
|
+
|
|
18
|
+
if(NOT EXISTS ${EXPO_CPP_DIR}/EventEmitter.cpp)
|
|
19
|
+
message(FATAL_ERROR
|
|
20
|
+
"no expo-modules-core C++ at ${EXPO_CPP_DIR}.\n"
|
|
21
|
+
"BASALT_EXPO_MODULES_CORE should name an installed "
|
|
22
|
+
"expo-modules-core, the one in the app's node_modules.")
|
|
23
|
+
endif()
|
|
24
|
+
|
|
25
|
+
# The runtime classes and their JSI helpers, and deliberately not everything
|
|
26
|
+
# under common/cpp. `fabric/` holds Expo's own Fabric view components, which are
|
|
27
|
+
# a separate port with a separate purpose: they need the whole renderer include
|
|
28
|
+
# set, and nothing installs them here because no Expo view exists on this
|
|
29
|
+
# platform. `tests/` brings a test framework this build has no reason to have.
|
|
30
|
+
file(GLOB EXPO_CORE_SRC CONFIGURE_DEPENDS
|
|
31
|
+
${EXPO_CPP_DIR}/*.cpp
|
|
32
|
+
${EXPO_CPP_DIR}/JSI/*.cpp)
|
|
33
|
+
list(FILTER EXPO_CORE_SRC EXCLUDE REGEX "/tests?/")
|
|
34
|
+
|
|
35
|
+
# On Windows, a copy with `#import` spelled `#include`.
|
|
36
|
+
#
|
|
37
|
+
# expo-modules-core's C++ is written for clang and GCC, where `#import` is an
|
|
38
|
+
# include that happens once. clang-cl reads it the way MSVC does -- as a COM
|
|
39
|
+
# type-library import -- and refuses it ("#import of type library is an
|
|
40
|
+
# unsupported Microsoft feature"), and nothing turns that reading off without
|
|
41
|
+
# also turning off the Microsoft compatibility the Windows SDK's headers need.
|
|
42
|
+
# In the expo-modules-core that SDK 57 installs it is one line, in
|
|
43
|
+
# JSI/ObjectDeallocator.h, and every file that includes that header fails with
|
|
44
|
+
# it -- this platform's own ExpoRuntime.cpp included, which is why the copy is
|
|
45
|
+
# also what goes on the include path.
|
|
46
|
+
#
|
|
47
|
+
# A copy in the build tree rather than an edit to node_modules, which npm
|
|
48
|
+
# rewrites on every install. Both directories are copied whole, headers and
|
|
49
|
+
# all, because a quoted include is looked for beside the file that includes it
|
|
50
|
+
# before any include path is consulted. Every header already carries
|
|
51
|
+
# `#pragma once`, so `#include` loses nothing `#import` gave. Worth reporting
|
|
52
|
+
# upstream: a C++ header has no need of an Objective-C directive.
|
|
53
|
+
if(WIN32)
|
|
54
|
+
set(EXPO_CPP_COPY ${CMAKE_CURRENT_BINARY_DIR}/expo-modules-core-cpp)
|
|
55
|
+
file(GLOB EXPO_CPP_FILES CONFIGURE_DEPENDS
|
|
56
|
+
${EXPO_CPP_DIR}/*.h ${EXPO_CPP_DIR}/*.cpp
|
|
57
|
+
${EXPO_CPP_DIR}/JSI/*.h ${EXPO_CPP_DIR}/JSI/*.cpp)
|
|
58
|
+
foreach(source ${EXPO_CPP_FILES})
|
|
59
|
+
file(RELATIVE_PATH relative ${EXPO_CPP_DIR} ${source})
|
|
60
|
+
file(READ ${source} contents)
|
|
61
|
+
string(REGEX REPLACE "(^|\n)([ \t]*)#([ \t]*)import([ \t])" "\\1\\2#\\3include\\4" contents "${contents}")
|
|
62
|
+
# Only written when it differs, so a reconfigure does not touch every
|
|
63
|
+
# object's timestamp and rebuild them all.
|
|
64
|
+
set(copy ${EXPO_CPP_COPY}/${relative})
|
|
65
|
+
set(existing "")
|
|
66
|
+
if(EXISTS ${copy})
|
|
67
|
+
file(READ ${copy} existing)
|
|
68
|
+
endif()
|
|
69
|
+
if(NOT existing STREQUAL contents)
|
|
70
|
+
file(WRITE ${copy} "${contents}")
|
|
71
|
+
endif()
|
|
72
|
+
endforeach()
|
|
73
|
+
list(TRANSFORM EXPO_CORE_SRC REPLACE "^${EXPO_CPP_DIR}" "${EXPO_CPP_COPY}")
|
|
74
|
+
set(EXPO_CPP_DIR ${EXPO_CPP_COPY})
|
|
75
|
+
endif()
|
|
76
|
+
|
|
77
|
+
# `ExpoModulesJSI/JSIUtils.h`, which is how expo-modules-core's own sources have
|
|
78
|
+
# included their JSI helpers since version 55.
|
|
79
|
+
#
|
|
80
|
+
# The files are still at `common/cpp/JSI/`; what changed is that upstream split
|
|
81
|
+
# them into a second CocoaPods pod named ExpoModulesJSI, and CocoaPods publishes
|
|
82
|
+
# a pod's headers under its own name. A build that is not CocoaPods has to make
|
|
83
|
+
# that prefix resolve itself, which is one directory with one link in it -- and
|
|
84
|
+
# adding `common/cpp/JSI` to the include path, as this already does, does not
|
|
85
|
+
# help, because the include names the prefix.
|
|
86
|
+
#
|
|
87
|
+
# Only built when the prefix does not already resolve, so an older
|
|
88
|
+
# expo-modules-core is untouched.
|
|
89
|
+
if(EXISTS ${EXPO_CPP_DIR}/JSI/JSIUtils.h AND NOT EXISTS ${EXPO_CPP_DIR}/ExpoModulesJSI/JSIUtils.h)
|
|
90
|
+
set(EXPO_JSI_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/expo-modules-jsi-include)
|
|
91
|
+
file(MAKE_DIRECTORY ${EXPO_JSI_PREFIX})
|
|
92
|
+
if(WIN32)
|
|
93
|
+
# No symlink without developer mode; the headers are small and this is the
|
|
94
|
+
# same copy-into-the-build-tree the #import rewrite above already does.
|
|
95
|
+
file(COPY ${EXPO_CPP_DIR}/JSI/ DESTINATION ${EXPO_JSI_PREFIX}/ExpoModulesJSI
|
|
96
|
+
FILES_MATCHING PATTERN "*.h")
|
|
97
|
+
else()
|
|
98
|
+
# Removed and remade rather than created when absent: pointing
|
|
99
|
+
# BASALT_EXPO_MODULES_CORE at a different install would otherwise leave the
|
|
100
|
+
# link aimed at the old one, and the same header would then be included
|
|
101
|
+
# under two paths and redefine everything in it.
|
|
102
|
+
file(REMOVE ${EXPO_JSI_PREFIX}/ExpoModulesJSI)
|
|
103
|
+
file(CREATE_LINK ${EXPO_CPP_DIR}/JSI ${EXPO_JSI_PREFIX}/ExpoModulesJSI SYMBOLIC)
|
|
104
|
+
endif()
|
|
105
|
+
endif()
|
|
106
|
+
|
|
107
|
+
add_library(expo_core OBJECT ${EXPO_CORE_SRC})
|
|
108
|
+
# SYSTEM, and warnings off: these are somebody else's sources held to somebody
|
|
109
|
+
# else's warning set, and this project's -Wall -Wextra is about its own code.
|
|
110
|
+
target_include_directories(expo_core SYSTEM PUBLIC
|
|
111
|
+
${EXPO_CPP_DIR} ${EXPO_CPP_DIR}/JSI ${EXPO_JSI_PREFIX}
|
|
112
|
+
${RN_DIR}/ReactCommon ${RN_DIR}/ReactCommon/jsi ${FOLLY_DIR})
|
|
113
|
+
target_compile_options(expo_core PRIVATE -w)
|
|
114
|
+
# TypedArray.cpp throws std::runtime_error without including <stdexcept>.
|
|
115
|
+
# libstdc++ and libc++ happen to pull it in through <string>; Microsoft's
|
|
116
|
+
# standard library does not. Force-included rather than patched into the copy
|
|
117
|
+
# above, because it is a missing include rather than a wrong directive, and the
|
|
118
|
+
# next file to make the same assumption will not need its own fix.
|
|
119
|
+
if(MSVC)
|
|
120
|
+
target_compile_options(expo_core PRIVATE /FIstdexcept)
|
|
121
|
+
endif()
|
|
122
|
+
target_link_libraries(expo_core folly_runtime glog)
|
|
123
|
+
|
|
124
|
+
message(STATUS "Expo core from ${EXPO_CORE_DIR}")
|
|
125
|
+
add_compile_definitions(BASALT_HAS_EXPO=1)
|