Skip to content

Commit 719cea3

Browse files
authored
Xcode iOS Target Project Fixes (#8328)
* iOS Template Project Fixes for Target Configuration (Debug/Release) Also Target Device Simulator or Real. core ios Project - targetname to just simple openFrameworks LIB_OF -> LIB_OF_RELEASE / LIB_OF_DEBUG Object-C enabled by default * OSX Project fixes for Release target * Fix for fmt missing #8300 * iOS location plist permission * Fix for ios ci script - add device target for later too * iOS Subproject be damned * Adding library must set relative to group in setting
1 parent 2e80c2b commit 719cea3

10 files changed

Lines changed: 2083 additions & 920 deletions

File tree

libs/openFrameworksCompiled/project/ios/CoreOF.xcconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ HEADER_OPENSSL = "$(OF_PATH)/libs/openssl/include"
2626

2727

2828
//------- Libraries
29-
LIB_OF = "$(OF_PATH)/libs/openFrameworksCompiled/lib/ios/openFrameworksiOS.a"
29+
LIB_OF_RELEASE = "$(OF_PATH)/libs/openFrameworksCompiled/lib/ios/openFrameworksiOS.a"
3030
LIB_OF_DEBUG = "$(OF_PATH)/libs/openFrameworksCompiled/lib/ios/openFrameworksiOSDebug.a"
3131

3232
//LIB_FREEIMAGE = "$(OF_PATH)/libs/FreeImage/lib/ios/freeimage.a"
@@ -36,9 +36,8 @@ LIB_OF_DEBUG = "$(OF_PATH)/libs/openFrameworksCompiled/lib/ios/openFrameworksiOS
3636
//LIB_URIPARSER = "$(OF_PATH)/libs/uriparser/lib/ios/uriparser.a"
3737
//LIB_PUGIXML = "$(OF_PATH)/libs/pugixml/lib/ios/pugixml.a"
3838

39-
40-
4139
MISC_FLAGS = "-ObjC"
40+
LINK_OBJC_RUNTIME = YES
4241

4342
OF_CORE_LIBS = $(MISC_FLAGS) $(LIB_OF)
4443

libs/openFrameworksCompiled/project/ios/iOS+OFLib.xcodeproj/project.pbxproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,9 +1140,9 @@
11401140
/* End PBXHeadersBuildPhase section */
11411141

11421142
/* Begin PBXNativeTarget section */
1143-
BB24DE5C10DA7A3F00E9C588 /* iOS+OF Static Library */ = {
1143+
BB24DE5C10DA7A3F00E9C588 /* openFrameworks */ = {
11441144
isa = PBXNativeTarget;
1145-
buildConfigurationList = BB24DED210DA7A3F00E9C588 /* Build configuration list for PBXNativeTarget "iOS+OF Static Library" */;
1145+
buildConfigurationList = BB24DED210DA7A3F00E9C588 /* Build configuration list for PBXNativeTarget "openFrameworks" */;
11461146
buildPhases = (
11471147
BB24DE5D10DA7A3F00E9C588 /* Headers */,
11481148
BB24DEB110DA7A3F00E9C588 /* Sources */,
@@ -1153,7 +1153,7 @@
11531153
);
11541154
dependencies = (
11551155
);
1156-
name = "iOS+OF Static Library";
1156+
name = openFrameworks;
11571157
productName = "Static Library";
11581158
productReference = BB24DED610DA7A3F00E9C588 /* openFrameworksiOSDebug.a */;
11591159
productType = "com.apple.product-type.library.static";
@@ -1179,7 +1179,7 @@
11791179
projectDirPath = "";
11801180
projectRoot = "";
11811181
targets = (
1182-
BB24DE5C10DA7A3F00E9C588 /* iOS+OF Static Library */,
1182+
BB24DE5C10DA7A3F00E9C588 /* openFrameworks */,
11831183
);
11841184
};
11851185
/* End PBXProject section */
@@ -1398,9 +1398,9 @@
13981398
GCC_WARN_UNDECLARED_SELECTOR = YES;
13991399
GCC_WARN_UNUSED_FUNCTION = YES;
14001400
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
1401+
OBJROOT = "$(SRCROOT)/../../lib/ios/build/obj/Debug/";
14011402
ONLY_ACTIVE_ARCH = YES;
14021403
SDKROOT = iphoneos;
1403-
OBJROOT = "$(SRCROOT)/../../lib/ios/build/obj/Debug/";
14041404
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
14051405
WARNING_CFLAGS = (
14061406
"-Wno-non-virtual-dtor",
@@ -1438,8 +1438,8 @@
14381438
GCC_WARN_UNDECLARED_SELECTOR = YES;
14391439
GCC_WARN_UNUSED_FUNCTION = YES;
14401440
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
1441-
ONLY_ACTIVE_ARCH = NO;
14421441
OBJROOT = "$(SRCROOT)/../../lib/ios/build/obj/Release/";
1442+
ONLY_ACTIVE_ARCH = NO;
14431443
SDKROOT = iphoneos;
14441444
WARNING_CFLAGS = (
14451445
"-Wno-non-virtual-dtor",
@@ -1451,7 +1451,7 @@
14511451
/* End XCBuildConfiguration section */
14521452

14531453
/* Begin XCConfigurationList section */
1454-
BB24DED210DA7A3F00E9C588 /* Build configuration list for PBXNativeTarget "iOS+OF Static Library" */ = {
1454+
BB24DED210DA7A3F00E9C588 /* Build configuration list for PBXNativeTarget "openFrameworks" */ = {
14551455
isa = XCConfigurationList;
14561456
buildConfigurations = (
14571457
BB24DED310DA7A3F00E9C588 /* Debug */,

libs/openFrameworksCompiled/project/ios/iOS+OFLib.xcodeproj/xcshareddata/xcschemes/iOS+OF Static Library.xcscheme renamed to libs/openFrameworksCompiled/project/ios/iOS+OFLib.xcodeproj/xcshareddata/xcschemes/openFrameworks.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
BuildableIdentifier = "primary"
1717
BlueprintIdentifier = "BB24DE5C10DA7A3F00E9C588"
1818
BuildableName = "openFrameworksiOSDebug.a"
19-
BlueprintName = "iOS+OF Static Library"
19+
BlueprintName = "openFrameworks"
2020
ReferencedContainer = "container:iOS+OFLib.xcodeproj">
2121
</BuildableReference>
2222
</BuildActionEntry>
@@ -51,7 +51,7 @@
5151
BuildableIdentifier = "primary"
5252
BlueprintIdentifier = "BB24DE5C10DA7A3F00E9C588"
5353
BuildableName = "openFrameworksiOSDebug.a"
54-
BlueprintName = "iOS+OF Static Library"
54+
BlueprintName = "openFrameworks"
5555
ReferencedContainer = "container:iOS+OFLib.xcodeproj">
5656
</BuildableReference>
5757
</MacroExpansion>

libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ HEADER_URIPARSER = "$(OF_PATH)/libs/uriparser/include"
2626
HEADER_PUGIXML = "$(OF_PATH)/libs/pugixml/include"
2727

2828
//------- Libraries
29-
LIB_OF = "$(OF_PATH)/libs/openFrameworksCompiled/lib/osx/openFrameworks.a"
29+
LIB_OF_RELEASE = "$(OF_PATH)/libs/openFrameworksCompiled/lib/osx/openFrameworks.a"
3030
LIB_OF_DEBUG = "$(OF_PATH)/libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a"
3131

3232
//LIB_FMOD = "$(OF_PATH)/libs/fmod/lib/macos/libfmod.dylib"

libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
9979E8231A1CCC44007E55D1 /* ofMainLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9979E8201A1CCC44007E55D1 /* ofMainLoop.cpp */; };
6262
9979E8241A1CCC44007E55D1 /* ofMainLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 9979E8211A1CCC44007E55D1 /* ofMainLoop.h */; };
6363
BBA81C431FFBE4DB0064EA94 /* ofBaseApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BBA81C421FFBE4DB0064EA94 /* ofBaseApp.cpp */; };
64+
BF14DA522D75650400A4B85E /* fmt.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF14DA512D75650400A4B85E /* fmt.xcframework */; };
6465
BF6276A62BAD9900008864C1 /* ofBaseTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BF6276A52BAD9900008864C1 /* ofBaseTypes.h */; };
6566
BFB0B3F52C50DFE8008FB5A3 /* brotli.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF7C462D2C097CCE00461163 /* brotli.xcframework */; };
6667
BFB0B3F62C50DFE8008FB5A3 /* curl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF6276A32BAD6639008864C1 /* curl.xcframework */; };
@@ -235,6 +236,7 @@
235236
9979E8201A1CCC44007E55D1 /* ofMainLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofMainLoop.cpp; sourceTree = "<group>"; };
236237
9979E8211A1CCC44007E55D1 /* ofMainLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofMainLoop.h; sourceTree = "<group>"; };
237238
BBA81C421FFBE4DB0064EA94 /* ofBaseApp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofBaseApp.cpp; sourceTree = "<group>"; };
239+
BF14DA512D75650400A4B85E /* fmt.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = fmt.xcframework; path = ../../../fmt/lib/macos/fmt.xcframework; sourceTree = "<group>"; };
238240
BF5BF83F2B737C0A0049DEF6 /* zlib.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = zlib.xcframework; path = ../../../zlib/lib/macos/zlib.xcframework; sourceTree = "<group>"; };
239241
BF5BF8412B737C700049DEF6 /* uriparser.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = uriparser.xcframework; path = ../../../uriparser/lib/macos/uriparser.xcframework; sourceTree = "<group>"; };
240242
BF5BF8432B737C7C0049DEF6 /* tess2.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = tess2.xcframework; path = ../../../tess2/lib/macos/tess2.xcframework; sourceTree = "<group>"; };
@@ -385,6 +387,7 @@
385387
BFB0B3FF2C50DFE8008FB5A3 /* pugixml.xcframework in Frameworks */,
386388
BFB0B4002C50DFE8008FB5A3 /* rtAudio.xcframework in Frameworks */,
387389
BFB0B4012C50DFE8008FB5A3 /* tess2.xcframework in Frameworks */,
390+
BF14DA522D75650400A4B85E /* fmt.xcframework in Frameworks */,
388391
BFB0B4022C50DFE8008FB5A3 /* uriparser.xcframework in Frameworks */,
389392
BFB0B4032C50DFE8008FB5A3 /* zlib.xcframework in Frameworks */,
390393
);
@@ -396,6 +399,7 @@
396399
BF5BF83E2B7378ED0049DEF6 /* frameworks */ = {
397400
isa = PBXGroup;
398401
children = (
402+
BF14DA512D75650400A4B85E /* fmt.xcframework */,
399403
BF7C462D2C097CCE00461163 /* brotli.xcframework */,
400404
BF6276A32BAD6639008864C1 /* curl.xcframework */,
401405
BF6276A12BAD6619008864C1 /* openssl.xcframework */,

scripts/ci/ios/build.sh

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,48 @@
11
#!/bin/bash
2-
set -ev
2+
set -e
33
echo "Building openFrameworks - iOS Template Project"
44
ROOT=${TRAVIS_BUILD_DIR:-"$( cd "$(dirname "$0")/../../.." ; pwd -P )"}
55
if [[ "$GITHUB_ACTIONS" = true ]]; then
66
ROOT=$GITHUB_WORKSPACE
77
fi
8+
SKIP_DEVICE=${SKIP_DEVICE:-1} ## SKIP until figure out Identity
9+
HOST_ARCH=$(uname -m)
10+
if [[ "$HOST_ARCH" == "arm64" ]]; then
11+
SIM_ARCH="arm64"
12+
else
13+
SIM_ARCH="x86_64 arm64"
14+
fi
15+
if [ -z "${IDENTITY+x}" ]; then
16+
IDENTITY="-"
17+
fi
18+
echo "Building emptyExample for iphonesimulator"
19+
xcodebuild -configuration Release \
20+
-project "$ROOT/scripts/templates/ios/emptyExample.xcodeproj" \
21+
-target emptyExample \
22+
-sdk iphonesimulator \
23+
-arch "$SIM_ARCH" \
24+
CODE_SIGNING_ALLOWED=NO
25+
if [ $? -ne 0 ]; then
26+
echo "Error: Failed to build emptyExample for iphonesimulator"
27+
exit 1
28+
fi
29+
echo "emptyExample simulotor built successfully"
30+
31+
if [[ "$SKIP_DEVICE" = 0 ]]; then
32+
echo "Building emptyExample for iphoneos"
33+
xcodebuild -configuration Release \
34+
-project "$ROOT/scripts/templates/ios/emptyExample.xcodeproj" \
35+
-target emptyExample \
36+
-sdk iphoneos \
37+
-arch "arm64" \
38+
CODE_SIGN_STYLE=Automatic \
39+
DEVELOPMENT_TEAM="$IDENTITY" \
40+
CODE_SIGN_IDENTITY="Apple Development"
41+
if [ $? -ne 0 ]; then
42+
echo "Error: Failed to build emptyExample for device"
43+
exit 1
44+
fi
45+
echo "emptyExample device built successfully"
46+
fi
847

9-
xcodebuild -configuration Release -project "$ROOT/scripts/templates/ios/emptyExample.xcodeproj" -target emptyExample -sdk 'iphonesimulator' ARCHS='x86_64'
48+
echo "ios tests complete"

0 commit comments

Comments
 (0)