diff --git a/OtherHeaderLib/mylib/AbstractClass.h b/OtherHeaderLib/mylib/AbstractClass.h new file mode 100644 index 0000000..6d8925a --- /dev/null +++ b/OtherHeaderLib/mylib/AbstractClass.h @@ -0,0 +1,7 @@ + +class AbstractClass +{ +public: + virtual int do1() = 0; + virtual int do2() = 0; +}; diff --git a/RelativeHeaderPath.xcodeproj/project.pbxproj b/Project/RelativeHeaderPath.xcodeproj/project.pbxproj similarity index 61% rename from RelativeHeaderPath.xcodeproj/project.pbxproj rename to Project/RelativeHeaderPath.xcodeproj/project.pbxproj index f4e0be9..e1a5626 100644 --- a/RelativeHeaderPath.xcodeproj/project.pbxproj +++ b/Project/RelativeHeaderPath.xcodeproj/project.pbxproj @@ -3,11 +3,17 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 48; objects = { /* Begin PBXBuildFile section */ E7FB451021FF702000A2EDB6 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7FB450F21FF702000A2EDB6 /* main.cpp */; }; + E7FB452021FF739700A2EDB6 /* StaticLib.hpp in Headers */ = {isa = PBXBuildFile; fileRef = E7FB451F21FF739700A2EDB6 /* StaticLib.hpp */; }; + E7FB452221FF739700A2EDB6 /* StaticLibPriv.hpp in Headers */ = {isa = PBXBuildFile; fileRef = E7FB452121FF739700A2EDB6 /* StaticLibPriv.hpp */; }; + E7FB452421FF739700A2EDB6 /* StaticLib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7FB452321FF739700A2EDB6 /* StaticLib.cpp */; }; + E7FB452821FF73B600A2EDB6 /* ConcreteClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7FB451621FF72D400A2EDB6 /* ConcreteClass.cpp */; }; + E7FB452A21FF73D400A2EDB6 /* libStaticLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E7FB451D21FF739700A2EDB6 /* libStaticLib.a */; }; + E7FB452C21FF75DE00A2EDB6 /* AbstractClass.h in Headers */ = {isa = PBXBuildFile; fileRef = E7FB452B21FF75DD00A2EDB6 /* AbstractClass.h */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -25,10 +31,25 @@ /* Begin PBXFileReference section */ E7FB450C21FF702000A2EDB6 /* RelativeHeaderPath */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = RelativeHeaderPath; sourceTree = BUILT_PRODUCTS_DIR; }; E7FB450F21FF702000A2EDB6 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; + E7FB451621FF72D400A2EDB6 /* ConcreteClass.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ConcreteClass.cpp; sourceTree = ""; }; + E7FB451721FF72D400A2EDB6 /* ConcreteClass.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ConcreteClass.hpp; sourceTree = ""; }; + E7FB451D21FF739700A2EDB6 /* libStaticLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libStaticLib.a; sourceTree = BUILT_PRODUCTS_DIR; }; + E7FB451F21FF739700A2EDB6 /* StaticLib.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = StaticLib.hpp; sourceTree = ""; }; + E7FB452121FF739700A2EDB6 /* StaticLibPriv.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = StaticLibPriv.hpp; sourceTree = ""; }; + E7FB452321FF739700A2EDB6 /* StaticLib.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StaticLib.cpp; sourceTree = ""; }; + E7FB452B21FF75DD00A2EDB6 /* AbstractClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AbstractClass.h; path = ../../OtherHeaderLib/mylib/AbstractClass.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ E7FB450921FF702000A2EDB6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E7FB452A21FF73D400A2EDB6 /* libStaticLib.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E7FB451B21FF739700A2EDB6 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -42,7 +63,9 @@ isa = PBXGroup; children = ( E7FB450E21FF702000A2EDB6 /* RelativeHeaderPath */, + E7FB451E21FF739700A2EDB6 /* StaticLib */, E7FB450D21FF702000A2EDB6 /* Products */, + E7FB452921FF73D400A2EDB6 /* Frameworks */, ); sourceTree = ""; }; @@ -50,6 +73,7 @@ isa = PBXGroup; children = ( E7FB450C21FF702000A2EDB6 /* RelativeHeaderPath */, + E7FB451D21FF739700A2EDB6 /* libStaticLib.a */, ); name = Products; sourceTree = ""; @@ -62,8 +86,41 @@ path = RelativeHeaderPath; sourceTree = ""; }; + E7FB451E21FF739700A2EDB6 /* StaticLib */ = { + isa = PBXGroup; + children = ( + E7FB452B21FF75DD00A2EDB6 /* AbstractClass.h */, + E7FB451621FF72D400A2EDB6 /* ConcreteClass.cpp */, + E7FB451721FF72D400A2EDB6 /* ConcreteClass.hpp */, + E7FB451F21FF739700A2EDB6 /* StaticLib.hpp */, + E7FB452121FF739700A2EDB6 /* StaticLibPriv.hpp */, + E7FB452321FF739700A2EDB6 /* StaticLib.cpp */, + ); + path = StaticLib; + sourceTree = ""; + }; + E7FB452921FF73D400A2EDB6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + E7FB451921FF739700A2EDB6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + E7FB452C21FF75DE00A2EDB6 /* AbstractClass.h in Headers */, + E7FB452021FF739700A2EDB6 /* StaticLib.hpp in Headers */, + E7FB452221FF739700A2EDB6 /* StaticLibPriv.hpp in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ E7FB450B21FF702000A2EDB6 /* RelativeHeaderPath */ = { isa = PBXNativeTarget; @@ -82,6 +139,23 @@ productReference = E7FB450C21FF702000A2EDB6 /* RelativeHeaderPath */; productType = "com.apple.product-type.tool"; }; + E7FB451C21FF739700A2EDB6 /* StaticLib */ = { + isa = PBXNativeTarget; + buildConfigurationList = E7FB452521FF739700A2EDB6 /* Build configuration list for PBXNativeTarget "StaticLib" */; + buildPhases = ( + E7FB451921FF739700A2EDB6 /* Headers */, + E7FB451A21FF739700A2EDB6 /* Sources */, + E7FB451B21FF739700A2EDB6 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = StaticLib; + productName = StaticLib; + productReference = E7FB451D21FF739700A2EDB6 /* libStaticLib.a */; + productType = "com.apple.product-type.library.static"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -93,11 +167,16 @@ TargetAttributes = { E7FB450B21FF702000A2EDB6 = { CreatedOnToolsVersion = 10.1; + ProvisioningStyle = Automatic; + }; + E7FB451C21FF739700A2EDB6 = { + CreatedOnToolsVersion = 10.1; + ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = E7FB450721FF702000A2EDB6 /* Build configuration list for PBXProject "RelativeHeaderPath" */; - compatibilityVersion = "Xcode 9.3"; + compatibilityVersion = "Xcode 8.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -109,6 +188,7 @@ projectRoot = ""; targets = ( E7FB450B21FF702000A2EDB6 /* RelativeHeaderPath */, + E7FB451C21FF739700A2EDB6 /* StaticLib */, ); }; /* End PBXProject section */ @@ -122,6 +202,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + E7FB451A21FF739700A2EDB6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E7FB452421FF739700A2EDB6 /* StaticLib.cpp in Sources */, + E7FB452821FF73B600A2EDB6 /* ConcreteClass.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ @@ -176,6 +265,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ../OtherHeaderLib; MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -229,6 +319,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ../OtherHeaderLib; MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -254,6 +345,32 @@ }; name = Release; }; + E7FB452621FF739700A2EDB6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = YJBPWVJ32D; + EXECUTABLE_PREFIX = lib; + GCC_ENABLE_CPP_EXCEPTIONS = YES; + GCC_ENABLE_CPP_RTTI = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + E7FB452721FF739700A2EDB6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = YJBPWVJ32D; + EXECUTABLE_PREFIX = lib; + GCC_ENABLE_CPP_EXCEPTIONS = YES; + GCC_ENABLE_CPP_RTTI = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -275,6 +392,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + E7FB452521FF739700A2EDB6 /* Build configuration list for PBXNativeTarget "StaticLib" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E7FB452621FF739700A2EDB6 /* Debug */, + E7FB452721FF739700A2EDB6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = E7FB450421FF702000A2EDB6 /* Project object */; diff --git a/RelativeHeaderPath.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Project/RelativeHeaderPath.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from RelativeHeaderPath.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Project/RelativeHeaderPath.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Project/RelativeHeaderPath.xcodeproj/xcuserdata/amatosov.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Project/RelativeHeaderPath.xcodeproj/xcuserdata/amatosov.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..d66cbb7 --- /dev/null +++ b/Project/RelativeHeaderPath.xcodeproj/xcuserdata/amatosov.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/RelativeHeaderPath.xcodeproj/xcuserdata/amatosov.xcuserdatad/xcschemes/xcschememanagement.plist b/Project/RelativeHeaderPath.xcodeproj/xcuserdata/amatosov.xcuserdatad/xcschemes/xcschememanagement.plist similarity index 76% rename from RelativeHeaderPath.xcodeproj/xcuserdata/amatosov.xcuserdatad/xcschemes/xcschememanagement.plist rename to Project/RelativeHeaderPath.xcodeproj/xcuserdata/amatosov.xcuserdatad/xcschemes/xcschememanagement.plist index 8179b29..6cb1ffa 100644 --- a/RelativeHeaderPath.xcodeproj/xcuserdata/amatosov.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Project/RelativeHeaderPath.xcodeproj/xcuserdata/amatosov.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,6 +9,11 @@ orderHint 0 + StaticLib.xcscheme_^#shared#^_ + + orderHint + 1 + diff --git a/Project/RelativeHeaderPath/main.cpp b/Project/RelativeHeaderPath/main.cpp new file mode 100644 index 0000000..4181596 --- /dev/null +++ b/Project/RelativeHeaderPath/main.cpp @@ -0,0 +1,22 @@ +// +// main.cpp +// RelativeHeaderPath +// +// Created by Anton Matosov on 1/28/19. +// Copyright © 2019 Anton Matosov. All rights reserved. +// + +#include +#include +#include +#include "ConcreteClass.hpp" + +int main(int argc, const char * argv[]) +{ + std::shared_ptr ptr(new ConcreteClass()); + assert(ptr->do1() == 1); + + assert(ptr->do2() == 2); + + return 0; +} diff --git a/Project/StaticLib/ConcreteClass.cpp b/Project/StaticLib/ConcreteClass.cpp new file mode 100644 index 0000000..b251d01 --- /dev/null +++ b/Project/StaticLib/ConcreteClass.cpp @@ -0,0 +1,20 @@ +// +// ConcreteClass.cpp +// RelativeHeaderPath +// +// Created by Anton Matosov on 1/28/19. +// Copyright © 2019 Anton Matosov. All rights reserved. +// + +#include "ConcreteClass.hpp" + +int ConcreteClass::do1() +{ + return 1; +} + + +int ConcreteClass::do2() +{ + return 2; +} diff --git a/Project/StaticLib/ConcreteClass.hpp b/Project/StaticLib/ConcreteClass.hpp new file mode 100644 index 0000000..4bba721 --- /dev/null +++ b/Project/StaticLib/ConcreteClass.hpp @@ -0,0 +1,19 @@ +// +// ConcreteClass.hpp +// RelativeHeaderPath +// +// Created by Anton Matosov on 1/28/19. +// Copyright © 2019 Anton Matosov. All rights reserved. +// + +#pragma once + + +#include "mylib/AbstractClass.h" + +class ConcreteClass: public AbstractClass +{ +public: + int do1() override; + int do2() override; +}; \ No newline at end of file diff --git a/Project/StaticLib/StaticLib.cpp b/Project/StaticLib/StaticLib.cpp new file mode 100644 index 0000000..f56c0e3 --- /dev/null +++ b/Project/StaticLib/StaticLib.cpp @@ -0,0 +1,24 @@ +// +// StaticLib.cpp +// StaticLib +// +// Created by Anton Matosov on 1/28/19. +// Copyright © 2019 Anton Matosov. All rights reserved. +// + +#include +#include "StaticLib.hpp" +#include "StaticLibPriv.hpp" + +void StaticLib::HelloWorld(const char * s) +{ + StaticLibPriv *theObj = new StaticLibPriv; + theObj->HelloWorldPriv(s); + delete theObj; +}; + +void StaticLibPriv::HelloWorldPriv(const char * s) +{ + std::cout << s << std::endl; +}; + diff --git a/Project/StaticLib/StaticLib.hpp b/Project/StaticLib/StaticLib.hpp new file mode 100644 index 0000000..5f392d9 --- /dev/null +++ b/Project/StaticLib/StaticLib.hpp @@ -0,0 +1,22 @@ +// +// StaticLib.hpp +// StaticLib +// +// Created by Anton Matosov on 1/28/19. +// Copyright © 2019 Anton Matosov. All rights reserved. +// + +#ifndef StaticLib_ +#define StaticLib_ + +/* The classes below are exported */ +#pragma GCC visibility push(default) + +class StaticLib +{ + public: + void HelloWorld(const char *); +}; + +#pragma GCC visibility pop +#endif diff --git a/Project/StaticLib/StaticLibPriv.hpp b/Project/StaticLib/StaticLibPriv.hpp new file mode 100644 index 0000000..1d99d0d --- /dev/null +++ b/Project/StaticLib/StaticLibPriv.hpp @@ -0,0 +1,18 @@ +// +// StaticLibPriv.hpp +// StaticLib +// +// Created by Anton Matosov on 1/28/19. +// Copyright © 2019 Anton Matosov. All rights reserved. +// + +/* The classes below are not exported */ +#pragma GCC visibility push(hidden) + +class StaticLibPriv +{ + public: + void HelloWorldPriv(const char *); +}; + +#pragma GCC visibility pop diff --git a/RelativeHeaderPath/main.cpp b/RelativeHeaderPath/main.cpp deleted file mode 100644 index dd91d34..0000000 --- a/RelativeHeaderPath/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// -// main.cpp -// RelativeHeaderPath -// -// Created by Anton Matosov on 1/28/19. -// Copyright © 2019 Anton Matosov. All rights reserved. -// - -#include - -int main(int argc, const char * argv[]) { - // insert code here... - std::cout << "Hello, World!\n"; - return 0; -}