Permalink
Browse files

Add Mac static library

  • Loading branch information...
1 parent f52e0d2 commit 25efe7ba1802e36590d3e3956437e259eb40fa5d @soffes soffes committed Aug 15, 2012
Showing with 159 additions and 3 deletions.
  1. +140 −0 SocketRocket.xcodeproj/project.pbxproj
  2. +19 −3 SocketRocket/SRWebSocket.m
@@ -7,6 +7,16 @@
objects = {
/* Begin PBXBuildFile section */
+ B2EB6A9715DB5D160035AD92 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = F6016C7B146124B20037BB3D /* base64.c */; };
+ B2EB6A9815DB5D160035AD92 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = F6016C7E146124ED0037BB3D /* base64.h */; };
+ B2EB6A9915DB5D160035AD92 /* SRWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = F6A12CCF145119B700C1D980 /* SRWebSocket.h */; };
+ B2EB6A9A15DB5D160035AD92 /* SRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = F6A12CD0145119B700C1D980 /* SRWebSocket.m */; };
+ B2EB6A9B15DB5D160035AD92 /* NSData+SRB64Additions.h in Headers */ = {isa = PBXBuildFile; fileRef = F6572123146C7B6A00D6B8A9 /* NSData+SRB64Additions.h */; };
+ B2EB6A9C15DB5D160035AD92 /* NSData+SRB64Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = F6572124146C7B6A00D6B8A9 /* NSData+SRB64Additions.m */; };
+ B2EB6AA015DB5D530035AD92 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2EB6A9D15DB5D530035AD92 /* CoreServices.framework */; };
+ B2EB6AA115DB5D530035AD92 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2EB6A9E15DB5D530035AD92 /* Foundation.framework */; };
+ B2EB6AA215DB5D530035AD92 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2EB6A9F15DB5D530035AD92 /* Security.framework */; };
+ B2EB6AB115DB60F60035AD92 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2EB6AB015DB60F60035AD92 /* CFNetwork.framework */; };
F6016C7C146124B20037BB3D /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = F6016C7B146124B20037BB3D /* base64.c */; };
F6016C7F146124ED0037BB3D /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = F6016C7E146124ED0037BB3D /* base64.h */; };
F6016C8814620EC70037BB3D /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6A12CD3145122FC00C1D980 /* Security.framework */; };
@@ -59,6 +69,13 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ B2EB6A7315DB5C800035AD92 /* libSocketRocketOSXLibrary.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSocketRocketOSXLibrary.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ B2EB6A7415DB5C800035AD92 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; };
+ B2EB6A9D15DB5D530035AD92 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework; sourceTree = DEVELOPER_DIR; };
+ B2EB6A9E15DB5D530035AD92 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
+ B2EB6A9F15DB5D530035AD92 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
+ B2EB6AAE15DB5EB80035AD92 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/libicucore.dylib; sourceTree = DEVELOPER_DIR; };
+ B2EB6AB015DB60F60035AD92 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; };
F6016C7B146124B20037BB3D /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = base64.c; sourceTree = "<group>"; };
F6016C7E146124ED0037BB3D /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base64.h; sourceTree = "<group>"; };
F60CC29F14D4EA0500A005E4 /* SRTWebSocketOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRTWebSocketOperation.h; sourceTree = "<group>"; };
@@ -106,6 +123,17 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
+ B2EB6A7015DB5C800035AD92 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B2EB6AB115DB60F60035AD92 /* CFNetwork.framework in Frameworks */,
+ B2EB6AA015DB5D530035AD92 /* CoreServices.framework in Frameworks */,
+ B2EB6AA115DB5D530035AD92 /* Foundation.framework in Frameworks */,
+ B2EB6AA215DB5D530035AD92 /* Security.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
F62417E014D52F3C003CE997 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -214,6 +242,11 @@
F6B208221450F597009315AF = {
isa = PBXGroup;
children = (
+ B2EB6AB015DB60F60035AD92 /* CFNetwork.framework */,
+ B2EB6AAE15DB5EB80035AD92 /* libicucore.dylib */,
+ B2EB6A9D15DB5D530035AD92 /* CoreServices.framework */,
+ B2EB6A9E15DB5D530035AD92 /* Foundation.framework */,
+ B2EB6A9F15DB5D530035AD92 /* Security.framework */,
F6B208321450F597009315AF /* SocketRocket */,
F6BDA807145900D200FE3253 /* SRWebSocketTests */,
F62417EA14D52F3C003CE997 /* TestChat */,
@@ -232,6 +265,7 @@
F6BDA802145900D200FE3253 /* SRWebSocketTests.octest */,
F62417E314D52F3C003CE997 /* TestChat.app */,
F668C880153E91210044DBAC /* SocketRocket.framework */,
+ B2EB6A7315DB5C800035AD92 /* libSocketRocketOSXLibrary.a */,
);
name = Products;
sourceTree = "<group>";
@@ -247,6 +281,7 @@
F6BDA803145900D200FE3253 /* SenTestingKit.framework */,
F62417E514D52F3C003CE997 /* UIKit.framework */,
F62417E814D52F3C003CE997 /* CoreGraphics.framework */,
+ B2EB6A7415DB5C800035AD92 /* Cocoa.framework */,
F668C883153E91210044DBAC /* Other Frameworks */,
);
name = Frameworks;
@@ -300,6 +335,16 @@
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
+ B2EB6A7115DB5C800035AD92 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B2EB6A9815DB5D160035AD92 /* base64.h in Headers */,
+ B2EB6A9915DB5D160035AD92 /* SRWebSocket.h in Headers */,
+ B2EB6A9B15DB5D160035AD92 /* NSData+SRB64Additions.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
F668C87D153E91210044DBAC /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
@@ -320,6 +365,23 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
+ B2EB6A7215DB5C800035AD92 /* SocketRocketOSXLibrary */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = B2EB6A7E15DB5C800035AD92 /* Build configuration list for PBXNativeTarget "SocketRocketOSXLibrary" */;
+ buildPhases = (
+ B2EB6A6F15DB5C800035AD92 /* Sources */,
+ B2EB6A7015DB5C800035AD92 /* Frameworks */,
+ B2EB6A7115DB5C800035AD92 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = SocketRocketOSXLibrary;
+ productName = SocketRocketOSXLibrary;
+ productReference = B2EB6A7315DB5C800035AD92 /* libSocketRocketOSXLibrary.a */;
+ productType = "com.apple.product-type.library.static";
+ };
F62417E214D52F3C003CE997 /* TestChat */ = {
isa = PBXNativeTarget;
buildConfigurationList = F62417FC14D52F3C003CE997 /* Build configuration list for PBXNativeTarget "TestChat" */;
@@ -415,6 +477,7 @@
F668C87F153E91210044DBAC /* SocketRocketOSX */,
F6BDA801145900D200FE3253 /* SRWebSocketTests */,
F62417E214D52F3C003CE997 /* TestChat */,
+ B2EB6A7215DB5C800035AD92 /* SocketRocketOSXLibrary */,
);
};
/* End PBXProject section */
@@ -463,6 +526,16 @@
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ B2EB6A6F15DB5C800035AD92 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B2EB6A9715DB5D160035AD92 /* base64.c in Sources */,
+ B2EB6A9A15DB5D160035AD92 /* SRWebSocket.m in Sources */,
+ B2EB6A9C15DB5D160035AD92 /* NSData+SRB64Additions.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
F62417DF14D52F3C003CE997 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -542,6 +615,65 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
+ B2EB6A7C15DB5C800035AD92 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SYSTEM_APPS_DIR)/Xcode45-DP3.app/Contents/Developer/Library/Frameworks\"",
+ );
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SocketRocket/SocketRocket-Prefix.pch";
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = (
+ "-ObjC",
+ "-all_load",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ B2EB6A7D15DB5C800035AD92 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SYSTEM_APPS_DIR)/Xcode45-DP3.app/Contents/Developer/Library/Frameworks\"",
+ );
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SocketRocket/SocketRocket-Prefix.pch";
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ OTHER_LDFLAGS = (
+ "-ObjC",
+ "-all_load",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
F62417FD14D52F3C003CE997 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -776,6 +908,14 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ B2EB6A7E15DB5C800035AD92 /* Build configuration list for PBXNativeTarget "SocketRocketOSXLibrary" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ B2EB6A7C15DB5C800035AD92 /* Debug */,
+ B2EB6A7D15DB5C800035AD92 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
F62417FC14D52F3C003CE997 /* Build configuration list for PBXNativeTarget "TestChat" */ = {
isa = XCConfigurationList;
buildConfigurations = (
View
@@ -14,11 +14,22 @@
// limitations under the License.
//
-
#import "SRWebSocket.h"
#if TARGET_OS_IPHONE
-#define HAS_ICU
+ #define HAS_ICU
+
+ #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
+ #define NEEDS_DISPATCH_RETAIN_RELEASE 0
+ #else
+ #define NEEDS_DISPATCH_RETAIN_RELEASE 1
+ #endif
+#else
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
+ #define NEEDS_DISPATCH_RETAIN_RELEASE 0
+ #else
+ #define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
+ #endif
#endif
#ifdef HAS_ICU
@@ -309,7 +320,10 @@ - (void)_SR_commonInit;
_workQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
_callbackQueue = dispatch_get_main_queue();
+
+#if NEEDS_DISPATCH_RETAIN_RELEASE
dispatch_retain(_callbackQueue);
+#endif
_readBuffer = [[NSMutableData alloc] init];
_outputBuffer = [[NSMutableData alloc] init];
@@ -328,9 +342,11 @@ - (void)dealloc
[_inputStream close];
[_outputStream close];
-
+
+#if NEEDS_DISPATCH_RETAIN_RELEASE
dispatch_release(_callbackQueue);
dispatch_release(_workQueue);
+#endif
if (_receivedHTTPHeaders) {
CFRelease(_receivedHTTPHeaders);

0 comments on commit 25efe7b

Please sign in to comment.