Skip to content

Commit cea494b

Browse files
author
Mihail Slavchev
committed
Update ios-project-service.ts
Clarify the need to run NativeScript's MetadataGenerator for iOS with the DYLD_FALLBACK_LIBRARY_PATH environment variable set.
1 parent 93e35d5 commit cea494b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/services/ios-project-service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ class IOSProjectService implements IPlatformProjectService {
240240

241241
this.$logger.info("Generating metadata for %s.framework. This can take a minute.", frameworkName);
242242
var sdkPath = this.$childProcess.exec("xcrun -sdk iphoneos --show-sdk-path").wait().trim();
243+
// MetadataGenerator P/Invokes libclang.dylib, so we need to instruct the Mach-O loader where to find it.
244+
// Without this Mono will fail with a DllNotFoundException.
245+
// Once the MetadataGenerator is rewritten in C++ and starts linking Clang statically, this will become superfluous.
243246
var generatorExecOptions = {
244247
env: {
245248
DYLD_FALLBACK_LIBRARY_PATH: this.$childProcess.exec("xcode-select -p").wait().trim() + "/Toolchains/XcodeDefault.xctoolchain/usr/lib"
@@ -272,4 +275,4 @@ class IOSProjectService implements IPlatformProjectService {
272275
}).future<void>()();
273276
}
274277
}
275-
$injector.register("iOSProjectService", IOSProjectService);
278+
$injector.register("iOSProjectService", IOSProjectService);

0 commit comments

Comments
 (0)