From dc35e311bbac44698abc0aacf0ebc2b8d0e93b45 Mon Sep 17 00:00:00 2001 From: Eric Chamberlain Date: Wed, 12 Nov 2014 14:31:41 -0800 Subject: [PATCH 1/4] Updated the library to use best practice conventions when building iOS Frameworks. --- GEMagicKit.h | 3 -- GEMagicKit.m | 1 + GEMagicResult.h | 3 -- MagicKit.h | 5 ++- MagicKit.xcodeproj/project.pbxproj | 54 +++++++++++------------------- MagicKit_Prefix.pch | 5 ++- libmagic/strlcat.c | 7 ++-- libmagic/strlcpy.c | 11 +++--- 8 files changed, 36 insertions(+), 53 deletions(-) diff --git a/GEMagicKit.h b/GEMagicKit.h index bc96ada..66b333c 100644 --- a/GEMagicKit.h +++ b/GEMagicKit.h @@ -23,9 +23,6 @@ * THE SOFTWARE. */ -#import -#import - @class GEMagicResult; @interface GEMagicKit : NSObject { diff --git a/GEMagicKit.m b/GEMagicKit.m index 1a5120e..b794925 100644 --- a/GEMagicKit.m +++ b/GEMagicKit.m @@ -22,6 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + #import "GEMagicKit.h" #import "GEMagicResult.h" #import "magic.h" diff --git a/GEMagicResult.h b/GEMagicResult.h index 3e02240..1b19310 100644 --- a/GEMagicResult.h +++ b/GEMagicResult.h @@ -23,9 +23,6 @@ * THE SOFTWARE. */ -#import -#import - @interface GEMagicResult : NSObject { NSString *mimeType; NSString *description; diff --git a/MagicKit.h b/MagicKit.h index 664a015..f23c214 100644 --- a/MagicKit.h +++ b/MagicKit.h @@ -23,6 +23,5 @@ * THE SOFTWARE. */ -#import -#import -#import \ No newline at end of file +#import "GEMagicKit.h" +#import "GEMagicResult.h" \ No newline at end of file diff --git a/MagicKit.xcodeproj/project.pbxproj b/MagicKit.xcodeproj/project.pbxproj index 01f0bbe..3e68e5c 100644 --- a/MagicKit.xcodeproj/project.pbxproj +++ b/MagicKit.xcodeproj/project.pbxproj @@ -7,16 +7,16 @@ objects = { /* Begin PBXBuildFile section */ + 071C0C471A1416E800392295 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 071C0C461A1416E800392295 /* MobileCoreServices.framework */; }; + 07775EC81A14129F00A02B79 /* GEMagicResult.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A1D1271094B003CF804 /* GEMagicResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3DCAEFDD162D893A0036D9BF /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DDC92A8912618B050012DE28 /* libz.dylib */; }; - 3DCAEFE6162D8BDE0036D9BF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DCAEFE5162D8BDE0036D9BF /* Foundation.framework */; }; 3DCAF01C162D9C520036D9BF /* magic.mgc in Resources */ = {isa = PBXBuildFile; fileRef = 3DCAF01B162D9C520036D9BF /* magic.mgc */; }; 5F4F51871551FFD300248063 /* GEMagicResult.m in Sources */ = {isa = PBXBuildFile; fileRef = DD610A1E1271094B003CF804 /* GEMagicResult.m */; }; DD2BBE3D1262DBD3001B55D4 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD2BBE3C1262DBD3001B55D4 /* CoreServices.framework */; }; DD610A1F1271094B003CF804 /* GEMagicResult.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A1D1271094B003CF804 /* GEMagicResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; DD610A201271094B003CF804 /* GEMagicResult.m in Sources */ = {isa = PBXBuildFile; fileRef = DD610A1E1271094B003CF804 /* GEMagicResult.m */; }; - DD610A4512710B7B003CF804 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD610A4412710B7B003CF804 /* MobileCoreServices.framework */; }; DD610A6712710C90003CF804 /* MagicKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A6612710C90003CF804 /* MagicKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DD610A6812710C90003CF804 /* MagicKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A6612710C90003CF804 /* MagicKit.h */; }; + DD610A6812710C90003CF804 /* MagicKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A6612710C90003CF804 /* MagicKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; DDC9299A126187080012DE28 /* apprentice.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92978126187080012DE28 /* apprentice.c */; }; DDC9299B126187080012DE28 /* apptype.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92979126187080012DE28 /* apptype.c */; }; DDC9299C126187080012DE28 /* ascmagic.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC9297A126187080012DE28 /* ascmagic.c */; }; @@ -48,7 +48,6 @@ DDC929BD1261872F0012DE28 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = DDC929BC1261872F0012DE28 /* config.h */; }; DDC929DB126187CE0012DE28 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; DDC929DF126187DA0012DE28 /* GEMagicKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DDC929DE126187DA0012DE28 /* GEMagicKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DDC92A8812618B050012DE28 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DDC92A8712618B050012DE28 /* Foundation.framework */; }; DDC92A8A12618B050012DE28 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DDC92A8912618B050012DE28 /* libz.dylib */; }; DDC92B1212618B3D0012DE28 /* readelf.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92992126187080012DE28 /* readelf.c */; }; DDC92B1312618B3D0012DE28 /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC9297B126187080012DE28 /* asprintf.c */; }; @@ -90,10 +89,10 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 071C0C461A1416E800392295 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; }; 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 32DBCF5E0370ADEE00C91783 /* MagicKit_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MagicKit_Prefix.pch; sourceTree = ""; }; - 3DCAEFE5162D8BDE0036D9BF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 3DCAEFF4162D8C950036D9BF /* MagicKitTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "MagicKitTest-Prefix.pch"; path = "MagicKitTest/MagicKitTest-Prefix.pch"; sourceTree = ""; }; 3DCAF01B162D9C520036D9BF /* magic.mgc */ = {isa = PBXFileReference; lastKnownFileType = file; path = magic.mgc; sourceTree = ""; }; 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -101,7 +100,6 @@ DD2BBE3C1262DBD3001B55D4 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; DD610A1D1271094B003CF804 /* GEMagicResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GEMagicResult.h; sourceTree = ""; }; DD610A1E1271094B003CF804 /* GEMagicResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GEMagicResult.m; sourceTree = ""; }; - DD610A4412710B7B003CF804 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; DD610A6612710C90003CF804 /* MagicKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MagicKit.h; sourceTree = ""; }; DDC92978126187080012DE28 /* apprentice.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = apprentice.c; path = libmagic/apprentice.c; sourceTree = SOURCE_ROOT; }; DDC92979126187080012DE28 /* apptype.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = apptype.c; path = libmagic/apptype.c; sourceTree = SOURCE_ROOT; }; @@ -136,7 +134,6 @@ DDC929C0126187420012DE28 /* libz.1.1.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.1.3.dylib; path = usr/lib/libz.1.1.3.dylib; sourceTree = SDKROOT; }; DDC929DE126187DA0012DE28 /* GEMagicKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GEMagicKit.h; sourceTree = ""; }; DDC92A8412618AE90012DE28 /* libMagicKit-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libMagicKit-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - DDC92A8712618B050012DE28 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; DDC92A8912618B050012DE28 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; DDC92B6E12618E120012DE28 /* GEMagicKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GEMagicKit.m; sourceTree = ""; }; DDC92C0512619C1E0012DE28 /* MagicKitTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MagicKitTest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -151,7 +148,6 @@ buildActionMask = 2147483647; files = ( DDC92C4212619DB10012DE28 /* MagicKit.framework in Frameworks */, - 3DCAEFE6162D8BDE0036D9BF /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -169,9 +165,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DDC92A8812618B050012DE28 /* Foundation.framework in Frameworks */, + 071C0C471A1416E800392295 /* MobileCoreServices.framework in Frameworks */, DDC92A8A12618B050012DE28 /* libz.dylib in Frameworks */, - DD610A4512710B7B003CF804 /* MobileCoreServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -204,8 +199,6 @@ 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( - 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */, - 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */, ); name = "External Frameworks and Libraries"; sourceTree = ""; @@ -231,19 +224,6 @@ name = Classes; sourceTree = ""; }; - 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - DD610A4412710B7B003CF804 /* MobileCoreServices.framework */, - DD2BBE3C1262DBD3001B55D4 /* CoreServices.framework */, - DDC929C0126187420012DE28 /* libz.1.1.3.dylib */, - DDC92A8712618B050012DE28 /* Foundation.framework */, - DDC92A8912618B050012DE28 /* libz.dylib */, - 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( @@ -263,7 +243,12 @@ 3DCAEFE4162D8BDE0036D9BF /* Frameworks */ = { isa = PBXGroup; children = ( - 3DCAEFE5162D8BDE0036D9BF /* Foundation.framework */, + 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, + DD2BBE3C1262DBD3001B55D4 /* CoreServices.framework */, + DDC929C0126187420012DE28 /* libz.1.1.3.dylib */, + DDC92A8912618B050012DE28 /* libz.dylib */, + 071C0C461A1416E800392295 /* MobileCoreServices.framework */, + 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; @@ -333,6 +318,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + DD610A6712710C90003CF804 /* MagicKit.h in Headers */, DDC929A0126187080012DE28 /* cdf.h in Headers */, DDC929A2126187080012DE28 /* elfclass.h in Headers */, DDC929A4126187080012DE28 /* file_opts.h in Headers */, @@ -344,7 +330,6 @@ DDC929BD1261872F0012DE28 /* config.h in Headers */, DDC929DF126187DA0012DE28 /* GEMagicKit.h in Headers */, DD610A1F1271094B003CF804 /* GEMagicResult.h in Headers */, - DD610A6712710C90003CF804 /* MagicKit.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -352,8 +337,9 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - DDC92B4B12618BEE0012DE28 /* GEMagicKit.h in Headers */, DD610A6812710C90003CF804 /* MagicKit.h in Headers */, + DDC92B4B12618BEE0012DE28 /* GEMagicKit.h in Headers */, + 07775EC81A14129F00A02B79 /* GEMagicResult.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -381,10 +367,10 @@ isa = PBXNativeTarget; buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "MagicKit" */; buildPhases = ( - 8DC2EF500486A6940098B216 /* Headers */, - 8DC2EF520486A6940098B216 /* Resources */, 8DC2EF540486A6940098B216 /* Sources */, 8DC2EF560486A6940098B216 /* Frameworks */, + 8DC2EF500486A6940098B216 /* Headers */, + 8DC2EF520486A6940098B216 /* Resources */, ); buildRules = ( ); @@ -419,7 +405,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0450; + LastUpgradeCheck = 0610; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "MagicKit" */; compatibilityVersion = "Xcode 3.2"; @@ -575,7 +561,6 @@ 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; @@ -589,7 +574,6 @@ 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -641,10 +625,10 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = armv7; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREFIX_HEADER = MagicKit_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "HAVE_CONFIG_H=1"; PRODUCT_NAME = "MagicKit-iOS"; SDKROOT = iphoneos; @@ -656,9 +640,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = armv7; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_PREFIX_HEADER = MagicKit_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "HAVE_CONFIG_H=1"; PRODUCT_NAME = "MagicKit-iOS"; SDKROOT = iphoneos; diff --git a/MagicKit_Prefix.pch b/MagicKit_Prefix.pch index a0e7e43..541d6c9 100644 --- a/MagicKit_Prefix.pch +++ b/MagicKit_Prefix.pch @@ -3,5 +3,8 @@ // #ifdef __OBJC__ - #import + +// #import OS X and I don't care. +#import + #endif diff --git a/libmagic/strlcat.c b/libmagic/strlcat.c index 9692bc1..138409d 100644 --- a/libmagic/strlcat.c +++ b/libmagic/strlcat.c @@ -28,7 +28,7 @@ * will be copied. Always NUL terminates (unless siz <= strlen(dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. - */ + * size_t strlcat(char *dst, const char *src, size_t siz) { @@ -37,7 +37,7 @@ strlcat(char *dst, const char *src, size_t siz) size_t n = siz; size_t dlen; - /* Find the end of dst and adjust bytes left but don't go past end */ + // Find the end of dst and adjust bytes left but don't go past end while (n-- != 0 && *d != '\0') d++; dlen = d - dst; @@ -54,5 +54,6 @@ strlcat(char *dst, const char *src, size_t siz) } *d = '\0'; - return(dlen + (s - src)); /* count does not include NUL */ + return(dlen + (s - src)); // count does not include NUL } +*/ \ No newline at end of file diff --git a/libmagic/strlcpy.c b/libmagic/strlcpy.c index 992501c..0105b6a 100644 --- a/libmagic/strlcpy.c +++ b/libmagic/strlcpy.c @@ -26,7 +26,7 @@ * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. - */ + * size_t strlcpy(char *dst, const char *src, size_t siz) { @@ -34,7 +34,7 @@ strlcpy(char *dst, const char *src, size_t siz) const char *s = src; size_t n = siz; - /* Copy as many bytes as will fit */ + // Copy as many bytes as will fit if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) @@ -42,13 +42,14 @@ strlcpy(char *dst, const char *src, size_t siz) } while (--n != 0); } - /* Not enough room in dst, add NUL and traverse rest of src */ + // Not enough room in dst, add NUL and traverse rest of src if (n == 0) { if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ + *d = '\0'; // NUL-terminate dst while (*s++) ; } - return(s - src - 1); /* count does not include NUL */ + return(s - src - 1); // count does not include NUL } +*/ \ No newline at end of file From 4949fd84c741555880f81fcbe149c06fb0f9f8bd Mon Sep 17 00:00:00 2001 From: Eric Chamberlain Date: Wed, 12 Nov 2014 15:38:09 -0800 Subject: [PATCH 2/4] Changed several build settings to match a working static library. --- MagicKit.xcodeproj/project.pbxproj | 72 +++++++++++++++++++++++++----- MagicKit_Prefix.pch | 2 +- 2 files changed, 62 insertions(+), 12 deletions(-) diff --git a/MagicKit.xcodeproj/project.pbxproj b/MagicKit.xcodeproj/project.pbxproj index 3e68e5c..a8b24bc 100644 --- a/MagicKit.xcodeproj/project.pbxproj +++ b/MagicKit.xcodeproj/project.pbxproj @@ -9,10 +9,12 @@ /* Begin PBXBuildFile section */ 071C0C471A1416E800392295 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 071C0C461A1416E800392295 /* MobileCoreServices.framework */; }; 07775EC81A14129F00A02B79 /* GEMagicResult.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A1D1271094B003CF804 /* GEMagicResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 07EBE4091A141F72000060D1 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 071C0C461A1416E800392295 /* MobileCoreServices.framework */; }; + 07EBE40B1A14202A000060D1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07EBE40A1A14202A000060D1 /* Foundation.framework */; }; + 07EBE40E1A142471000060D1 /* MagicKit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DD610A6612710C90003CF804 /* MagicKit.h */; }; 3DCAEFDD162D893A0036D9BF /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DDC92A8912618B050012DE28 /* libz.dylib */; }; 3DCAF01C162D9C520036D9BF /* magic.mgc in Resources */ = {isa = PBXBuildFile; fileRef = 3DCAF01B162D9C520036D9BF /* magic.mgc */; }; 5F4F51871551FFD300248063 /* GEMagicResult.m in Sources */ = {isa = PBXBuildFile; fileRef = DD610A1E1271094B003CF804 /* GEMagicResult.m */; }; - DD2BBE3D1262DBD3001B55D4 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD2BBE3C1262DBD3001B55D4 /* CoreServices.framework */; }; DD610A1F1271094B003CF804 /* GEMagicResult.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A1D1271094B003CF804 /* GEMagicResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; DD610A201271094B003CF804 /* GEMagicResult.m in Sources */ = {isa = PBXBuildFile; fileRef = DD610A1E1271094B003CF804 /* GEMagicResult.m */; }; DD610A6712710C90003CF804 /* MagicKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A6612710C90003CF804 /* MagicKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -46,7 +48,6 @@ DDC929BA126187080012DE28 /* tar.h in Headers */ = {isa = PBXBuildFile; fileRef = DDC92998126187080012DE28 /* tar.h */; }; DDC929BB126187080012DE28 /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92999126187080012DE28 /* vasprintf.c */; }; DDC929BD1261872F0012DE28 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = DDC929BC1261872F0012DE28 /* config.h */; }; - DDC929DB126187CE0012DE28 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; DDC929DF126187DA0012DE28 /* GEMagicKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DDC929DE126187DA0012DE28 /* GEMagicKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; DDC92A8A12618B050012DE28 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DDC92A8912618B050012DE28 /* libz.dylib */; }; DDC92B1212618B3D0012DE28 /* readelf.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92992126187080012DE28 /* readelf.c */; }; @@ -88,9 +89,22 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 07EBE40D1A142468000060D1 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + 07EBE40E1A142471000060D1 /* MagicKit.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 071C0C461A1416E800392295 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; }; - 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 07EBE40A1A14202A000060D1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 32DBCF5E0370ADEE00C91783 /* MagicKit_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MagicKit_Prefix.pch; sourceTree = ""; }; 3DCAEFF4162D8C950036D9BF /* MagicKitTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "MagicKitTest-Prefix.pch"; path = "MagicKitTest/MagicKitTest-Prefix.pch"; sourceTree = ""; }; @@ -156,8 +170,8 @@ buildActionMask = 2147483647; files = ( 3DCAEFDD162D893A0036D9BF /* libz.dylib in Frameworks */, - DDC929DB126187CE0012DE28 /* Foundation.framework in Frameworks */, - DD2BBE3D1262DBD3001B55D4 /* CoreServices.framework in Frameworks */, + 07EBE40B1A14202A000060D1 /* Foundation.framework in Frameworks */, + 07EBE4091A141F72000060D1 /* MobileCoreServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -227,7 +241,7 @@ 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( - 0867D69BFE84028FC02AAC07 /* Foundation.framework */, + 07EBE40A1A14202A000060D1 /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = ""; @@ -386,9 +400,10 @@ isa = PBXNativeTarget; buildConfigurationList = DDC92A8D12618B050012DE28 /* Build configuration list for PBXNativeTarget "MagicKit-iOS" */; buildPhases = ( - DDC92A8012618AE90012DE28 /* Headers */, DDC92A8112618AE90012DE28 /* Sources */, DDC92A8212618AE90012DE28 /* Frameworks */, + 07EBE40D1A142468000060D1 /* CopyFiles */, + DDC92A8012618AE90012DE28 /* Headers */, ); buildRules = ( ); @@ -533,9 +548,12 @@ GCC_PREFIX_HEADER = MagicKit_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "HAVE_CONFIG_H=1"; INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "@rpath"; + INSTALL_PATH = "@executable_path/../Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; PRODUCT_NAME = MagicKit; + SDKROOT = macosx; SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = framework; }; name = Debug; @@ -551,9 +569,12 @@ GCC_PREFIX_HEADER = MagicKit_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "HAVE_CONFIG_H=1"; INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "@rpath"; + INSTALL_PATH = "@executable_path/../Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; PRODUCT_NAME = MagicKit; + SDKROOT = macosx; SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = framework; }; name = Release; @@ -625,13 +646,28 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = MagicKit_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "HAVE_CONFIG_H=1"; + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ( + "HAVE_CONFIG_H=1", + "DEBUG=1", + ); + GCC_WARN_UNDECLARED_SELECTOR = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = "-ObjC"; + PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include; PRODUCT_NAME = "MagicKit-iOS"; + PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; + STRIP_STYLE = "non-global"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -640,13 +676,27 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - COPY_PHASE_STRIP = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = MagicKit_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "HAVE_CONFIG_H=1"; + GCC_WARN_UNDECLARED_SELECTOR = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = "-ObjC"; + PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include; PRODUCT_NAME = "MagicKit-iOS"; + PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; + STRIP_STYLE = "non-global"; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; }; name = Release; }; diff --git a/MagicKit_Prefix.pch b/MagicKit_Prefix.pch index 541d6c9..03b7985 100644 --- a/MagicKit_Prefix.pch +++ b/MagicKit_Prefix.pch @@ -4,7 +4,7 @@ #ifdef __OBJC__ -// #import OS X and I don't care. +// #import OS X #import #endif From 14548e5a535c9febbe41e55ef497a53e5c2aa19e Mon Sep 17 00:00:00 2001 From: Eric Chamberlain Date: Wed, 12 Nov 2014 16:45:32 -0800 Subject: [PATCH 3/4] Updated a few more build settings to compile correctly as a static lib. --- MagicKit.xcodeproj/project.pbxproj | 4 ---- MagicKitTest/main.m | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/MagicKit.xcodeproj/project.pbxproj b/MagicKit.xcodeproj/project.pbxproj index a8b24bc..521b20a 100644 --- a/MagicKit.xcodeproj/project.pbxproj +++ b/MagicKit.xcodeproj/project.pbxproj @@ -75,7 +75,6 @@ DDC92B6F12618E120012DE28 /* GEMagicKit.m in Sources */ = {isa = PBXBuildFile; fileRef = DDC92B6E12618E120012DE28 /* GEMagicKit.m */; }; DDC92B7012618E120012DE28 /* GEMagicKit.m in Sources */ = {isa = PBXBuildFile; fileRef = DDC92B6E12618E120012DE28 /* GEMagicKit.m */; }; DDC92C4212619DB10012DE28 /* MagicKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* MagicKit.framework */; }; - DDC92C5A12619EBC0012DE28 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DDC92C5912619EBC0012DE28 /* main.m */; }; DDC92C5E1261A07F0012DE28 /* LICENCE in Resources */ = {isa = PBXBuildFile; fileRef = DDC92C5D1261A07F0012DE28 /* LICENCE */; }; /* End PBXBuildFile section */ @@ -151,7 +150,6 @@ DDC92A8912618B050012DE28 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; DDC92B6E12618E120012DE28 /* GEMagicKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GEMagicKit.m; sourceTree = ""; }; DDC92C0512619C1E0012DE28 /* MagicKitTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MagicKitTest; sourceTree = BUILT_PRODUCTS_DIR; }; - DDC92C5912619EBC0012DE28 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = MagicKitTest/main.m; sourceTree = SOURCE_ROOT; }; DDC92C5D1261A07F0012DE28 /* LICENCE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENCE; sourceTree = ""; }; DDC92C6E1261A2640012DE28 /* README.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.markdown; sourceTree = ""; }; /* End PBXFileReference section */ @@ -320,7 +318,6 @@ isa = PBXGroup; children = ( 3DCAEFF4162D8C950036D9BF /* MagicKitTest-Prefix.pch */, - DDC92C5912619EBC0012DE28 /* main.m */, ); name = "MagicKit Test"; sourceTree = ""; @@ -461,7 +458,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DDC92C5A12619EBC0012DE28 /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MagicKitTest/main.m b/MagicKitTest/main.m index d4a6e26..f8bcae4 100644 --- a/MagicKitTest/main.m +++ b/MagicKitTest/main.m @@ -44,4 +44,4 @@ int main (int argc, const char * argv[]) { [pool drain]; return 0; -} \ No newline at end of file +} From 53a6f57916896f0949146a219a12c9902e0fbb7a Mon Sep 17 00:00:00 2001 From: Eric Chamberlain Date: Wed, 19 Nov 2014 12:59:17 -0800 Subject: [PATCH 4/4] Fixed build issues with MagicKit library. Added note to Vim command key that the Escape key is supported. --- MagicKit.xcodeproj/project.pbxproj | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/MagicKit.xcodeproj/project.pbxproj b/MagicKit.xcodeproj/project.pbxproj index 521b20a..106c52c 100644 --- a/MagicKit.xcodeproj/project.pbxproj +++ b/MagicKit.xcodeproj/project.pbxproj @@ -8,17 +8,17 @@ /* Begin PBXBuildFile section */ 071C0C471A1416E800392295 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 071C0C461A1416E800392295 /* MobileCoreServices.framework */; }; - 07775EC81A14129F00A02B79 /* GEMagicResult.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A1D1271094B003CF804 /* GEMagicResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 075B60F91A1D3AB7009916DE /* GEMagicKit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DDC929DE126187DA0012DE28 /* GEMagicKit.h */; }; + 075B60FA1A1D3AB7009916DE /* GEMagicResult.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DD610A1D1271094B003CF804 /* GEMagicResult.h */; }; + 075B60FB1A1D3ABE009916DE /* MagicKit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DD610A6612710C90003CF804 /* MagicKit.h */; }; 07EBE4091A141F72000060D1 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 071C0C461A1416E800392295 /* MobileCoreServices.framework */; }; 07EBE40B1A14202A000060D1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07EBE40A1A14202A000060D1 /* Foundation.framework */; }; - 07EBE40E1A142471000060D1 /* MagicKit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DD610A6612710C90003CF804 /* MagicKit.h */; }; 3DCAEFDD162D893A0036D9BF /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DDC92A8912618B050012DE28 /* libz.dylib */; }; 3DCAF01C162D9C520036D9BF /* magic.mgc in Resources */ = {isa = PBXBuildFile; fileRef = 3DCAF01B162D9C520036D9BF /* magic.mgc */; }; 5F4F51871551FFD300248063 /* GEMagicResult.m in Sources */ = {isa = PBXBuildFile; fileRef = DD610A1E1271094B003CF804 /* GEMagicResult.m */; }; DD610A1F1271094B003CF804 /* GEMagicResult.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A1D1271094B003CF804 /* GEMagicResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; DD610A201271094B003CF804 /* GEMagicResult.m in Sources */ = {isa = PBXBuildFile; fileRef = DD610A1E1271094B003CF804 /* GEMagicResult.m */; }; DD610A6712710C90003CF804 /* MagicKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A6612710C90003CF804 /* MagicKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DD610A6812710C90003CF804 /* MagicKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DD610A6612710C90003CF804 /* MagicKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; DDC9299A126187080012DE28 /* apprentice.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92978126187080012DE28 /* apprentice.c */; }; DDC9299B126187080012DE28 /* apptype.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92979126187080012DE28 /* apptype.c */; }; DDC9299C126187080012DE28 /* ascmagic.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC9297A126187080012DE28 /* ascmagic.c */; }; @@ -71,7 +71,6 @@ DDC92B2E12618B3D0012DE28 /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92999126187080012DE28 /* vasprintf.c */; }; DDC92B2F12618B3D0012DE28 /* funcs.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92986126187080012DE28 /* funcs.c */; }; DDC92B3012618B3D0012DE28 /* fsmagic.c in Sources */ = {isa = PBXBuildFile; fileRef = DDC92985126187080012DE28 /* fsmagic.c */; }; - DDC92B4B12618BEE0012DE28 /* GEMagicKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DDC929DE126187DA0012DE28 /* GEMagicKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; DDC92B6F12618E120012DE28 /* GEMagicKit.m in Sources */ = {isa = PBXBuildFile; fileRef = DDC92B6E12618E120012DE28 /* GEMagicKit.m */; }; DDC92B7012618E120012DE28 /* GEMagicKit.m in Sources */ = {isa = PBXBuildFile; fileRef = DDC92B6E12618E120012DE28 /* GEMagicKit.m */; }; DDC92C4212619DB10012DE28 /* MagicKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* MagicKit.framework */; }; @@ -95,7 +94,9 @@ dstPath = "include/$(PRODUCT_NAME)"; dstSubfolderSpec = 16; files = ( - 07EBE40E1A142471000060D1 /* MagicKit.h in CopyFiles */, + 075B60FB1A1D3ABE009916DE /* MagicKit.h in CopyFiles */, + 075B60F91A1D3AB7009916DE /* GEMagicKit.h in CopyFiles */, + 075B60FA1A1D3AB7009916DE /* GEMagicResult.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -344,16 +345,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DDC92A8012618AE90012DE28 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - DD610A6812710C90003CF804 /* MagicKit.h in Headers */, - DDC92B4B12618BEE0012DE28 /* GEMagicKit.h in Headers */, - 07775EC81A14129F00A02B79 /* GEMagicResult.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -400,7 +391,6 @@ DDC92A8112618AE90012DE28 /* Sources */, DDC92A8212618AE90012DE28 /* Frameworks */, 07EBE40D1A142468000060D1 /* CopyFiles */, - DDC92A8012618AE90012DE28 /* Headers */, ); buildRules = ( );