diff --git a/examples/bindings/objective-c/libztExampleApp/libztExampleApp.xcodeproj/project.pbxproj b/examples/bindings/objective-c/libztExampleApp/libztExampleApp.xcodeproj/project.pbxproj new file mode 100644 index 0000000..899c3bd --- /dev/null +++ b/examples/bindings/objective-c/libztExampleApp/libztExampleApp.xcodeproj/project.pbxproj @@ -0,0 +1,294 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 7CF6CAD01F997537002A1137 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7CF6CACF1F997537002A1137 /* main.m */; }; + 7CF6CAD81F997575002A1137 /* libzt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CF6CAD71F997575002A1137 /* libzt.a */; }; + 7CF6CADB1F99762B002A1137 /* libztWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CF6CAD91F99762B002A1137 /* libztWrapper.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 7CF6CACA1F997537002A1137 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 7CF6CACC1F997537002A1137 /* libztExampleApp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = libztExampleApp; sourceTree = BUILT_PRODUCTS_DIR; }; + 7CF6CACF1F997537002A1137 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 7CF6CAD71F997575002A1137 /* libzt.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzt.a; path = ../../../../build/darwin/libzt.a; sourceTree = ""; }; + 7CF6CAD91F99762B002A1137 /* libztWrapper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = libztWrapper.cpp; sourceTree = ""; }; + 7CF6CADA1F99762B002A1137 /* libztWrapper.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = libztWrapper.hpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7CF6CAC91F997537002A1137 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7CF6CAD81F997575002A1137 /* libzt.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7CF6CAC31F997537002A1137 = { + isa = PBXGroup; + children = ( + 7CF6CAD91F99762B002A1137 /* libztWrapper.cpp */, + 7CF6CADA1F99762B002A1137 /* libztWrapper.hpp */, + 7CF6CACE1F997537002A1137 /* libztExampleApp */, + 7CF6CACD1F997537002A1137 /* Products */, + 7CF6CAD61F997574002A1137 /* Frameworks */, + ); + sourceTree = ""; + }; + 7CF6CACD1F997537002A1137 /* Products */ = { + isa = PBXGroup; + children = ( + 7CF6CACC1F997537002A1137 /* libztExampleApp */, + ); + name = Products; + sourceTree = ""; + }; + 7CF6CACE1F997537002A1137 /* libztExampleApp */ = { + isa = PBXGroup; + children = ( + 7CF6CACF1F997537002A1137 /* main.m */, + ); + path = libztExampleApp; + sourceTree = ""; + }; + 7CF6CAD61F997574002A1137 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7CF6CAD71F997575002A1137 /* libzt.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7CF6CACB1F997537002A1137 /* libztExampleApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7CF6CAD31F997537002A1137 /* Build configuration list for PBXNativeTarget "libztExampleApp" */; + buildPhases = ( + 7CF6CAC81F997537002A1137 /* Sources */, + 7CF6CAC91F997537002A1137 /* Frameworks */, + 7CF6CACA1F997537002A1137 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = libztExampleApp; + productName = libztExampleApp; + productReference = 7CF6CACC1F997537002A1137 /* libztExampleApp */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7CF6CAC41F997537002A1137 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0900; + ORGANIZATIONNAME = "ZeroTier, Inc."; + TargetAttributes = { + 7CF6CACB1F997537002A1137 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 7CF6CAC71F997537002A1137 /* Build configuration list for PBXProject "libztExampleApp" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7CF6CAC31F997537002A1137; + productRefGroup = 7CF6CACD1F997537002A1137 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 7CF6CACB1F997537002A1137 /* libztExampleApp */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 7CF6CAC81F997537002A1137 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7CF6CAD01F997537002A1137 /* main.m in Sources */, + 7CF6CADB1F99762B002A1137 /* libztWrapper.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 7CF6CAD11F997537002A1137 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 7CF6CAD21F997537002A1137 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + }; + name = Release; + }; + 7CF6CAD41F997537002A1137 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + LIBRARY_SEARCH_PATHS = ../../../../build/darwin; + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = ../../../../include; + }; + name = Debug; + }; + 7CF6CAD51F997537002A1137 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + LIBRARY_SEARCH_PATHS = ../../../../build/darwin; + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = ../../../../include; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7CF6CAC71F997537002A1137 /* Build configuration list for PBXProject "libztExampleApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7CF6CAD11F997537002A1137 /* Debug */, + 7CF6CAD21F997537002A1137 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7CF6CAD31F997537002A1137 /* Build configuration list for PBXNativeTarget "libztExampleApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7CF6CAD41F997537002A1137 /* Debug */, + 7CF6CAD51F997537002A1137 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7CF6CAC41F997537002A1137 /* Project object */; +} diff --git a/examples/bindings/objective-c/libztExampleApp/libztExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/bindings/objective-c/libztExampleApp/libztExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..4c9e100 --- /dev/null +++ b/examples/bindings/objective-c/libztExampleApp/libztExampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/examples/bindings/objective-c/libztExampleApp/libztExampleApp.xcodeproj/xcuserdata/joseph.xcuserdatad/xcschemes/xcschememanagement.plist b/examples/bindings/objective-c/libztExampleApp/libztExampleApp.xcodeproj/xcuserdata/joseph.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..75b2710 --- /dev/null +++ b/examples/bindings/objective-c/libztExampleApp/libztExampleApp.xcodeproj/xcuserdata/joseph.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + libztExampleApp.xcscheme + + orderHint + 0 + + + + diff --git a/examples/bindings/objective-c/libztExampleApp/libztExampleApp/main.m b/examples/bindings/objective-c/libztExampleApp/libztExampleApp/main.m new file mode 100644 index 0000000..391b26b --- /dev/null +++ b/examples/bindings/objective-c/libztExampleApp/libztExampleApp/main.m @@ -0,0 +1,19 @@ +// +// main.m +// libztExampleApp +// +// Created by Joseph Henry on 10/19/17. +// Copyright © 2017 ZeroTier, Inc. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // insert code here... + NSLog(@"Hello, World!"); + zts_startjoin("libzt_config_path", "XXXXXXXXXXXXXXXX"); + zts_socket(2, 1, 0); + } + return 0; +} diff --git a/examples/bindings/objective-c/libztExampleApp/libztWrapper.cpp b/examples/bindings/objective-c/libztExampleApp/libztWrapper.cpp new file mode 100644 index 0000000..5ef99a6 --- /dev/null +++ b/examples/bindings/objective-c/libztExampleApp/libztWrapper.cpp @@ -0,0 +1,9 @@ +// +// libztWrapper.cpp +// libztExampleApp +// +// Created by Joseph Henry on 10/19/17. +// Copyright © 2017 ZeroTier, Inc. All rights reserved. +// + +#include "libztWrapper.hpp" diff --git a/examples/bindings/objective-c/libztExampleApp/libztWrapper.hpp b/examples/bindings/objective-c/libztExampleApp/libztWrapper.hpp new file mode 100644 index 0000000..86c5d61 --- /dev/null +++ b/examples/bindings/objective-c/libztExampleApp/libztWrapper.hpp @@ -0,0 +1,14 @@ +// +// libztWrapper.hpp +// libztExampleApp +// +// Created by Joseph Henry on 10/19/17. +// Copyright © 2017 ZeroTier, Inc. All rights reserved. +// + +#ifndef libztWrapper_hpp +#define libztWrapper_hpp + +#include + +#endif /* libztWrapper_hpp */