From ecdbcbff9baaea10ccae7d436562c152c3ef6a92 Mon Sep 17 00:00:00 2001 From: zzd258147 <3059450+zzd258147@users.noreply.github.com> Date: Wed, 16 Sep 2020 22:01:36 +0800 Subject: [PATCH] Fix pod install warning --- src/add-swift-support.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/add-swift-support.js b/src/add-swift-support.js index 6db9c18..32cc44e 100644 --- a/src/add-swift-support.js +++ b/src/add-swift-support.js @@ -131,9 +131,17 @@ module.exports = context => { console.log('Update IOS build setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to: YES', 'for build configuration', buildConfig.name); } - if (xcodeProject.getBuildProperty('LD_RUNPATH_SEARCH_PATHS', buildConfig.name) !== '"@executable_path/Frameworks"') { - xcodeProject.updateBuildProperty('LD_RUNPATH_SEARCH_PATHS', '"@executable_path/Frameworks"', buildConfig.name); - console.log('Update IOS build setting LD_RUNPATH_SEARCH_PATHS to: @executable_path/Frameworks', 'for build configuration', buildConfig.name); + let ldRunpathSearchPaths = xcodeProject.getBuildProperty('LD_RUNPATH_SEARCH_PATHS', buildConfig.name); + if (ldRunpathSearchPaths === undefined || ldRunpathSearchPaths.indexOf('"@executable_path/Frameworks"') === -1) { + if (ldRunpathSearchPaths === undefined) { + ldRunpathSearchPaths = ['"$(inherited)"', '"@executable_path/Frameworks"']; + } else if (typeof ldRunpathSearchPaths === 'string') { + ldRunpathSearchPaths = [ldRunpathSearchPaths, '"@executable_path/Frameworks"']; + } else if (Array.isArray(ldRunpathSearchPaths)) { + ldRunpathSearchPaths.push('"@executable_path/Frameworks"'); + } + xcodeProject.updateBuildProperty('LD_RUNPATH_SEARCH_PATHS', ldRunpathSearchPaths, buildConfig.name); + console.log('Update IOS build setting LD_RUNPATH_SEARCH_PATHS to:', ldRunpathSearchPaths, 'for build configuration', buildConfig.name); } if (typeof xcodeProject.getBuildProperty('SWIFT_VERSION', buildConfig.name) === 'undefined') {