From 519c275e39a4d138ff3880aa5507467ecb316187 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Thu, 14 Jun 2018 21:26:18 +0900 Subject: [PATCH] Add `-Xlinker -no_application_extension` to `OTHER_LDFLAGS` to silence a linker warning This silences the "linking against a dylib which is not safe for use in application extensions: /Applications/Xcode.app/path/to/libswiftXCTest.dylib" linker warning. --- Nimble.podspec | 2 +- Nimble.xcodeproj/project.pbxproj | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Nimble.podspec b/Nimble.podspec index 6aaf25e07..d7a6afc69 100644 --- a/Nimble.podspec +++ b/Nimble.podspec @@ -45,7 +45,7 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES', 'ENABLE_BITCODE' => 'NO', - 'OTHER_LDFLAGS' => '-weak-lswiftXCTest', + 'OTHER_LDFLAGS' => '$(inherited) -weak-lswiftXCTest -Xlinker -no_application_extension', 'OTHER_SWIFT_FLAGS' => '$(inherited) -suppress-warnings', 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"', } diff --git a/Nimble.xcodeproj/project.pbxproj b/Nimble.xcodeproj/project.pbxproj index eba6712d9..0a2224efc 100644 --- a/Nimble.xcodeproj/project.pbxproj +++ b/Nimble.xcodeproj/project.pbxproj @@ -1933,9 +1933,12 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( + "$(inherited)", "-weak_framework", XCTest, "-weak-lswiftXCTest", + "-Xlinker", + "-no_application_extension", ); PRODUCT_BUNDLE_IDENTIFIER = "net.jeffhui.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_MODULE_NAME = Nimble; @@ -1967,9 +1970,12 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ( + "$(inherited)", "-weak_framework", XCTest, "-weak-lswiftXCTest", + "-Xlinker", + "-no_application_extension", ); PRODUCT_BUNDLE_IDENTIFIER = "net.jeffhui.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_MODULE_NAME = Nimble; @@ -2043,9 +2049,12 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; OTHER_LDFLAGS = ( + "$(inherited)", "-weak_framework", XCTest, "-weak-lswiftXCTest", + "-Xlinker", + "-no_application_extension", ); PRODUCT_BUNDLE_IDENTIFIER = "net.jeffhui.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_MODULE_NAME = Nimble; @@ -2080,9 +2089,12 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ( + "$(inherited)", "-weak_framework", XCTest, "-weak-lswiftXCTest", + "-Xlinker", + "-no_application_extension", ); PRODUCT_BUNDLE_IDENTIFIER = "net.jeffhui.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_MODULE_NAME = Nimble; @@ -2160,9 +2172,12 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; METAL_ENABLE_DEBUG_INFO = YES; OTHER_LDFLAGS = ( + "$(inherited)", "-weak_framework", XCTest, "-weak-lswiftXCTest", + "-Xlinker", + "-no_application_extension", ); PRODUCT_BUNDLE_IDENTIFIER = "net.jeffhui.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_MODULE_NAME = Nimble; @@ -2197,9 +2212,12 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; METAL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ( + "$(inherited)", "-weak_framework", XCTest, "-weak-lswiftXCTest", + "-Xlinker", + "-no_application_extension", ); PRODUCT_BUNDLE_IDENTIFIER = "net.jeffhui.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_MODULE_NAME = Nimble;