Skip to content

Commit 29523d2

Browse files
committed
finally emitting NativeScript.apple.node for both iOS and macOS
1 parent 4b686cc commit 29523d2

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

NativeScript/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ elseif(TARGET_PLATFORM STREQUAL "macos")
5454
set(TARGET_PLATFORM_SPEC "macos-arm64_x86_64")
5555
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTARGET_PLATFORM_MACOS")
5656

57+
# Force dSYM generation for macOS (by default, they're embedded into the
58+
# binary itself, giving us a 14,981,336 byte / 15 MB binary)
59+
# set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym")
60+
# set(CMAKE_XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
5761
else()
5862
message(FATAL_ERROR "Unknown target platform: ${TARGET_PLATFORM}")
5963
return()
@@ -302,7 +306,7 @@ if(TARGET_PLATFORM_MACOS)
302306
# Convert the Info.plist from binary format to XML format.
303307
# This seemed to unblock a build error when using in React Native.
304308
add_custom_command(TARGET ${NAME} POST_BUILD
305-
COMMAND plutil -convert xml1 $<TARGET_FILE_DIR:${NAME}>/Info.plist
309+
COMMAND plutil -convert xml1 $<TARGET_FILE_DIR:${NAME}>/Resources/Info.plist
306310
)
307311
set(METADATA_FILE "metadata.macos.nsmd")
308312
elseif(TARGET_PLATFORM_IOS)

build_nativescript.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ checkpoint "Building NativeScript for macOS"
105105

106106
cmake_build macos x86_64 arm64
107107

108-
cp "$DIST/intermediates/macos/$CONFIG_BUILD/libNativeScript.dylib" "$DIST/../packages/macos/dist/macos/NativeScript.node"
109-
110108
fi
111109

112110
if $BUILD_VISION; then
@@ -145,11 +143,6 @@ if $BUILD_IPHONE; then
145143
-debug-symbols "$DIST/intermediates/ios/$CONFIG_BUILD-iphoneos/NativeScript.framework.dSYM" )
146144
fi
147145

148-
if $BUILD_MACOS; then
149-
XCFRAMEWORKS+=( -framework "$DIST/intermediates/macos/$CONFIG_BUILD/NativeScript.framework"
150-
-debug-symbols "$DIST/intermediates/macos/$CONFIG_BUILD/NativeScript.framework.dSYM" )
151-
fi
152-
153146
if $BUILD_VISION; then
154147
XCFRAMEWORKS+=( -framework "$DIST/intermediates/visionos/$CONFIG_BUILD-xros/NativeScript.framework"
155148
-debug-symbols "$DIST/intermediates/visionos/$CONFIG_BUILD-xros/NativeScript.framework.dSYM" )
@@ -176,7 +169,15 @@ if [[ -n "${XCFRAMEWORKS[@]}" ]]; then
176169
fi
177170
fi
178171

172+
# We're currently distributing two separate packages:
173+
# 1. UIKit-based (@nativescript/ios-node-api)
174+
# 2. AppKit-based (@nativescript/macos-node-api)
175+
# As such, there's no point bundling both UIKit-based and AppKit-based into a
176+
# single XCFramework.
179177
if $BUILD_MACOS; then
178+
XCFRAMEWORKS=( -framework "$DIST/intermediates/macos/$CONFIG_BUILD/NativeScript.framework"
179+
-debug-symbols "$DIST/intermediates/macos/$CONFIG_BUILD/NativeScript.framework.dSYM" )
180+
180181
if [[ "$TARGET_ENGINE" == "none" ]]; then
181182
checkpoint "Creating the XCFramework for macOS (NativeScript.apple.node)"
182183

0 commit comments

Comments
 (0)