node-sword-interface 1.0.74 → 1.0.76

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/binding.gyp CHANGED
@@ -6,11 +6,11 @@
6
6
  # 2. Get the deployment target (e.g., '15.0') from env, default to '13.0'
7
7
  "ios_ver%": "<!(python3 -c \"import os; print(os.environ.get('IPHONEOS_DEPLOYMENT_TARGET', '13.0'))\")",
8
8
 
9
- # 3. Detect if it's a simulator build
10
- "is_ios_sim%": "<!(python3 -c \"import os; print(1 if 'iPhoneSimulator' in os.environ.get('SDKROOT', '') else 0)\")",
11
-
12
- # 4. Construct the full target triple dynamically
13
- "ios_target": "<!(python3 -c \"import os; ver = os.environ.get('IPHONEOS_DEPLOYMENT_TARGET', '13.0'); suffix = '-simulator' if 'iPhoneSimulator' in os.environ.get('SDKROOT', '') else ''; print(f'arm64-apple-ios{ver}{suffix}')\")"
9
+ # 3. Construct the full target triple dynamically
10
+ "ios_target": "<!(python3 -c \"import os; ver = os.environ.get('IPHONEOS_DEPLOYMENT_TARGET', '13.0'); suffix = '-simulator' if 'iPhoneSimulator' in os.environ.get('SDKROOT', '') else ''; print(f'arm64-apple-ios{ver}{suffix}')\")",
11
+
12
+ # 4. Detect the SDK to use (iphoneos or iphonesimulator)
13
+ "ios_sdk": "<!(python3 -c \"import os; print('iphonesimulator' if 'iPhoneSimulator' in os.environ.get('SDKROOT', '') else 'iphoneos')\")"
14
14
  },
15
15
  "targets": [
16
16
  {
@@ -19,7 +19,7 @@
19
19
  'conditions': [
20
20
  ["is_ios==1", {
21
21
  "xcode_settings": {
22
- "SDKROOT": "iphoneos",
22
+ "SDKROOT": "<(ios_sdk)",
23
23
  "IPHONEOS_DEPLOYMENT_TARGET": "<(ios_ver)"
24
24
  },
25
25
  'actions': [
@@ -28,7 +28,7 @@
28
28
  'message': 'Building sword library for iOS...',
29
29
  'inputs': [],
30
30
  'outputs': ['sword_build/libsword.a'],
31
- 'action': ['./scripts/build_sword.sh', '--ios'],
31
+ 'action': ['./scripts/build_sword.sh', '--ios', '<(ios_target)', '<(ios_ver)'],
32
32
  }
33
33
  ]
34
34
  }],
@@ -120,7 +120,7 @@
120
120
  'sword'
121
121
  ],
122
122
  "xcode_settings": {
123
- "SDKROOT": "iphoneos",
123
+ "SDKROOT": "<(ios_sdk)",
124
124
  "IPHONEOS_DEPLOYMENT_TARGET": "<(ios_ver)",
125
125
  "ONLY_ACTIVE_ARCH": "YES",
126
126
  "OTHER_CFLAGS": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-sword-interface",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
4
4
  "description": "Javascript (N-API) interface to SWORD library",
5
5
  "keywords": [
6
6
  "C++",
@@ -83,14 +83,26 @@ elif [ "$1" = "--ios" ] ; then
83
83
  git clone https://github.com/karlkleinpaste/biblesync.git
84
84
  git -C biblesync checkout 2.1.0
85
85
 
86
+ IOS_TARGET="$2"
87
+ IOS_VER="$3"
88
+
89
+ if [ -z "$IOS_VER" ]; then
90
+ IOS_VER="13.0"
91
+ fi
92
+
93
+ SYSROOT="iphoneos"
94
+ if echo "$IOS_TARGET" | grep -q "simulator"; then
95
+ SYSROOT="iphonesimulator"
96
+ fi
97
+
86
98
  cd sword_build
87
99
 
88
100
  cmake -DCMAKE_SYSTEM_NAME=iOS \
89
101
  -DLIBSWORD_LIBRARY_TYPE=Static \
90
102
  -DCMAKE_CXX_STANDARD=11 \
91
103
  -DCMAKE_OSX_ARCHITECTURES="arm64" \
92
- -DCMAKE_OSX_SYSROOT=iphoneos \
93
- -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
104
+ -DCMAKE_OSX_SYSROOT=$SYSROOT \
105
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=$IOS_VER \
94
106
  -DCMAKE_BUILD_TYPE=$SWORD_BUILD_TYPE \
95
107
  -DNODYNCAST=1 \
96
108
  -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \