File tree Expand file tree Collapse file tree 2 files changed +32
-16
lines changed
project-template-ios/internal
project-template-vision/internal Expand file tree Collapse file tree 2 files changed +32
-16
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22source ./.build_env_vars.sh
33
4- MODULES_DIR=" $SRCROOT /internal/Swift-Modules"
5-
6- function DELETE_SWIFT_MODULES_DIR() {
7- rm -rf " $MODULES_DIR "
8- }
9-
104function getArch() {
115 while [[ $# -gt 0 ]]
126 do
@@ -24,6 +18,21 @@ function getArch() {
2418 done
2519}
2620
21+ # Workaround for ARCH being set to `undefined_arch` here. Extract it from command line arguments.
22+ TARGET_ARCH=$( getArch " $@ " )
23+
24+ if [ -z " $TARGET_ARCH " ]; then
25+ printf ' %s\n' " NSLD: Unable to determine target architecture from arguments: $* " >&2
26+ exit 1
27+ fi
28+
29+ # Use per-architecture directory to avoid race conditions with parallel linker invocations
30+ MODULES_DIR=" $SRCROOT /internal/Swift-Modules-$TARGET_ARCH "
31+
32+ function DELETE_SWIFT_MODULES_DIR() {
33+ rm -rf " $MODULES_DIR "
34+ }
35+
2736function GEN_MODULEMAP() {
2837 ARCH_ARG=$1
2938 SWIFT_HEADER_DIR=$PER_VARIANT_OBJECT_FILE_DIR /$ARCH_ARG
@@ -52,9 +61,8 @@ function GEN_METADATA() {
5261 popd
5362}
5463
55- # Workaround for ARCH being set to `undefined_arch` here. Extract it from command line arguments.
56- TARGET_ARCH=$( getArch " $@ " )
5764GEN_MODULEMAP $TARGET_ARCH
65+ export HEADER_SEARCH_PATHS=" $HEADER_SEARCH_PATHS \" $MODULES_DIR \" "
5866printf " Generating metadata..."
5967GEN_METADATA $TARGET_ARCH
6068DELETE_SWIFT_MODULES_DIR
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22source ./.build_env_vars.sh
33
4- MODULES_DIR=" $SRCROOT /internal/Swift-Modules"
5-
6- function DELETE_SWIFT_MODULES_DIR() {
7- rm -rf " $MODULES_DIR "
8- }
9-
104function getArch() {
115 while [[ $# -gt 0 ]]
126 do
@@ -24,6 +18,21 @@ function getArch() {
2418 done
2519}
2620
21+ # Workaround for ARCH being set to `undefined_arch` here. Extract it from command line arguments.
22+ TARGET_ARCH=$( getArch " $@ " )
23+
24+ if [ -z " $TARGET_ARCH " ]; then
25+ echo " NSLD: Failed to determine target architecture from arguments: $* " >&2
26+ exit 1
27+ fi
28+
29+ # Use per-architecture directory to avoid race conditions with parallel linker invocations
30+ MODULES_DIR=" $SRCROOT /internal/Swift-Modules-$TARGET_ARCH "
31+
32+ function DELETE_SWIFT_MODULES_DIR() {
33+ rm -rf " $MODULES_DIR "
34+ }
35+
2736function GEN_MODULEMAP() {
2837 ARCH_ARG=$1
2938 SWIFT_HEADER_DIR=$PER_VARIANT_OBJECT_FILE_DIR /$ARCH_ARG
@@ -52,9 +61,8 @@ function GEN_METADATA() {
5261 popd
5362}
5463
55- # Workaround for ARCH being set to `undefined_arch` here. Extract it from command line arguments.
56- TARGET_ARCH=$( getArch " $@ " )
5764GEN_MODULEMAP $TARGET_ARCH
65+ export HEADER_SEARCH_PATHS=" ${HEADER_SEARCH_PATHS: +$HEADER_SEARCH_PATHS } \" $MODULES_DIR \" "
5866printf " Generating metadata..."
5967GEN_METADATA $TARGET_ARCH
6068DELETE_SWIFT_MODULES_DIR
You can’t perform that action at this time.
0 commit comments